DSP-Lec 02-Sampling and Reconstruction.pdf

MinhNht581331 36 views 33 slides Sep 23, 2024
Slide 1
Slide 1 of 33
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33

About This Presentation

sampling an reconstruction


Slide Content

Lecture 02
SAMPLING AND RECONSTRUCTION

❖Sampling
Content
2
❑Sampling theorem
❖Antialiasingprefilter
❑Spectrum of sampling signals
❖Analog reconstruction
❑Ideal prefilter
❑Practical prefilter
❑Ideal reconstructor
❑Practical reconstructor

Review of useful equations
3
❖Linear system1
sin( )sin( ) [cos( ) cos( )]
2
a b a b a b= − + − − 1
cos( )cos( ) [cos( ) cos( )]
2
a b a b a b= + + − 0 0 0
1
sin(2 ) [ ( ) ( )]
2
FT
f t j f f f f  ⎯→ + − − 0
( ) cos(2 )x t A f t=+ ()xt
Linear system
h(t)
H(f)( ) ( ) ( )y t x t h t= ()Xf ( ) ( ) ( )Y f X f H f=
❖Especially, 0 0 0
1
cos(2 ) [ ( ) ( )]
2
FT
f t f f f f  ⎯→ + + − 0 0 0
( ) | ( )| cos(2 arg( ( )))y t A H f f t H f= + +
❖Fourier transform:
❖Trigonometric formulas: 1
sin( )cos( ) [sin( ) sin( )]
2
a b a b a b= + + −

Fourier transform
4
❖A function can be described by a summation of waves with different
amplitudes and phases. () ()exp2Hf ht iftdt 

−
=− () ()exp2ht Hf iftdf

−
=

Fourier transform
5

Fourier transform
6

❖A typical signal processing system includes 3 stages:
1. Introduction
7
❑The digital processor can be programmed to perform signal processing
operations such as filtering, spectrum estimation. Digital signal processor can be
a general purpose computer, DSP chip or other digital hardware.
❖The analog signal is digitalized by an A/D converter
❖The digitalized samples are processed by a digital signal processor.
❖The resulting output samples are converted back into analog by a
D/A converter.

2. Analog to digital conversion
8
❖Analog to digital (A/D) conversion is a three-step process.
Sampler
Quantizer Coder
t=nT
x
Q(n)
x(t) x(nT)≡x(n) 11010
A/D converter
n
x
Q(n)
000
001
010
011
100
101
110
111
t
x(t)
n
x(n)

3. Sampling
9
❖Sampling is to convert a continuous time signal into a discrete time
signal. The analog signal is periodically measured at every T seconds
❖x(n)≡x(nT)=x(t=nT), n=….-2, -1, 0, 1, 2, 3……..
❖T: sampling interval or sampling period (second);
❖fs=1/T: sampling rate or sampling frequency (samples/second or
Hz)

3. Sampling-example 1
10
❖The analog signal x(t)=2cos(2πt) with t(s) is sampled at the rate f
s=4
Hz. Find the discrete-time signal x(n) ?
Solution:
❖x(n)≡x(nT)=x(n/fs)=2cos(2πn/fs)=2cos(2πn/4)=2cos(πn/2)
n 0 1 2 3 4
x(n) 2 0 -2 0 2
❖Plot the signal

3. Sampling-example 2
11
❖Consider the two analog sinusoidal signals
Solution:1
7
( ) 2cos(2 ),
8
x t t = 2
1
( ) 2cos(2 ); ( )
8
x t t t s=
These signals are sampled at the sampling frequency f
s=1 Hz.
Find the discrete-time signals ? 1 1 1
1 7 1 7
( ) ( ) ( ) 2cos(2 ) 2cos( )
8 1 4
s
x n x nT x n n n
f
 = = = 1
2cos((2 ) ) 2cos( )
44
nn

= − = 2 2 2
1 1 1 1
( ) ( ) ( ) 2cos(2 ) 2cos( )
8 1 4
s
x n x nT x n n n
f
 = = =
❖Observation: x
1(n)=x
2(n) →based on the discrete-time signals, we
cannot tell which of two signals are sampled ? These signals are
called “alias”

3. Sampling-example 2
12
f
2=1/8 Hzf
1=7/8 Hz
f
s=1 Hz
Fig: Illustration of aliasing

