DIGITAL SIGNAL PROCESSING
Chapter 2:
Analog Signal Processing
Sampling and Reconstruction
Reference:
S J.Orfanidis, ”Introduction to Signal Processing”, Prentice –Hall , 1996,ISBN 0-13-209172-0
M. D. Lutovac, D. V. Tošić, B. L. Evans, “Filter Design for Signal Processing Using MATLAB
and Mathematica”, Prentice Hall, 2001
Lectured by Prof. Dr. Thuong Le-Tien
National Distinguished Lecturer
Tel: 08-38654184; 0903 787 989
Email: [email protected],
[email protected]
Dated on January 2024
Sampling and Reconstruction
• 1. Introduction
• 2. Overview of Analog
• 3. Sampling theorem
• 4. Sampling of Sinusoids
• 5. Spectra of Sampled Signals
• 6. Analog signal reconstruction
2
1. Introduction
Three steps for digital signal processing of
analog signals
Step 1: Digitizing of analog signals:
Sampling, Quantization – Analog to Digital
Conversion (ADC).
Step 2: Implementing digital signal
processor for discrete samples
Step 3: Reconstructing the analog signal
after processing – Digital to Analog
Conversion (DAC)
3
2. Review of Analog signals
FOURIER Transform X() of x(t) is the spectrum of the
analog signal:
X () x(t )e jt dt
(2.1)
Where is the radian frequency (rad/s).
and = 2f (2.2)
Definition of Laplace Transform:
(2-3)
X (s) x(t ).e dt st
4
Response of a linear system
x(t) Linear system y(t)
input h(t) output
The system is characterized by impulse response h(t). The
output y(t) is obtained by the time domain convolution :
y(t ) h(t t ' ) x(t ' )dt'
Or frequency domain:
Y () H (). X ()
where H() is the frequency response of the system.
5
H() is the Fourier transform of h(t)
H ( ) h( t )e jt dt
The steady state response of a sinusoid:
x(t) = exp(jt) Linear system y(t) = H()exp(jt)
H()
Sinusoid in Sinusoid out
Output is a sinusoid with frequency (),
amplitude equal to the signal amplitude multiplied
by MagH(), and phase shift equal to arg(H()):
x(t ) e jt y(t ) H ()e jt | H () | .e jt j arg H ( )
6
Linear superposition: Signals x(t) has two frequency
components
j1t j 2 t
x(t ) A1e A2 e
After filtering
j1t j 2 t
y(t ) A1 H ()e A2 H ()e
Note: Filtering only change the magnitudes but not
the frequencies
7
The result is presented in frequency domain
X( ) Y( )
A1 A2
H( ) A 1 H( )
A 2 H( )
Spectrum of X()
X () 2A1 ( 1 ) 2A2 ( 2 )
Spectrum of Y()
Y () H () X () H ()(2A1 ( 1 ) 2A2 ( 2 ))
2A1H (1 ) ( 1 ) 2A2 H ( 2 ) ( 2 )
8
3. Concept of Sampling theorem
Sampling process in Fig. 3.1. x(t) is sampled
by period T, t=nT where n=0,1,2,…
Many high frequency components appear
in the signal spectrum
Two questions are often provided for
1. What is the effect of sampling on the
original frequency spectrum?
2. How should one choose the sampling
interval T?
9
The spectrum of the sampled sinusoid x(nT)
will be periodic replication of the original
spectral line at intervals fs=1/T
Figure 3.1 Ideal Sampler
10
Figure 3.2. Spectrum replication caused by sampling.
With the replicated spectrum of the sampled signal, one
cannot tell uniquely What the original frequency was. It
could be any one of the replicated frequencies namely
f’=f+mfs. This potential confusion of the original frequency
with another is known as aliasing and can be avoided if one
satisfies the condition of the sampling theorem
11
Sampling theorem
For accurate representation of a signal x(t) by its
time samples x(nT), two conditions must be met:
1: x(t) is bandlimited
2: Sampling frequency must be chosen to be
at least twice the maximum frequency fmax,
fs 2fmax:
fs = 2fmax is the Nyquist rate.
fs/2 is the Nyquist frequency or folding
frequency
12
Typical sampling rate for some common applications
(An Approximation)
Antialiasing Prefilter
Signal must be bandlimited therefore need to pass
through a low pass filter namely prefilter before sampling
Input spectrum
Prefiltered spectrum
prefilter
f f
0 -fs/2 fs/2
Replicated
spectrum
f
-fs 0 fs
Bandlimited
x(t) signal x(nT)
Analog lowpass Sampler and
To DSP
Analog filter x(t) quantizer digital
signal signal
Antialiasing prefilter
14
What happens if we do not sample in
accordance with the sampling theorem?
Missing important time variations between sampling instants
May arrive at the erroneous conclusion that the samples
represent a signal which is smoother than it actually is
Be confusing the true frequency content of the signal with a
lower frequency content. Such confusion of signals is called
aliasing
Aliasing in
The time domain
4. Sampling of sinusoid: x(t) = cos(2ft)
The number of samples per is given by the quantity fs/f:
f s samples / sec samples
f cycles / sec cycle
Special case with multiple frequency components in the x(t)
16
Analog reconstruction and aliasing
Define also the following family of sinusoids, for m in integer
And its sampled version
Using the property fsT=1 and the trigonometric identity
x m (nT ) e 2j ( f mfs )Tn e 2jfTn e 2jmfsTn e 2jfTn x(nT )
f , f f s , f 2 f s ,..., f mf s ,...
Note that xm(t) are different from each other
but they have same samples:
17
LPF as an ideal
reconstructor
18
Example
As sinusoid f=10 Hz, sampled by fs=12Hz. The sampled
signal consists of periodic frequencies 10+m.12Hz, m = 0,
1, 2,… or: …, -26, -14, -2, 10, 22, 34, 46, … but only fa
= 10 mod(12) = 10 – 12 = -2 Hz in the range of Nyquist
interval [-6,6] Hz. So the reconstructed signal with –2 Hz
is not as the original one with 10 Hz.
19
Example: 5 signals are sampled by the rate 4Hz:
sin(14t ), sin(6t ), sin(2t), sin(10t), sin(18t) (t second)
Let prove they are aliased each other due to their same
samples.
Sol: The frequencies of the signals: -7, -3, 1, 5, 9 Hz. They
have the same periodic replication in multiples of fs=4Hz.
Writing the five frequencies compactly:
fm=1+4m, m=-2, -1, 0, 1, 2.
xm (t ) sin(2f mt ) sin( 2 (1 4m)t ), m -2,-1,0,1,2
x m ( nT ) sin(2 (1 4m )nT ) sin(2 (1 4m )n / 4)
sin(2n / 4 2mn) sin(2n / 4)
20
Example: x(t)=4+3cos(t)+2cos(2t)+cos(3t) t: in ms
Determine the min sampling rate without any aliasing effects
Supposed the signal sampled at half its Nyquist rate.
Determine xa(t) that would be aliased with x(t).
Sol:
Freq. of 4 terms: f1=0, f2=0.5kHz, f3=1kHz,f4=1.5kHz
Example: The square wave sampled at rate fs; t in seconds
Determine the xa(t) that will appear at the output of the
reconstructor for 2 cases fs=4Hz and 8Hz.
Sol:
Fourier series of square wave contains odd harmonics at freq.
For fs =4kHz, the aliased signal will be
For fs =8kHz, the aliased signal will be
•The first case: Sketch for xa(t)
Condition xa(t)=x(nT) evalued at n=1 implies A=1
•The second case: xa(t)=Bsin(n/4)+Csin(3n/4)
Condition xa(t)=x(nT) at n=1,2 give two equations
Example: A given x(t), t in ms and a block of DSP
Determine the y(t) and ya(t) in the following cases:
a. When there is no prefilter, that is, H(f)=1 for all f
b. When H(f) is the ideal filter with cutoff fs/2=20kHz
c. When H(f) is a practical prefilter as follows,
Sol: Six terms of freq. in x(t)
Case a.
Case b.
Case c.
5. Spectra of sampled signals
Sampled signal: xˆ ( t ) x(nT ) (t nT )
n
In practical sampling, the sampled signal:
x flat ( t ) x(nT ) p(t nT )
n
where, p(t) is flat-top pulse of duration second.
Ideal sampling with toward 0.
x ( nT ) ( t nT )
xˆ ( t ) xflat (t) x ( nT ) p( t nT )
0 T 2T …. nT t
0 T 2T …. nT t
30
Discrete Time Fourier Transform DTFT
or
This approximation become exact if
Practical approximation
Spectrum Replication
32
Aliasing caused by overlapping spectral replicas
Ideal antialiasing prefilter
Practical antialiasing prefilter
Attenuation in dB
6. Analog signal reconstruction
Staircase reconstructor
Analog reconstructor as a low pass filter
35
Reconstructed analog signal
yˆ (t ) y(nT ) (t nT )
n
y a (t ) y(nT )h(t nT )
n
y a (t ) y(nT )h(t nT )
n
Y a ( f ) H ( f )Yˆ ( f )
Replicated spectrum
1
Yˆ ( f ) Y ( f mfs )
T m
36
Ideal reconstructor
Staircase reconstructor
Anti-image postfilter
Digital equalization filter for D/A conversion