by Gerard Fonte
Most digital circuits are limited to outputting zeros and ones.
And while they can do this quickly and efficiently, there are
many more types of signals in the real world that require
something other than zeros and ones.
This article will briefly examine a
number of methods of creating
sine waves, and other waves,
from digital values. The goal of this article
is to familiarize the reader with a number
of different techniques rather than to
describe those techniques in detail.
Filtering a Square
The simplest method of convert-
PHOTO 1. A filtered square wave
from Figure 1, output A. Not a very
good sine wave.
FIGURE 1. Basic four
stage filter. The
component values will
vary according to the
desired frequency. The
frequency here is
about 1,500 Hz.
ing a square wave to
a sine wave is by
filtering. Basically, a
square wave consists of a fundamental
frequency with a lot of higher harmonics. If the harmonics can be removed,
then a sine wave of the fundamental
frequency remains. This is easier said
than done because simple passive
filters are not too efficient.
However, a reasonable sine wave
can be created with a three-stage RC
(resistor-capacitor) filter that is shown
in Figure 1. Photos 1, 2, and 3
show the result of filtering a
square wave at outputs A, B, and
C, respectively. Photo 1 is the
result of two stages of filtering
(note different amplitude scale). It
is certainly not a very good sine
wave. Photo 2 looks more like a
triangle wave than a sine wave.
But it is certainly better than
PHOTO 2. The third stage (output
B) is better, but still not a very
good sine wave.