DIGITAL SIGNAL PROCESSING
Sampling and Reconstruction
Lectured by Assoc. Prof. Thuong Le-Tien
Sampling and Reconstruction
1.1. Introduction 1.2. Overview of Analog 1.3. Sampling theorem 1.4. Sampling of Sinusoids 1.5. Spectra of Sampled 1.6. Analog signal reconstruction
1. Introduction
Three steps for digital signal processing of analog 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 signal: (2.1)
X( )
Where
x(t )e
j t
dt
is the radian frequency (rad/s). and = 2 f
(2.2)
Definition of Laplace Transform:
X (s)
x(t ).e dt
st
(2-3)
4
Response of a linear system x(t) Linear system input h(t)
y(t) output
The system is characterized by impulse response h(t). The output y(t) is obtained by the time domain convolution :
y (t )
Or frequency domain:
h(t t ' ) x(t ' )dt '
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 j t dt The steady state response of a sinusoid:
x(t) = exp(j t) Sinusoid in Linear system H( )
(2.5)
y(t) = H( )exp(j t) 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 ) ej
t
y( t )
H ( )e j
| H ( ) | .e j
t j arg H ( )
6
Linear superposition
x( t )
After filtering
A1 e
1t
A2 e
1t
2t
y( t )
A1 H ( )e
A2 H ( )e
2t
Note: Filtering only change the magnitudes but not the frequencies
7
The result is presented in frequency domain
X( ) A1 A2 H( ) Y( ) A 1 H( )
A 2 H( )
Spectrum of X( )
X( ) 2 A1 (
1
) 2 A2 (
Spectrum of Y( )
Y( ) H( )X ( )
1
H ( )(2 A1 (
1
) 2 A2 (
2
))
2 A1H (
) (
) 2 A2 H (
) (
)
8
3. Sampling theorem
Sampling process in Fig H1.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
Ideal sampler Analog signal x(t) x(nT) sampled signal
x(t)
x(nT)
t 0 T nT
Figure 3.1 Ideal Sampler
10
Frequency
f-4f
f-3f
f-2f
f- f s
f+f s f+2f
f+3f
f+4f
Figure 1.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
3.1. 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
3.2.. Antialiasing Prefilter Signal must be bandlimited therefore need to pass through a low pass filter namely prefilter before sampling
Input spectrum prefilter 0 f -fs/2 fs/2 Replicated spectrum f -fs 0 Bandlimited signal x(t) fs f Prefiltered spectrum
x(t) Analog signal
Analog lowpass filter
Sampler and quantizer
x(nT) digital signal
To DSP
Figure3.5 antialiasing prefilter.
Figure 3.5 antialiasing prefilter.
13
1.4. Sampling of sinusoid
The number of samples per is given by the quantity fs/f:
fs f samples / sec cycles / sec samples cycle
1.4.1. Reconstruction and aliasing Note that xm(t) are different but they have same samples:
xm (nT ) e 2 j ( f
f, f
mf s )Tn
e 2 jfTne 2 jmf sTn
2 f s ,..., f
e 2 jfTn
x(nT )
fs , f
mf s ,...
14
Ideal sampler T x(t) Analog signal Rate fs x(nT)
Ideal reconstructor xa (t) Analog signal -fs/2 fs/2
Lowpass filter Cutoff =fs/ /2
Figure 4.2. LPF as ideal reconstructor
Hnh 1.4.2 Bo loc thong thap lam bo khoi phuc tn hieu ly tng
15
fa=f mod (fs)
ftrue =f
fs/2
-fs -fs/2 0 fs/2 fs
2fs f
-fs/2
Figure 4.3. fHnh 1.4.3 soversus (fs) theo f. mod(f ) th f mod f
16
Example 4.1: As sinusoid f=10 Hz, sample 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 [-6,6] Hz. So the reconstructed signal with 2 Hz is not as the original one with 10 Hz.
17
Example 4.2: 5 signals are sampled by the rate 4Hz:
sin(14 t ), sin(6 t ), sin(2 t), sin(10 t), sin(18 t)
(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(2 f mt ) sin(2 (1 4n)), m -2,-1,0,1, 2
18
x m ( nT )
sin(2 (1 4m )nT ) sin(2 n / 4 2 mn)
sin(2 (1 4m )n / 4) sin(2 n / 4)
19
5. Spectra of sampled signals
Sampled signal: x( t )
n
x ( nT ) ( t
nT )
(5.1)
In practical sampling, the sampled signal:
x flat ( t )
x ( nT ) p( t
nT )
(5.2) second. Ideal
where, p(t) is flat-top pulse of duration sampling with toward 0.
20
x(t )
x( nT ) ( t nT )
xflat (t)
x( nT ) p( t nT )
2T .
nT
2T .
nT
Figure 5.1. Ideal and practical sampling
21
X( f )
x( t )e
2 jft
dt
X( f )
n
x ( nT ) ( t x(nT)
n -
nT )e
2 jft
dt
(t - nT)e
- 2 jft
dt hay
22
5. Spectrum of sampled signal
X(f )
x(t )e
2 jft
dt
n
x(nT )e
2 jfnT
or: T toward 0:
X(f )
TX ( f )
X ( f ) lim TX ( f )
T 0
23
Practical antialiasing filter:
Ideal Prefilter
Analog signal
Ideal sampler
Sampled signal
ideal antialiasing prefilter.
24
Practical antialiasing filter:
|H(f)|
Idealcfilter ng bo lo ly t
Transientvung region
chuyen tiep Astop
-fstop bang chan bandstop
fs/2 -fpass
0 bang thong bandpass
fpass
fs/2
fstop
bang chan bandstop
Ideal antialiasing prefilter
25
6. Analog signal reconstruction
y ( t )
y (t)
D/A
y a (t)
y a ( t)
Sampling signal
Reconstructed signal
Figure 6.1 staircase reconstructor
y(t) Sampling signal reconstructor h(t) ya(t) reconstructed signal
Figure 6.2. Analog reconstructor as a low pass filter
26
Reconstructed analog signal
y (t )
n
y (nT ) (t
y ( nT )h(t
n
nT )
nT )
y a (t )
y a (t )
n
y (nT )h(t
H ( f )Y ( f )
nT )
Ya ( f )
Replicated spectrum
Y( f ) 1 Y( f Tm mf s )
27