The previous section discussed how complex analog and digital waves can be
built out of sine waves. Another way to look at the connection between analog
and digital is to see how an analog wave can be converted into discrete digits
that represent the analog wave.
In the interactive activity, click on
Draw Wave and a sine wave will be drawn. The goal is to completely
represent this wave, and its continually varying voltages, by a set of discrete
values. This process is referred to as analog-to-digital (A to D) conversion.
Conversely, a similar process operates in the opposite direction, converting D
to A.
The A to D process is completed through the following steps:
- Analog wave amplitudes are sampled at specific instances in time.
- Each sample is assigned a discrete value.
- Each discrete value is converted to a stream of bits.
Before an analog wave can be sampled, it must be determined at what
points the analog wave must be measured. The process of measuring the analog
wave only at certain time intervals is referred to as sampling. A related
decision is how many samples should be taken. Click on Take Samples in
the activity and note the result. Then, slide the Set # of Samples bar
to the right and click on Take Samples again. Now, slide the bar all the
way to the right and again click Take Samples. It is easy to see that as
more samples are taken, the wave is better represented.
Notice that the
values shown do not consist of equally balanced positive and negative values,
as is usual for a sine wave. This is because the values have been normalized,
which means that a continuous range of positive numbers from zero to the
maximum exists. Normalization of values is frequently done in mathematics, to
make it easier to work with, and understand, what the values represent.
Although the actual voltages have not changed, the scale representing the
voltages has been shifted.
It would seem that taking more samples is the
way to achieve an accurate representation of the signal. However, the more
samples that are taken, the more bits that will need to be sent. Fortunately,
there is a point beyond which additional samples will not be useful. Based on a
formula called the sampling theorem, sampling at any rate equal to or greater
than twice the frequency of the wave will allow reconstruction of the wave
without error. Therefore, a sampling rate more than twice the frequency of the
wave will not increase the accuracy.
Use the activity to set different
values for the number of samples. Click on Read Sampled Values each
time, to see the bit stream that would be transmitted for each sample.
As stated earlier, this process can be reversed. The bit stream can be
decoded, by using the approximate analog values. This process occurs whenever
someone plays a musical compact disk (CD). The music is encoded as bits in the
plastic of the CD. These bits undergo a digital to analog (D to A) conversion,
are processed by more electronics, and become the music that people hear.