DSP Intro
DSP Intro
Prof. E. K. Akowuah
[email protected]
5/16/23 Digital Signal Processing 1
Overview
• Introduction to DSP Systems
• IIR Filters
• FIR Filters
• DSP
– mathematics, algorithms, and the techniques used to
manipulate digital signals
• Signals
– seismic vibrations, visual images, sound waves, etc.
• Our goal
– enhancement of visual images, speech recognition
and generation, data compression for storage and
transmission, etc.
DSP Telephone
-Voice and data compression
-Echo reduction
-Signal multiplexing
-Filtering
-Radar
Military -Sonar
-Ordnance guidance
-Secure communication
FIGURE 1-1
5/16/23 Digital
DSP has revolutionized Signal
many areas Processing
in science and engineering. A 5
few of these diverse applications are shown here.
disciplines are not sharp and well defined, but rather fuzzy and over
If you want to specialize in DSP, these are the allied areas you w
DSP and Engineering
need to study.
Communication
Theory
Digital Numerical
Signal Analysis
Processing Probability
and Statistics
Analog
Signal
Processing
Analog Digital Decision
Electronics Electronics Theory
• Bandwidth restrictions.
• Speed limitations
• Finite word length problems.
The analogue anti-imaging filters removes signal images and unwanted high
frequency components
The DAC (Digital to Analogue Converter) converts the digital signal back into
analogue form
xa ( t ) x* ( t ) xq (t ) x ( nT ) = x [ n ]
Quantiser
(Analog to Coding
Sample Digital
and Conversion)
Hold
• The (band-limited) signal is first sampled (usually with a sample and hold
circuit) to produce a discrete-time, continuous amplitude signal
• The discrete amplitude levels are encoded into discrete binary words, each
of length B bits.
dT ( t )
¥
x ( t ) = xa ( t ) d T ( t ) = xa ( t ) å d ( t - nT )
n =-¥
xa ( t ) Impulse xa ( t ) d T ( t )
Modulator
¥
= å d(t - nT )
n = -¥
¥ 2p
dT (t ) = å Cn e jnw s t ws = sampling frequency = radians per second
n = -¥
T
1T
Cn = ò dT (t ) e - jnw s t dt
T0
For the periodic delta pulse stream it can be shown that for all n
¥
1 1
Cn =
T
and hence d T ( )
t =
T
åe
n =-¥
jnws t
1 ¥
xs ( t ) = xa ( t ) d T ( t ) = å xa ( t ) e jnwst (2)
T n =-¥
¥
X ( jw ) = ò x (t ) e
- jw t
dt (3)
-¥
The Fourier Transform X s ( jw ) of a sampled signal xs ( t ) is, from (2) and (3)
¥ ¥
æ1 ¥ ö 1 æ ¥ ö - j w - n ws ) t
X s ( jw ) = ò ç å xa ( t ) e jn ws t ÷ e - jw t dt = ò ç å xa ( t ) ÷ e ( dt
-¥ è
T n =-¥ ø T -¥ è n =-¥ ø
¥
1 ¥
= å xa ( t ) e
- j (w - n ws ) t
T n =-¥ ò
-¥
dt (4)
1 ¥
X s ( jw ) = å X a ( j (w - n ws ) ) (5)
T n =-¥
-wB 0 wB w
X a( j w )
• If the sampling frequency is not sufficiently high the image frequencies will
fold over or alias into the base band frequencies.
• In this case the information of the desired signal is indistinguishable from its
image in the fold-over region.
• The overlap or aliasing occurs about a point that is half the sampling frequency.
This point is called the folding frequency or Nyquist frequency.
• The ideal anti-aliasing filter should remove all frequency components above
the Nyquist frequency (also called the foldover frequency).
• In practice aliasing is always present because of system noise and the existence of
signal energy outside the band of interest.
• For many practical filters the effective Nyquist frequency is taken as fs (the
stopband edge of the frequency response).
• the AAF will be designed to attenuate the frequencies above the Nyquist
frequency to a level not detectable by the ADC.
Amin = 20log ( )
1.5 ´ 2 B +1 .
n Amin(dB)
8 56
10 68
12 80
16 104
• A general rule is that the steeper the cut-off of an analogue filter, the greater
the phase distortion.
- Sample
and
Analogue
+ Hold Sampled
Signal
Input Signal
Fs
The desired aliasing level is < 0.7071´ 2 100 = 0.01414 f < 141.4kHz
a
X(f)
1
Hence 0.01414 < 1
é æ fa ö ù 2 2
ê1 + ç ÷ ú
êë è 2 ø úû
f (kHz)
X ¢( f )
where fa is the aliasing frequency.
1
Fs (min ) = f c + f a = 2kHz + 141.4kHz = 143.4kHz Xb
Xa
-Fs 0 2 fa Fs f (kHz)
Assuming that the band of interest for the above DSP system extends from 0 to
4 kHz and that a 12-bit ADC is used, estimate the:
The AAF should attenuate the levels of frequencies in the stopband to less than
the root mean square (rms) quantisation noise level for the ADC, so that they are
not detectable by the ADC.
12
æ a2 ö a
Assuming the RMS quantisation noise level is çç ÷÷ =
è 12 ø 2 3
V fs V fs
where the quantisation level a is given by a = »
2B -1 2B
æ a 2B ö
ç ÷
Max passband level è 2 ø
and a full-scale input, then Amin = = = 1.5 ´ 2 B +1
stopband signal level æ a ö
ç ÷
è2 3ø
Choosing (this time) the folding frequency Fs/2 as the effective stopband
frequency, then, for a 3rd order Butterworth filter
X ( f ) dB
6 12
é æ f ö ù
Amin = 20log ê1 + çç ÷÷ ú
êë è f c ø úû
X ¢ ( f ) dB
Giving f = Fs/2 > 96.7 kHz
0
-3
Thus Fs = 193.4 kHz (say 194 kHz).
-83
-Fs - Fs 2 0 4 Fs 2 Fs f (kHz)
1
12
= 9.33 ´ 10-6
ìï é (194 - 4 ) ù 6 üï
í1 + ê ú ý
ïî ë 4 û ïþ
100
( 9.33 ´10 ) ´ 0.7071
-6
= 0.0013 %
• Assume that the system is designed to ensure that the input voltage can
only change by a maximum of 1/2 LSB between samples.
• Then for a sine wave it can be shown that the maximum frequency that can
be digitised to 1/2 LSB accuracy for a system using B-bit accuracy is given
by:
1
f max = B +1
where t is the aperture time
p2 t
Proof Assume that t is the aperture time and Dv is the change in v(t) during t
Vfs
v (t) = sin w t
2
The point of greatest change is at t =
0 and the ADC must be able to
Vfs
measure the signal with the desired
2
accuracy at this point or
dv(t ) æ V fs ö Dv
t =0 = çç ÷÷wcos(wt ) = pfV fs = (Vs -1 ) 0
dt è 2 ø t DV t (s)
t
-Vfs
2
Dv
Substituting for Vfs and Dv in the equation gives p f V fs =
t
1
and simplifying gives f max =
p2 B +1 t
f max = 1.1 Hz
If the above ADC was preceded by a sample and hold amplifier with an
aperture of 25ns and an acquisition time of 2ms, then the maximum
frequency that can be converted becomes:
1
2 f max £ Fs = ´ 10 -6 kHz
(35 + 2 + 0.025) = 13.5 kHz
20
12
mV = 4.9 mV
2
V fs V fs
q= »
(2 B
)
-1 2B
where Vfs is the full scale range of the ADC with bipolar inputs
q
The maximum quantisation error is ±
2
For a sine wave of amplitude A (with 2A=Vfs) the quantisation step size is
2A
q=
2B
If it is assumed that for such a signal the quantisation error e for each
sample is random and uniformly distributed in the interval ± q 2 with zero mean
then the quantisation noise power (or variance) is given by
q 2 q 2
1 q2
s e2 = ò e P(e )de = ò e de =
2 2
-q 2 q -q 2 12
q
or the RMS noise power is RMS =
12
For this system the signal to quantisation noise power (SQNR) in decibels is
æ A2 2 ö æ 3 ´ 22 B ö
SQNR = 10logçç 2 ÷÷ = 10logçç ÷÷ = 6.02B + 1.76 dB
è q 12 ø è 2 ø
D = 20log10 2 B
1 1
t= B +1
= 13 3
s = 1.94 ns
2 pf max 2 ´ p ´ 20 ´ 10
The small aperture time calls for the need for a sample and hold ahead of the ADC.
y [nT]
nT
y (t )
DAC
y (t )
T t
y (t)
LPF
y (t)
• The DAC shown is a zero-order hold. The signal output is held for a time T (the
sampling period).
wT
• In the frequency domain this results in sinx/x distortion where x =
2
• The output is wideband – original signal plus images at multiples of the sampling
frequency
• The amplitude of the output is multiplied by the sinx/x function which acts like a low
pass filter (LPF).
nT 0 ws 2ws w
Output
y (t ) Y (w )
sin x
x
T t 0 ws 2ws w
ì1 for 0 £ t £ T
h(t ) = í
î0 otherwise
d(t) h(t)
zero-order hold
1 1
linear filter
0 t 0 T t
The corresponding frequency response of the zero-order hold linear filter (the
D/A converter) is obtained by taking the Fourier transform of the unit-impulse
response. That is
¥
H ( jw ) = ò h(t ) e - jw t dt
T
= ò 1 ´ e - jw t d t
-¥ 0
T
ée ù-jw t -1 - jwT
=ê = éëe - 1ùû
ú jw
ë - j w û0
- jwT - jwT
- jwT jwT é jw2T - jwT
ù
ée 2 ù 2e 2
ê e - e 2
ú
= êe
2
-e 2
ú =
jw ë û w ê 2j ú
êë úû
5/16/23 Digital Signal Processing 49
The “zero-hold” DAC
æ wT ö
sin ç ÷ j wT
è 2 ø -
= ´T e 2
wT
2
sin x -
j wT
wT
= ´T e 2
where x=
x 2
Compute the attenuation at 20 KHz for a digital audio system due to the
sin x x effect introduced by the D/A converter, if the sampling frequency is
(
H ( jw ) = H j 4p ´ 10 4
) =
( )
sin 4p ´ 10 4 ´ 22.68 ´ 10 -6 2
T = 0.694T
4p ´ 10 4 ´ 22.68 ´ 10 -6 2
(
H ( jw ) = H j 4p ´ 10 4
) =
(
sin 4p ´ 10 4 ´ 5.669 ´ 10 -6 2)T = 0.979T
4p ´ 10 ´ 5.669 ´ 10 2
4 -6
0 20 156.4 176.4
The analogue signal has a baseband that extends from dc to 20 kHz and the
DAC is updated at a rate of 176.4 kHz.
Determine the minimum values for the order and cut-off frequency for the anti-
image filter, assuming that it is a Butterworth characteristic
sin x æ wT ö
@ 20 kHz = 0.9789 ç with x = ÷ = -0.184dB
x è 2 ø
sin x
@156.4 kHz = 0.125 = -18 dB
x
Thus in the passband the filter should not have more than 0.5-0.184
= 0.316 dB deviation
20 log é1 + (156.4 f c ) ù 1 2 £ 32 dB
2n
ë û