at a sampling rate f
s=1/T results in a discrete-
time signal x(n).
3. Sampling-Aliasing of Sinusoids
13
❖In general, the sampling of a continuous-time sinusoidal signal
❖Remarks: We can see that the frequencies f
k=f
0+kf
s are
indistinguishable from the frequency f
0after sampling and hence they
are aliases of f
00
( ) cos(2 )x t A f t=+
❖The sinusoids is sampled at f
s, resulting in a
discrete time signal x
k(n). ( ) cos(2 )
kk
x t A f t=+
❖If f
k=f
0+kf
s, k=0, ±1, ±2, …., then x(n)=x
k(n) .
Proof: (in class)

4. Sampling Theorem-Sinusoids
14
❖Consider the analog signal where Ωis
the frequency (rad/s) of the analog signal, and f=Ω/2π is the
frequency in cycles/s or Hz. The signal is sampled at the three rate
f
s=8f, f
s=4f, and f
s=2f.( ) cos( ) cos(2 )x t A t A ft =  =
❖Note that / sec
/ sec
s
fsamples samples
f cycles cycle
==
❖To sample a single sinusoid properly, we must require2
s
fsamples
f cycle

Fig: Sinusoid sampled at different rates

4. Sampling Theorem
15
❖For accurate representation of a signal x(t) by its time samples x(nT),
two conditions must be met:
1) The signal x(t) must be bandlimitted, i.e., its frequency spectrum must
be limited to f
max.
2) The sampling rate f
smust be chosen at least twice the maximum
frequency f
max.max
2
s
ff
Fig: Typical bandlimitedspectrum
❖f
s=2f
maxis called Nyquistrate;f
s/2 is called Nyquistfrequency;
[-f
s/2, f
s/2] is Nyquistinterval.

4. Sampling Theorem
16
❖The values of f
maxand f
sdepend on the application
Applicationfmax fs
Biomedical 1 KHz 2 KHz
Speech 4 KHz 8 KHz
Audio 20 KHz 40 KHz
Video 4 MHz 8 MHz

4. Sampling Theorem-Spectrum Replication
17
❖Let where( ) ( ) ( ) ( ) ( ) ( )
n
x nT x t x t t nT x t s t

=−
= = − = ( ) ( )
n
s t t nT

=−
=−
❖s(t) is periodic, thus, its Fourier series are given by 2
()
s
j f nt
n
n
s t S e


=−
= 21 1 1
( ) ( )
s
j f nt
n
TT
S t e dt t dt
T T T



= = = 21
()
s
j f nt
n
s t e
T


=−
= 21
( ) ( ) ( ) ( )
s
j nf t
n
x t x t s t x t e
T


=−
==  1
( ) ( )
s
n
X f X f nf
T

=−
=−
where
Thus,
which results in
❖Taking the Fourier transform of yields ()xt
❖Observation: The spectrum of discrete-time signal is a sum of the
original spectrum of analog signal and its periodic replication at the
interval f
s.

4. Sampling Theorem-Spectrum Replication
18
Fig: Typical badlimitedspectrum
❖f
s/2 ≥ f
max
❖f
s/2 < f
max
Fig: Aliasing caused by overlapping spectral replicas
Fig: Spectrum replication caused by sampling

5. Ideal Analog reconstruction
19
Fig: Ideal reconstructoras a lowpassfilter
❖An ideal reconstructoracts as a lowpassfilter with cutoff frequency
equal to the Nyquistfrequency fs/2.( ) ( ) ( ) ( )
a
X f X f H f X f==
❖An ideal reconstructor(lowpassfilter) [ / 2, / 2]
()
0
ss
T f f f
Hf
otherwise
−
=

Then

5. Analog reconstruction-Example 1
20
❖The analog signal x(t)=cos(20πt) is sampled at the sampling
frequency fs=40 Hz.
a) Plot the spectrum of signal x(t) ?
b) Find the discrete time signal x(n) ?
c) Plot the spectrum of signal x(n) ?
d) The signal x(n) is an input of the ideal reconstructor, find the
reconstructed signal x
a(t) ?

5. Analog reconstruction-Example 2
21
❖The analog signal x(t)=cos(100πt) is sampled at the sampling
frequency fs=40 Hz.
a) Plot the spectrum of signal x(t) ?
b) Find the discrete time signal x(n) ?
c) Plot the spectrum of signal x(n) ?
d) The signal x(n) is an input of the ideal reconstructor, find the
reconstructed signal x
a(t) ?

