Sampling of Continuous Time Signalsyao/EE3054/Ch12.3...H (f ) Sampling x(t) x’(t) xd(n) Sampling...
Transcript of Sampling of Continuous Time Signalsyao/EE3054/Ch12.3...H (f ) Sampling x(t) x’(t) xd(n) Sampling...
EE3054
Signals and Systems
Sampling of Continuous Time Signals
Yao Wang
Polytechnic University
Some slides included are extracted from lecture presentations prepared by McClellan and Schafer
4/17/2008 © 2003, JH McClellan & RW Schafer 2
License Info for SPFirst Slides
� This work released under a Creative Commons Licensewith the following terms:
� Attribution� The licensor permits others to copy, distribute, display, and perform
the work. In return, licensees must give the original authors credit.
� Non-Commercial� The licensor permits others to copy, distribute, display, and perform
the work. In return, licensees may not use the work for commercial purposes—unless they get the licensor's permission.
� Share Alike� The licensor permits others to distribute derivative works only under
a license identical to the one that governs the licensor's work.
� Full Text of the License
� This (hidden) page should be kept with the presentation
LECTURE OBJECTIVES
� Concept of sampling
� Sampling using periodic impulse train
� Frequency domain analysis
� Spectrum of sampled signal
� Nyquist sampling theorem
� Sampling of sinusoids
Two Processes in A/D
Conversion
� Sampling: take samples at time nT
� T: sampling period;
� fs = 1/T: sampling frequency
� Quantization: map amplitude values into a set of discrete values
� Q: quantization interval or stepsize
xc(t) x[n] = xc(nT) $[ ]x n
Quanti-
zation
Sampling
Sampling
Period
T
Quantization
Interval
Q
∞<<−∞= nnTxnx ),(][
pQ±
)]([][ˆ nTxQnx =
0 0.2 0.4 0.6 0.8 1
-1
-0.5
0
0.5
1
T=0.1Q=0.25
Analog to Digital
Conversion
A2D_plot.m
How to determine T and Q?
� T (or fs) depends on the signal frequency range� A fast varying signal should be sampled more frequently!
� Theoretically governed by the Nyquist sampling theorem
� fs > 2 fm (fm is the maximum signal frequency)
� For speech: fs >= 8 KHz; For music: fs >= 44 KHz;
� Q depends on the dynamic range of the signal amplitude and perceptual sensitivity� Q and the signal range D determine bits/sample R
� 2R=D/Q
� For speech: R = 8 bits; For music: R =16 bits;
� One can trade off T (or fs) and Q (or R)� lower R -> higher fs; higher R -> lower fs
� We only consider sampling in this class
SAMPLING x(t)
� SAMPLING PROCESS� Convert x(t) to numbers x[n]
� “n” is an integer; x[n] is a sequence of values
� Think of “n” as the storage address in memory
� UNIFORM SAMPLING at t = nTs
� IDEAL: x[n] = x(nTs)
C-to-Dx(t) x[n]
Sampling of Sinusoid
SignalsSampling above
Nyquist rate
ωs=3ωm>ωs0
Reconstructed
=original
Sampling under
Nyquist rate
ωs=1.5ωm<ωs0
Reconstructed
\= original
Aliasing: The reconstructed sinusoid has a lower frequency than the original!
Nyquist Sampling Theorem
� Theorem:� If x(t) is bandlimited, with maximum frequency fb(or
ωb =2π fb)
� and if fs =1/ Ts > 2 fb or ωs =2π / Ts >2 ωb
� Then xc(t) can be reconstructed perfectly from x[n]= x(nTs ) by using an ideal low-pass filter, with cut-off frequency at fs/2
� fs0 = 2 fb is called the Nyquist Sampling Rate
� Physical interpretation:� Must have at least two samples within each cycle!
4/17/2008 © 2003, JH McClellan & RW Schafer 10
Sampling Using Periodic Impulse
Train
x[n] = x(nTs )
FOURIER
TRANSFORM
of xs(t) ???
4/17/2008 © 2003, JH McClellan & RW Schafer 11
Periodic Impulse Train
∑∞
−∞=
−=
n
snTttp )()( δ
4/17/2008 © 2003, JH McClellan & RW Schafer 12
Impulse Train Sampling
xs (t) = x(t) δ (t − nTs )n=−∞
∞
∑ = x(t)δ (t − nTs )n=−∞
∞
∑
xs(t) = x(nTs)δ(t −nTs)n=−∞
∞
∑
4/17/2008 © 2003, JH McClellan & RW Schafer 13
Illustration of Samplingx(t)
x[n] = x(nTs )
∑∞
−∞=
−=n
sss nTtnTxtx )()()( δ
n
t
4/17/2008 © 2003, JH McClellan & RW Schafer 14
Sampling: Freq. Domain
EXPECT
FREQUENCY
SHIFTING !!!
∑∑∞
−∞=
∞
−∞=
=−=k
tjkk
n
sseanTttp
ωδ )()(
∑∞
−∞=
=k
tjkk
seaω
How is the
spectrum of xs(t)
related to that of
x(t)?
4/17/2008 © 2003, JH McClellan & RW Schafer 15
Fourier Series Representation
of Periodic Impulse Train
ωs =2π
Ts∑∑∞
−∞=
∞
−∞=
=−=k
tjkk
n
sseanTttp
ωδ )()(
s
T
T
tjk
s
kT
dtetT
as
s
s1
)(1
2/
2/
== ∫−
− ωδFourier Series
4/17/2008 © 2003, JH McClellan & RW Schafer 16
FT of Impulse Train
∑∑ ∑∞
−∞=
∞
−∞=
−=↔=−=
k
s
sn k
tjk
s
s kT
jPeT
nTttp s )(2
)(1
)()( ωωδπ
ωδ ω
s
sT
πω
2=
Frequency-Domain Analysis:
Using Fourier Series
∑ ∑∞
−∞=
=−=
n k
tjk
s
sse
TnTttp
ωδ1
)()(
)()()( tptxtxs =
xs (t) = x(t)1
Tsk=−∞
∞
∑ ejkωst =
1
Tsx(t)
k=−∞
∞
∑ ejkωst
Xs ( jω) =1
TsX( j(ω
k=−∞
∞
∑ − kωs ))
ωs =2π
Ts
Frequency-Domain Analysis:
Using Multiplication-
Convolution duality
∑∑ ∑∞
−∞=
∞
−∞=
−=↔=−=
k
s
sn k
tjk
s
s kT
jPeT
nTttp s )(2
)(1
)()( ωωδπ
ωδ ω
x(t)p(t) ⇔1
2πX( jω )∗ P( jω)
( )( )∑
∑∞
−∞=
∞
−∞=
−=
−==
k
s
s
k
s
s
s
kjXT
kjXT
jPjXjX
ωω
ωωδωπ
πωω
πω
1
)(*)(2
2
1)(*)(
2
1)(
4/17/2008 © 2003, JH McClellan & RW Schafer 19
Frequency-Domain
Representation of Sampling
Xs ( jω) =1
TsX( j(ω
k=−∞
∞
∑ − kωs ))
“Typical”
bandlimited signal
4/17/2008 © 2003, JH McClellan & RW Schafer 20
Aliasing Distortion
� If ωs < 2ωb , the copies of X(jω) overlap, and we have aliasing distortion.
“Typical”
bandlimited signal
Original signal
Sampling
impulse train
Sampled signal
ωs>2 ωm
Sampled signal
ωs<2 ωm
(Aliasing effect)
Frequency Domain
Interpretation of Sampling
The spectrum of the
sampled signal includes
the original spectrum and
its aliases (copies) shifted
to k fs , k=+/- 1,2,3,…
The reconstructed signal
from samples has the
frequency components
upto fs /2.
When fs< 2fm , aliasing
occur.
4/17/2008 © 2003, JH McClellan & RW Schafer 22
Reconstruction: Frequency-Domain
)()()(
so overlap,not do )(
of copies the,2 If
ωωω
ω
ωω
jXjHjX
jX
srr
bs
=
>
Hr ( jω )
Nyquist Sampling Theorem
� Theorem:� If x(t) is bandlimited, with maximum frequency fb(or
ωb =2π fb)
� and if fs =1/ Ts > 2 fb or ωs =2π / Ts >2 ωb
� Then xc(t) can be reconstructed perfectly from x[n]= x(nTs ) by using an ideal low-pass filter, with cut-off frequency at fs/2
� fs0 = 2 fb is called the Nyquist Sampling Rate
� Physical interpretation:� Must have at least two samples within each cycle!
Sampling of Sinusoid
Signals: Temporal domainSampling above
Nyquist rate
ωs=3ωm>ωs0
Reconstructed
=original
Sampling under
Nyquist rate
ωs=1.5ωm<ωs0
Reconstructed
\= original
Aliasing: The reconstructed sinusoid has a lower frequency than the original!
Sampling of Sinusoid:
Frequency Domain
f0-f0 fs-fs fs+f0
fs-f0-fs+f0-fs -f0
f0-f0 0
f0-f0 fs-fs fs+f0
fs-f0-fs+f0-fs -f0
fs/2-fs/2
0
Spectrum of
cos(2πf0t)
No aliasing
fs >2f0
fs -f0 >f0
Reconstructed
signal: f0
With aliasing
f0<fs <2f0 (folding)
fs -f0 <f0
Reconstructed signal: fs -f0
f0-f0
fs-fs
fs+f0f0-fs-f0+fs-fs -f0
With aliasing
fs <f0 (aliasing)
f0-fs <f0
Reconstructed signal: fs -f0
0
0
More examples with
Sinusoids
4/17/2008 © 2003, JH McClellan & RW Schafer 27
SAMPLING GUI (con2dis)
Strobe Movie
� From SP First, Chapter 4, Demo on “Strobe Movie”
How to determine the necessary
sampling frequency from a signal
waveform?
� Given the waveform, find the shortest ripple, there should be at least two samples in the shortest ripple
� The inverse of its length is approximately the highest frequency of the signal
Tmin
Fmax=1/Tmin
Need at least two
samples in this
interval, in order not
to miss the rise and
fall pattern.
Sampling with Pre-Filtering
Pre-Filter Periodic
H (f) Sampling
x(t) x’(t) xd(n)
Sampling
period T
• If fs < 2fb, aliasing will occur in sampled signal
• To prevent aliasing, pre-filter the continuous signal so that fb<fs/2
• Ideal filter is a low-pass filter with cutoff frequency at fs/2
(corresponding to sync functions in time)
•Common practical pre-filter: averaging within one sampling interval
Summary
� Sampling as multiplication with the periodic impulse train
� FT of sampled signal: original spectrum plus shifted versions (aliases) at multiples of sampling freq.
� Sampling theorem and Nyquist sampling rate
� Sampling of sinusoid signals� Can illustrate what is happening in both temporal and freq.
domain. Can determine the reconstructed signal from the sampled signal.
� Need for prefilter
� Next lecture: how to recover continuous signal from samples, ideal and practical approaches
Readings
� Textbook: Sec. 12.3.1-12.3.2, 4.1-4.3
� Oppenheim and Willsky, Signals and Systems, Chap. 7.
� Optional reading (More depth in frequency
domain interpretation)