NOISE
REDUCTION
To
reduce noise levels and produce an accurate sound, try
to
use the full range of -128
to
127
when you represent a waveform. This reduces how much noise (quantization
error) will be added
to
the signal by using more bits of precision. Quantization noise
is
caused by the introduction of round-off error. If you are trying
to
reproduce a signal,
such as a sine wave, you can represent the amplitude of each sample with only so many
digits of accuracy.
The
difference between the real number and your approximation
is
round-off error, or noise.
By doubling the amplitude, you create half as much noise because the size of the steps of
the wave form stays the same and
is
therefore a smaller fraction of the amplitude. In
other words, if you try to represent a waveform using, for example, a range of only
+3
to
-3, the size of the error
in
the
output
would
be
considerably larger than if you use a
range of +127
to
-128 to represent the same signal. Proportionally, the digital value
used
to
represent the waveform amplitude will have a lower error.
As
you increase the
number of possible sample levels, you decrease the relative size of each step and, there-
fore, decrease the size of the error.
To
produce quiet sounds, continue to define the waveform using the full range,
but
adjust the volume. This maintains the same level of accuracy (signal-to-noise ratio) for
quiet sounds as for loud sounds.
ALIASING
DISTORTION
When you use sampling to produce a waveform, a side effect is caused when the sam-
pling rate
"beats"
or combines with the frequency you wish
to
produce. This produces
two additional frequencies, one
at
the sampling rate plus the desired frequency and the
other
at
the sampling rate minus the desired frequency. This phenomenon
is
called
aliasing distortion.
Aliasing distortion is eliminated when the sampling rate exceeds the
output
frequency by
at
least 7 KHz. This puts the beat frequency outside the range of the low-pass filter,
cutting
off
the undesirable frequencies. Figure
5-5
shows a frequency domain plot of the
anti-aliasing low-pass filter used
in
the system.
154 Audio Hardware