5. Analog reconstruction
22
❖Remarks: x
a(t) contains only the frequency components that lie in the
Nyquistinterval (NI) [-f
s//2, f
s/2].
❖x(t), f
0NI ------------------> x(n) ----------------------> x
a(t), f
a=f
0
sampling at f
s ideal reconstructor
❖x
k(t), f
k=f
0+kf
s------------------> x(n) ----------------------> x
a(t), f
a=f
0
sampling at f
s ideal reconstructormod( )
as
f f f=
❖The frequency f
aof reconstructed signal x
a(t) is obtained by adding
to or substractingfrom f
0(f
k) enough multiples of fsuntil it lies
within the Nyquistinterval [-f
s//2, f
s/2].. That is

5. Analog reconstruction-Example 3
23
❖The analog signal x(t)=10sin(4πt)+6sin(24πt) is sampled at the rate 20
Hz. Find the reconstructed signal x
a(t) ?

5. Analog reconstruction-Example 4
24
❖Let x(t) be the sum of sinusoidal signals
x(t)=4+3cos(πt)+2cos(2πt)+cos(3πt) where t is in milliseconds.
a)Determine the minimum sampling rate that will not cause any
aliasing effects ?
b)To observe aliasing effects, suppose this signal is sampled at half its
Nyquistrate. Determine the signal x
a(t) that would be aliased with
x(t) ? Plot the spectrum of signal x(n) for this sampling rate?

6. Ideal antialiasingprefilter
25
❖The signals in practice may not bandlimitted, thus they must be
filtered by a lowpassfilter
Fig: Ideal antialiasingprefilter

6. Practical antialiasingprefilter
26
Fig: Practical antialiasinglowpassprefilter
❖The Nyquistfrequency fs/2 is in the middle of transition region.
❖A lowpassfilter: [-f
pass, f
pass] is the frequency range of interest for the
application (f
max=f
pass)
❖The stopbandfrequency f
stopand the minimum stopbandattenuation
A
stopdB must be chosen appropriately to minimize the aliasing
effects.s pass stop
f f f=+

6. Practical antialiasingprefilter
27
❖The attenuation of the filter in decibels is defined as10
0
()
( ) 20log ( )
()
Hf
A f dB
Hf
=−
where f
0is a convenient reference frequency, typically taken to be at
DC for a lowpassfilter.
❖α
10=A(10f)-A(f) (dB/decade): the increase in attenuation when f is
changed by a factor of ten.
❖α
2=A(2f)-A(f) (dB/octave): the increase in attenuation when f is
changed by a factor of two.
❖Analog filter with order N, |H(f)|~1/f
N
for large f, thus α
10=20N
(dB/decade) and α
10=6N (dB/octave)

6. Antialiasingprefilter-Example
28
❖A sound wave has the form
where t is in milliseconds. What is the frequency content of this
signal ? Which parts of it are audible and why ?( ) 2 cos(10 ) 2 cos(30 ) 2 cos(50 )
2 cos(60 ) 2 cos(90 ) 2 cos(125 )
x t A t B t C t
D t E t F t
  
  
= + +
+ + +
This signal is prefilterby an anlogprefilterH(f). Then, the output y(t)
of the prefilteris sampled at a rate of 40KHz and immediately
reconstructed by an ideal analog reconstructor, resulting into the final
analog output ya(t), as shown below:

6. Antialiasingprefilter-Example
29
Determine the output signal 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 prefilterwith cutoff fs/2=20 KHz.
c)When H(f) is a practical prefilterwith specifications as shown
below:
The filter’s phase response is assumed to be ignored in this example.

7. Ideal and practical analog reconstructors
30
❖An ideal reconstructoris an ideal lowpassfilter with cutoff Nyquist
frequency fs/2.

7. Ideal and practical analog reconstructors
31
❖The ideal recontructorhas the impulse response:
which is not realizable since its impulse response is not casual sin( f t)
()
s
s
ht
ft


=
❖It is practical to use a
staircase reconstructor

7. Ideal and practical analog reconstructors
32
Fig: Frequency response of staircase recontructor

7. Practical reconstructors-antiimagepostfilter
33
❖An analog lowpasspostfilterwhose cutoff is Nyquistfrequency fs/2
is used to remove the surviving spectral replicas.
Fig: Spectrum after postfilter
Fig: Analog anti-image postfilter
Tags