May/June 2018 87
accesses the sine values in ROM sequentially, and sends
them to the DAC. The DAC generates an analog output
signal that is proportional to the binary value from the
ROM. What you get is a stepped approximation of a sine
wave.
Figure 6 is a crude example. If you use enough
samples and use more bits for the binary value, the steps
will be smaller and a more fine-grained sine wave will
occur. The frequency of the sine wave depends on the
number of samples or values you use for the sine wave and
the frequency of the clock signal that reads the values out
of the ROM. If the steps are too large, you can pass the
stepped signal through a low pass filter to smooth it out.
Special direct digital synthesis (DDS) ICs like those from
Analog Devices are available to generate sine waves from
below 1 Hz to many MHz.
Function Generator
A function generator is the name for a device that
generates sine, square, and triangle waves. It may describe
a piece of bench test equipment or an IC. One old but
still good function generator IC is the XR-2206. It was first
made by Exar in
the 1970s, but is
still around.
If you need
a sine wave
generator that
can be set to any
frequency in the 0.01 Hz to 1 MHz or more, take a look at
the XR-2206. Figure 7 shows the XR-2206 connected as a
sine wave generator. The frequency is set by R and C and is
calculated with the expression:
f = 1/RC
The internal oscillator generates a square wave and
a triangle wave. The sine shaper circuit takes the triangle
wave and modifies it into a sine wave.
This is still a great chip. Besides the three common
waveforms it generates, it can amplitude or frequency
modulate them as well.
Pulse-Based Sine Wave Generators
There are several other clever ways to make an
approximate sine wave from pulses and filters. One way
is to simply add together two square waves of the same
amplitude where one is shifted 90 degrees from the other
(Figure 8). A pair of JK flip-flops driven from opposite
phase clock pulses can produce the two square waves to
be added.
The result is a signal that can be used in some
applications to replace a sine wave. Some crude DC-to-AC inverters use this method. The effect is an average
power similar to what a sine wave would deliver to a
load. Some RC or LC filtering can smooth the wave into
a more continuous sine-like shape. This method is used in
some uninterruptible power supplies (UPS) or solar power
inverters where a perfect sine wave is not needed.
An interesting technique uses a sequence of varying
width pulses that are filtered into a sine wave. If you
apply a square wave with equal on and off times to a low
pass filter, the output will be an average of pulse voltage
over the on-off period. With a five volt pulse, the average
output over the full cycle of the wave would be 2. 5 volts.
By varying the pulse duration or width, different average
THE LATEST IN NETWORKING AND WIRELESS TECHNOLOGIES
Figure 6. A stepped approximation of a sine wave. Passing
the signal through a low pass filter will smooth out the steps.
Figure 8. A crude
way to make an
approximation of a
sine wave that may
work for some AC
power applications.
Figure 7. The XR-2206 is an older IC that is still available and a
great way to generate sine, square, and triangle waves over a
wide frequency range.