Table Of ContentChapter 1
W hy DSP?
In an Instant
● D SP Defi nitions
● T he Need for DSP
● L earning Digital Signal Processing Techniques
● I nstant Summary
DSP Defi nitions
T he acronym D SP is used for two terms, d igital signal processing and digital sig-
nal processor , both of which are covered in this book. D igital signal processing is
performing signal processing using digital techniques with the aid of digital hard-
ware and/or some kind of computing device. Signal processing can of course be
analog as well, but, for a variety of reasons, we may prefer to handle the process-
ing digitally. A digital computer or processor that is designed especially for signal
processing applications is called a digital signal processor .
T HE NEED FOR DSP
T o understand the relative merits of analog and digital processing, it is conve-
nient to compare the two techniques in a common application. Figure 1.1 shows
two approaches to recording sounds such as music or speech. Figure 1.1a is the
analog approach. It works like this:
● Sound waves impact the microphone, where they are converted to electrical
impulses.
● These electrical signals are amplified, then converted to magnetic fields by
the recording head.
● As the magnetic tape moves under the head, the intensity of the magnetic
fields is stored on the tape.
www.newnespress.com
0022__HH88997766__CChh0011..iinndddd 11 99//44//22000088 11::2288::4466 PPMM
2 Digital Signal Processing: Instant Access
Analog signal in Read head Analog signal out
Write head
Direction of tape travel
(a) Analog signal recording.
Analog signal out
Analog signal in
Computer
Signal converted Numbers converted
to numbers to signal
(b) Digital signal recording.
FIGURE 1.1 A nalog and digital systems
The playback process is just the inverse of the recording process:
● As the magnetic tape moves under the playback head, the magnetic field on
the tape is converted to an electrical signal.
● The signal is then amplified and sent to the speaker. The speaker converts
the amplified signal back to sound waves.
The advantage of the analog process is twofold: first, it is conceptually
quite simple. Second, by definition, an analog signal can take on virtually an
infinite number of values within the signal’s dynamic range. Unfortunately,
this analog process is inherently unstable. The amplifiers are subject to gain
variation over temperature, humidity, and time. The magnetic tape stretches
and shrinks, thus distorting the recorded signal. The magnetic fields them-
selves will, over time, lose some of their strength. Variations in the speed of
the motor driving the tape cause additional distortion. All of these factors com-
bine to ensure that the output signal will be considerably lower in quality than
the input signal Each time the signal is passed on to another analog process,
these adverse effects are multiplied. It is rare for an analog system to be able
to make more than two or three generations of copies.
Now let’s look at the digital process as shown in Figure 1.1b :
● As in the analog case, the sound waves impact the microphone and are con-
verted to electrical signals. These electrical signals are then amplified to a
usable level.
● The electrical signals are measured or, in other words, they are converted to
numbers.
● These numbers can now be stored or manipulated by a computer just as any
other numbers are.
www.newnespress.com
0022__HH88997766__CChh0011..iinndddd 22 99//44//22000088 11::2288::4477 PPMM
Chapter 1 Why DSP? 3
● To play back the signal, the numbers are simply converted back to electri-
cal signals. As in the analog case, these signals are then used to drive a
speaker.
There are two distinct disadvantages to the digital process: first, it is far
more complicated than the analog process; second, computers can only handle
numbers of finite resolution. Thus, the (potentially) “ infinite resolution ” of the
analog signal is lost.
Insider Info
T he first major contribution in the area of digital filter synthesis was made by
Kaiser at Bell Laboratories. His work showed how to design useful filters using the
bilinear transform. Further, in about 1965 the famous paper by Cooley and Turkey
was published. In this paper, FFT (fast Fourier transform), an efficient and fast way
of performing the DFT (discrete Fourier transform) was demonstrated.
A dvantages of DSP
Obviously, there must be some compensating benefits of the digital process,
and indeed there are. First, once converted to numbers, the signal is uncon-
ditionally stable. Using techniques such as error detection and correction, it
is possible to store, transmit, and reproduce numbers with no corruption.
The twentieth generation of recording is therefore just as accurate as the first
generation.
Insider Info
T he problems with analog signal reproduction have some interesting implica-
tions. Future generations will never really know what the Beatles sounded like, for
example. The commercial analog technology of the 1960s was simply not able to
accurately record and reproduce the signals. Several generations of analog signals
were needed to reproduce the sound: First, a master tape would be recorded, and
then mixed and edited; from this, a metal master record would be produced, from
which would come a plastic impression. Each step of the process was a new gen-
eration of recording, and each generation acted on the signal like a filter, reducing
the frequency content and skewing the phase. As with the paintings in the Sistine
Chapel, the true colors and brilliance of the original art is lost to history. Things
are different for today s musicians. A thousand years from now historians will be
able to accurately play back the digitally mastered CDs of today. The discs them-
selves may well deteriorate, but before they do, the digital numbers on them can
be copied with perfect accuracy. Signals stored digitally are really just large arrays
of numbers. As such, they are immune to the physical limitations of analog signals.
www.newnespress.com
0022__HH88997766__CChh0011..iinndddd 33 99//44//22000088 11::2288::4477 PPMM
4 Digital Signal Processing: Instant Access
T here are other significant advantages to processing signals digitally.
Geophysicists were one of the first groups to apply the techniques of signal pro-
cessing. The seismic signals of interest to them are often of very low frequency,
from 0.01 Hz to 10 Hz. It is difficult to build analog filters that work at these low
frequencies. Component values must be so large that physically implementing
the filter may well be impossible. Once the signals have been converted to digi-
tal numbers, however, it is a straightforward process to program a computer to
perform the filtering.
Other advantages to digital signals abound. For example, DSP can allow
large bandwidth signals to be sent over narrow bandwidth channels. A 20-kHz
signal can be digitized and then sent over a 5-kHz channel. The signal may
take four times as long to get through the narrower bandwidth channel, but
when it comes out the other side it can be reconstructed to its full 20-kHz
bandwidth.
In the same way, communications security can be greatly improved through
DSP. Since the signal is sent as numbers, it can be easily encrypted. When
received, the numbers are decrypted and then reproduced as the original sig-
nal. Modern “ secure telephone ” DSP systems allow this processing to be done
with no detectable effect on the conversation.
T echnology Trade-offs
DSP has several major advantages over analog signal processing techniques,
including:
● Essentially perfect reproducibility
● Guaranteed accuracy (no individual tuning and pruning needed)
● Well-suited for volume production
LEARNING DIGITAL SIGNAL PROCESSING TECHNIQUES
The most important first step of studying any subject is to grasp the overall
picture and to understand the basics before diving into the depths. With that in
mind, the goal of this book is to provide a broad introduction and overview of
DSP techniques and applications. The authors seek to bring an intuitive under-
standing of the concepts and systems involved in the field of DSP engineering.
O nly a few years ago, DSP techniques were considered advanced and eso-
teric subjects, their use limited to research labs or advanced applications such as
radar identification. Today, the technology has found its way into virtually every
segment of electronics. Computer graphics, mobile entertainment and commu-
nication devices, and automobiles are just a few of the common examples.
T he rapid acceptance and commercialization of this technology has presented
the modern design engineer with a serious challenge: either gain a working
knowledge of these techniques or risk obsolescence. Traditionally, engineers have
had two options for acquiring new skills: go back to school, or turn to vendors ’
www.newnespress.com
0022__HH88997766__CChh0011..iinndddd 44 99//44//22000088 11::2288::4477 PPMM
Chapter 1 Why DSP? 5
technical documentation. In the case of DSP, neither of these is a particularly
good option.
Undergraduate programs—and even many graduate programs—devoted
to DSP are really only thinly disguised courses in the mathematical discipline
known as complex analysis. These programs do not aim to teach a working
knowledge of DSP, but rather to prepare students for graduate research on DSP
topics. Much of the information that is needed to comprehend the “ whys and
wherefores ” of DSP are not covered.
Manufacturer documentation is often of little more use to the uninitiated.
Application notes and design guides usually focus on particular features of the
vendor’s instruction set or architecture.
I n this book, we hope to bridge the gap between the theory of DSP and the
practical knowledge necessary to understand a working DSP system. The math-
ematics is not ignored; you will find many sophisticated mathematical relation-
ships in thumbing through the pages of this book. What is left out, however,
are the formal proofs, the esoteric discussions, and the tedious mathematical
exercises. In their place are background discussions explaining how and why
the math is important, examples to run on any general-purpose computer, and
tips that can help you gain a comfortable understanding of the DSP processes.
INSTANT SUMMARY
● Digitally processing a signal allows us to do things with signals that would
be difficult, or impossible, with analog approaches.
● With modern components and techniques, these advantages can often be
realized economically and efficiently.
www.newnespress.com
0022__HH88997766__CChh0011..iinndddd 55 99//44//22000088 11::2288::4488 PPMM
Chapter 2
T he Analog-Digital Interface
In an Instant
● D efi nitions ● Number Representations
● S ampling and Reconstruction ● Digital-to-Analog Conversion
● Q uantization ● Analog-to-Digital Conversion
● E ncoding and Modulation ● Instant Summary
Defi nitions
In most systems, whether electronic, financial or social, the majority of prob-
lems arise in the interface between different subparts. This is also true for digital
signal processing systems. Most signals in real life are continuous in amplitude
and time—that is, a nalog —but our digital system is working with amplitude- and
time-discrete signals, or so-called d igital signals. So, the input signals entering our
system need to be converted from analog to digital form before the actual signal
processing can take place.
For the same reason, the output signals from our DSP device usually need to be
reconverted back from digital to analog form, to be used in, for instance, hydrau-
lic valves or loudspeakers or other analog actuators. These conversion processes
between the analog and digital world also add some problems to our system.
These matters will be addressed in this chapter, together with a brief presentation
of some common techniques to perform the actual conversion processes.
F irst we will define some of the important terms encountered in this chapter.
Sampling is the process of going from a continuous signal to a discrete signal. An
analog-to-digital converter (ADC) is a device that converts an analog voltage into a
digital number. There are a number of different types, but the most common ones
used in DSP are the s uccessive approximation register (SAR) and the flash con-
verter . A d igital-to-analog converter converts a digital number to an analog voltage.
All of these terms will be further explained as we move through the material in this
chapter.
www.newnespress.com
0033__HH88997766__CChh0022..iinndddd 77 99//55//22000088 22::4455::3399 PPMM
8 Digital Signal Processing: Instant Access
SAMPLING AND RECONSTRUCTION
Recall that sampling is how we go from a continuous (analog) signal to a
discrete (digital) signal. Sampling can be regarded as multiplying the time-
continuous signal g (t ) with a train of unit pulses p ( t ) (see Figure 2.1 )
(cid:4)∞
g#(t)(cid:2)g(t)p(t)(cid:2) ∑ g(nT)δ(t(cid:3)nT) (2.1)
n(cid:2)(cid:3)∞
where g# ( t ) is the sampled signal. Since the unit pulses are either one or zero,
the multiplication can be regarded as a pure switching operation.
The time period T between the unit pulses in the pulse train is called the
sampling period . In most cases, this period is constant, resulting in “ equidis-
tant sampling. ” In most systems today, it is common to use one or more con-
stant sampling periods. The sampling period T is related to the s ampling rate
or sampling frequency f such that
s
ω 1
f (cid:2) s (cid:2) (2.2)
s 2π T
Insider Info
T he sampling period does not have to be constant. In some systems, many differ-
ent sampling periods are used (called m ultirate sampling ). In other applications,
the sampling period may be a stochastic variable, resulting in r andom sampling ,
which complicates the analysis considerably.
The process of sampling implies reduction of knowledge. For the time-
continuous signal, we know the value of the signal at every instant of time, but
for the sampled version (the time-discrete signal) we only know the value at
specific points in time. If we want to reconstruct the original time-continuous
signal from the time-discrete sampled version, we have to make more or less
qualified interpolations of the values in between the sampling points. If our
interpolated values differ from the true signal, we have introduced distortion in
our reconstructed signal.
g(t) g#(t)
p(t)
FIGURE 2.1 S ampling viewed as a multiplication process
www.newnespress.com
0033__HH88997766__CChh0022..iinndddd 88 99//55//22000088 22::4455::4400 PPMM
Chapter 2 The Analog-Digital Interface 9
If the sampling frequency is less than twice the maximum analog signal
frequency, a phenomenon called a liasing will occur, which distorts the sam-
pled signal. We will discuss aliasing in more detail in the next chapter.
Key Concept
In order to avoid aliasing distortion in the sampled signal, it is imperative that
the bandwidth of the original time-continuous signal being sampled is smaller
than half the sampling frequency (also called the Nyquist frequency).
T o avoid aliasing distortion in practical cases, the sampling device is always
preceded by some kind of low-pass filter (a ntialiasing filter ) to reduce the
bandwidth of the incoming signal. This signal is often quite complicated and
may contain a large number of frequency components. Since it is impossible to
build perfect filters, there is a risk of too-high-frequency components leaking
into the sampler, causing aliasing distortion. We also have to be aware that high-
frequency interference may somehow enter the signal path after the low-pass fil-
ter, and we may experience aliasing distortion even though the filter is adequate.
If the Nyquist criteria is met and hence no aliasing distortion is present, we
can reconstruct the original bandwidth-limited, time-continuous signal g ( t ) in
an unambiguous way.
QUANTIZATION
The sampling process described in the previous section is the process of con-
verting a continuous-time signal into a discrete-time signal, while q uantization
converts a signal continuous in amplitude into a signal discrete in amplitude.
Quantization can be thought of as classifying the level of the continuous-
valued signal into certain bands. In most cases, these bands are equally spaced
over a given range and undesired nonlinear band spacing may cause harmonic
distortion.
Every band is assigned a code or numerical value. Once we have decided
to which band the present signal level belongs, the corresponding code can be
used to represent the signal level.
Most systems today use the binary code; i.e., the number of quantization
intervals N are
N (cid:2)2n (2.3)
where n is the word length of the binary code. For example, with n (cid:2) 8 bits
we get a r esolution of N (cid:2) 256 bands, n (cid:2) 12 yields N (cid:2) 4096, and n (cid:2) 16
gives N (cid:2) 65536 bands. Obviously, the more bands we have—i.e., the longer
the word length—the better resolution we obtain. This in turn renders a more
accurate representation of the signal.
www.newnespress.com
0033__HH88997766__CChh0022..iinndddd 99 99//55//22000088 22::4455::4400 PPMM
10 Digital Signal Processing: Instant Access
Insider Info
A nother way of looking at resolution of a quantization process is to define the
dynamic range as the ratio between the strongest and the weakest signal level that
can be represented. The dynamic range is often expressed in decibels. Since every
new bit of word length being added increases the number of bands by a factor
of 2 the corresponding increase in dynamic range is 6 dB.Hence, an 8-bit system
has a dynamic range of 48 dB, a 12-bit system has 72 dB, etc. (This of course only
applies for linear band spacing.)
ENCODING AND MODULATION
A ssuming we have converted our analog signals to numbers in the digital
world, there are many ways to e ncode the digital information into the shape of
electrical signals. This process is called m odulation . The most common method
is probably pulse code modulation (PCM). There are two common ways of
transmitting PCM, and they are p arallel and serial mode. In an example of the
parallel case, the information is encoded as voltage levels on a number of
wires, called a parallel bus. We are using binary signals, which means that only
two voltage levels are used, (cid:4) 5 V corresponding to a binary “ 1 ” (or “ true ” ),
and 0 V meaning a binary “ 0 ” (or “ false ” ). Hence, every wire carrying 0 or
(cid:4) 5 V contributes a binary digit ( “ bit ” ). A parallel bus consisting of eight wires
will therefore carry 8 bits, a byte consisting of bits D0, D1–D7 ( Figure 2.2 ).
T echnology Trade-offs
Parallel buses are able to transfer high information data rates, since an entire
data word (a sampled value) is being transferred at a time. This transmission
can take place between, for instance, an analog-to-digital converter (ADC) and
a digital signal processor (DSP). One drawback with parallel buses is that they
D0 0 (1)
D1 1 (2)
D2 1 (4)
D0 D1 D2 D3 D4 D5 D6 D7
D3 0 (8)
D4 1 (16)
0 1 1 0 1 0 0 1
D5 0 (32)
D6 0 (64)
D7 1 (128)
FIGURE 2.2 Example, a byte (96H) encoded (weights in parenthesis) using PCM in parallel
mode (parallel bus, 8 bits, eight wires) and in serial mode as an 8-bit pulse train (over one wire)
www.newnespress.com
0033__HH88997766__CChh0022..iinndddd 1100 99//55//22000088 22::4455::4411 PPMM