Title: Digital Signal Processing
1Digital Signal Processing
- Rejean Lau M.Eng
- Prepared for the Department of Engineering,
Conestoga College
2What is Digital Signal Processing?
- Digital Signal Processing is distinguished from
other areas in computer science by the unique
type of data it uses signals - These signals originate as sensory data from the
real world e.g. seismic vibrations, visual
images, sound waves, etc. - DSP is the mathematics, algorithms, and
techniques used to manipulate these signals after
they have been converted into digital form
E.g JPEG encoder/decoder - The purpose of DSP is to manipulate the data, for
the purpose of a specific application - enhancement of visual images
- recognition and generation of speech
- compression of data for storage and transmission
3DSP Applications
4Components of a DSP System
Before going into the details, let us briefly
discuss the typical components of a DSP system
to see how everything fits in. Dont worry if
you dont understand all the terminology yet.
- An analog lowpass prefilter or antialiasing
filter, which limits the highest signal frequency
to ensure freedom from aliasing - A sampler, which operates above the Nyquist
sampling rate - A quantizer, which quantizes the sampled signal
values to a finite number of levels. 16-bit
quantizers are commonplace. - An encoder, which converts the quantized signal
values to a string of binary bits whose length is
determined by the number of quantization levels
of the quantizer. - The digital signal processing algorithm
(implemented in hardware or software depending
on the required speed), which processes the
encoded digital signal in the desired fashion for
the application - A decoder, which converts the processed bit
stream to a quantized, discrete-time signal - A reconstruction filter, which reconstructs a
staircase approximation of the discrete-time
signal - A lowpass analog anti-imaging filter, which
extracts the central period from the periodic
spectrum, removes the unwanted replicas, and
results in a smoothed reconstructed signal.
5ADC and DAC
- The signals encountered in the real word are
continuous or analog light intensity that
changes with distance, voltage that varies over
time, a chemical reaction rate that depends on
temperature - Analog-to-Digital Conversion (ADC) and
Digital-to-Analog Conversion (DAC) is what makes
it possible for a computer to interact with these
signals. - Digital information is different from its
continuous counterpart in two important respects
it is sampled, and it is quantized.
6Sampling and Quantization
- Quantization is the process which converts the
continuous (analog) to discrete (digital). - Before quantization occurs, the continuous signal
must first be sampled by a sample and hold
circuit (see next slide) - The number of levels of the quantizer is
determined by the number of bits. - A 16-bit quantizer has 216 65536 levels
- This means any sampled signal can be represented
by one of the 65536 levels - The quantization error is the difference between
the sampled analog signal and the quantized
digital signal
7Quantization Error
- Measured in a unit called the LSB, an
abbreviation for least significant bit - For an 8 bit ADC, an error of one LSB is 1/256 of
the full signal range - Quantization error is the difference between the
sampled signal and analog signal due to the
finite resolution of the ADC - The magnitude of the quantization error at the
sampling instant is between zero and half of one
LSB - Generally, the original signal gtgt 1 LSB and the
quantization error is not correlated with the
signal and has a uniform distribution - RMS value is 1/v12 0.289 LSB
- At lower levels, the quantizing error becomes
dependent of the input signal resulting in
distortion - The distortion is created after the anti-aliasing
filter, so if the distortions are above ½ the
sample date, they will alias - In order to make the quantizing error independent
of the input signal, noise with an amplitude of 1
quantization step is added to the signal -
technique is called dithering - slightly reduced the signal to noise ratio, but
completely eliminates distortion
8Sampling, Quantization and Quantization Error
9Sampling Theorem
- The sampling theorem indicates that a continuous
signal can be properly sampled, only if it does
not contain frequency components above one-half
of the sampling rate known as the Nyquist
Frequency - What if we sample at less than twice the Nyquist
frequency? - Aliasing occurs and the original signal cannot be
reconstructed from the samples
10Sampling Theorem
- Simple DSP system as dictated by the Sampling
Theorem
11Sampling Theorem
12Aliasing
13Sampling Theorem and Aliasing
- Sampling theorem in time and frequency domains
- Overlapping spectra in (f) caused aliasing
14Digital to Analog Conversion
15Multirate Data Conversion
- Uses more than one sampling rate in the same
system - Multirate data conversion is valuable for two
reasons - It replaces analog components with software, an
economic advantage - It can achieve higher levels levels of
performance in critical applications - Example
- Compact disc audio systems use
multirate technique to achieve - higher sound quality because analog components
(1 precision) - are replaced with digital algorithms (0.0001
precision) - Single bit ADC and DAC is a multirate technique
where a higher sampling rate is traded for a
lower number of bits - - Popular in telecommunications and high
fidelity music reproduction
16Multirate Data Conversion
- Consider the design of a digital voice recorder,
a system that will digitize a voice signal, store
the data in digital form, and later reconstruct
the signal for playback - First, pass the voice signal through a simple RC
low-pass filter and sample the data at 64 kHz. - Resulting digital data contains the desired voice
band between 100 and 3000 hertz, but also has an
unusable band between 3 kHz and 32 kHz - Second, remove these unusable frequencies in
software, by using a digital low-pass filter at 3
kHz. - Third, resample the digital signal from 64 kHz to
8 kHz by simply discarding every seven out of
eight samples, a procedure called decimation - Resulting digital data is equivalent to that
produced by aggressive analog filtering and
direct 8 kHz sampling ? we have replaced a
complex analog solution with a combination of a
simple analog solution and software!
17Multirate Data Conversion
- Multirate techniques can also be used in the
output portion - The 8 kHz data is pulled from memory and
converted to a 64 kHz sampling rate, a procedure
called interpolation - Involves placing seven samples, with a value of
0, between each of the samples obtained from
memory - Resulting signal is a digital impulse train,
containing the desired voice band between 100 and
3000 hertz, plus spectral duplications between 3
kHz and 32 kHz - (refer back to Figs. 3-6 a,b to see why this
is true) - Cut everything above 3 kHz with a digital
low-pass filter - After conversion to an analog signal through a
DAC, a simple RC network is all that is required
to produce the final voice signal
18DSP Software
- Suppose you buy a DSP microprocessor device
will have lots of built-in features for DSP
analog inputs, analog outputs, digital I/O,
antialias and reconstruction filters, etc. - Question How do you program it?
- Worst case scenario manufacturer will you an
assembler, and expect you to learn the internal
architecture of the device. - Best case scenario manufacturer provides a
software package in a high level language such as
C, to help in the programming libraries of
algorithms, prewritten routines for I/O,
debugging tools, etc. - The DSP Software Engineers task is to manipulate
signal pathways, algorithms for processing
signals, analog I/O parameters possibly in a GUI - E.g Visual DSP from Analog Devices, Matlab
Simulink - Once satisfied with the design, using a compiler,
it is transformed into machine code for execution
in the hardware - Application packages are available for image
processing, spectral analysis, instrumentation
and control, digital filter design etc.
19DSP Software
- Performance Issues
- High level or Assembly?
- As a rule-of-thumb, expect that a routine written
in assembly will be between 1.5 and 3 times
faster than the comparable high-level program - With application packages and optimized
compilers, using a high-level language makes much
more sense in terms of programmer efficiency and
is what is the norm today (circa 2007) - Reality the routines which need to be optimized
for speed are written in assembly anyways and
provided in a library, and the designer simply
needs to use the correct package in a high-level
language
20DSP Software
- The Conestoga College EET department has about 20
ADSP-2181 kits available to be signed out by
students in the SET program - User manuals are also available for sign out
- The software tool Visual DSP is available for
download from the Analog Devices web site (trial
version free)