sampling continuous-time signals - cppsim
TRANSCRIPT
M.H. Perrott © 2007 Sampling Continuous-Time Signals, Slide 1
SamplingContinuous-Time
Signals• Impulse train and its Fourier Transform • Impulse samples versus discrete-time sequences• Aliasing and the Sampling Theorem• Anti-alias filtering• Comparison of FT, DTFT, Fourier Series
Copyright © 2007 by M.H. PerrottAll rights reserved.
M.H. Perrott © 2007 Sampling Continuous-Time Signals, Slide 2
The Need for Sampling
• The boundary between analog and digital– Real world is filled with continuous-time signals– Computers (i.e. Matlab) operate on sequences
• Crossing the analog-to-digital boundary requires sampling of the continuous-time signals
• Key questions– How do we analyze the sampling process?– What can go wrong?
x[n]xc(t)
t
xc(t)
n
x[n]
1
A-to-D
Converter
Real World(USRP Board)
Matlab
M.H. Perrott © 2007 Sampling Continuous-Time Signals, Slide 3
An Analytical Model for Sampling
• Two step process– Sample continuous-time signal every T seconds
• Model as multiplication of signal with impulse train– Create sequence from amplitude of scaled impulses
• Model as rescaling of time axis (T goes to 1)• Notation: replace impulses with stem symbols
p(t)
xp(t) x[n]xc(t) Impulse Train
to Sequence
t
p(t)
T
1
t
T
t
xc(t) xp(t)
n
x[n]
1
Can we model this in the frequency domain?
M.H. Perrott © 2007 Sampling Continuous-Time Signals, Slide 4
t
p(t)
T
1
P(f)
f0
T1
T2
T-1
T-2
T1
Fourier Transform of Impulse Train
• Impulse train in time corresponds to impulse train in frequency– Spacing in time of T seconds corresponds to spacing in
frequency of 1/T Hz– Scale factor of 1/T for impulses in frequency domain– Note: this is painful to derive, so we won’t …
• The above transform pair allows us to see the following with pictures– Sampling operation in frequency domain– Intuitive comparison of FT, DTFT, and Fourier Series
M.H. Perrott © 2007 Sampling Continuous-Time Signals, Slide 5
t
p(t)
T
1
P(f)
f0
T1
T2
T-1
T-2
T1
t
T
t
xc(t) xp(t)
Xp(f)
f0
T1
T2
T-1
T-2
TA
Xc(f)
f
A
Frequency Domain View of Sampling
• Recall that multiplication in time corresponds to convolution in frequency
• We see that sampling in time leads to a periodicFourier Transform with period 1/T
M.H. Perrott © 2007 Sampling Continuous-Time Signals, Slide 6
t
T
xp(t)
n
x[n]
1
Xp(f)
f0
T1
T2
T-1
T-2
TA
X(ej2πλ)
λ
0 1 2-1-2
TA
Frequency Domain View of Output Sequence
• Scaling in time leads to scaling in frequency– Compression/expansion in time leads to expansion/
compression in frequency• Conversion to sequence amounts to T going to 1
– Resulting Fourier Transform is now periodic with period 1– Note that we are now essentially dealing with the DTFT
M.H. Perrott © 2007 Sampling Continuous-Time Signals, Slide 7
p(t)
xp(t) x[n]xc(t) Impulse Train
to Sequence
t
p(t)
T
1
t
T
t
xc(t) xp(t)
n
x[n]
1
Xp(f)
f0
T1
T2
T-1
T-2
TA
X(ej2πλ)
λ
0 1 2-1-2
TA
Xc(f)
f0
A
Summary of Sampling Process
• Sampling leads to periodicity in frequency domain
We need to avoid overlap of replicated signals in frequency domain (i.e., aliasing)
M.H. Perrott © 2007 Sampling Continuous-Time Signals, Slide 8
t
p(t)
T
1
P(f)
f0
T1
T2
T-1
T-2
T1
t
T
t
xc(t) xp(t)
Xp(f)
f0
T1
T2
T-1
T-2
TA
Xc(f)
f
A
fbw-fbw
fbw-fbw- fbw
T1- + fbw
T1
• Overlap in frequency domain (i.e., aliasing) is avoided if:
The Sampling Theorem
• We refer to the minimum 1/T that avoids aliasing as the Nyquist sampling frequency
M.H. Perrott © 2007 Sampling Continuous-Time Signals, Slide 9
p(t)
xp(t)
T
Impulse Train
to Sequence
x[n]
T 1
xc(t)
tt n
t
1/T0-1/Tf
10-1λ
1/T0-1/Tf
Example: Sample a Sine Wave
• Time domain: resulting sequence maintains the same period as the input continuous-time signal
• Frequency domain: no aliasing
Xc(f) Xp(f) X(ej2πλ)
Sample rate is well above Nyquist rate
M.H. Perrott © 2007 Sampling Continuous-Time Signals, Slide 10
tt n
p(t)
xp(t)
T
Impulse Train
to Sequence
x[n]
T 1
xc(t)
t
1/T0-1/Tf
10-1λ
1/T0-1/Tf
Increase Input Frequency Further …
• Time domain: resulting sequence still maintains the same period as the input continuous-time signal
• Frequency domain: no aliasing
Sample rate is at Nyquist rate
Xc(f) Xp(f) X(ej2πλ)
M.H. Perrott © 2007 Sampling Continuous-Time Signals, Slide 11
tt n
p(t)
xp(t)
T
Impulse Train
to Sequence
x[n]
T 1
xc(t)
t
1/T0-1/Tf
10-1λ
1/T0-1/Tf
Increase Input Frequency Further …
• Time domain: resulting sequence now appears as a DC signal!
• Frequency domain: aliasing to DC
Sample rate is at half the Nyquist rate
Xc(f) Xp(f) X(ej2πλ)
M.H. Perrott © 2007 Sampling Continuous-Time Signals, Slide 12
tt n
p(t)
xp(t)
T
Impulse Train
to Sequence
x[n]
T 1
xc(t)
t
1/T0-1/Tf
10-1λ
1/T0-1/Tf
Increase Input Frequency Further …
• Time domain: resulting sequence is now a sine wave with a different period than the input
• Frequency domain: aliasing to lower frequency
Sample rate is well below the Nyquist rate
Xc(f) Xp(f) X(ej2πλ)
M.H. Perrott © 2007 Sampling Continuous-Time Signals, Slide 13
p(t)
xp(t) x[n]xc(t) Impulse Train
to Sequence
t
p(t)
T
1
Xp(f)
f0
T1
T2
T-1
T-2
TA
X(ej2πλ)
λ
0 1 2-1-2
TA
Xc(f)
f0
A
T1
T-1
Undesired
Signal or
Noise
The Issue of High Frequency Noise
• We typically set the sample rate to be large enough to accommodate full bandwidth of signal
• Real systems often introduce noise or other interfering signals at higher frequencies– Sampling causes this noise to alias into the desired
signal band
M.H. Perrott © 2007 Sampling Continuous-Time Signals, Slide 14
xc(t)H(f)
p(t)
xp(t) x[n]Impulse Train
to Sequence
t
p(t)
T
1
Xp(f)
f0
T1
T2
T-1
T-2
X(ej2πλ)
λ
0 1 2-1-2
Xc(f)
f0
T1
T-1
xc(t)
Anti-aliasLowpass
H(j2πf)
Anti-Alias Filtering
• Practical A-to-D converters include a continuous-time filter before the sampling operation– Designed to filter out all noise and interfering signals
above 1/(2T) in frequency– Prevents aliasing
M.H. Perrott © 2007 Sampling Continuous-Time Signals, Slide 15
Using the Impulse Train to Compare the FT, DTFT, and Fourier Series
M.H. Perrott © 2007 Sampling Continuous-Time Signals, Slide 16
p(t)
xp(t) x[n]xc(t) Impulse Train
to Sequence
t
xc(t)
n
x[n]
1
X(ej2πλ)
λ
0 1 2-1-2
Xc(f)
f0
Relationship Between FT and DTFT
FT
Continuous, Non-Periodic
Non-Periodic, Continuous
Discrete, Non-Periodic
Periodic, Continuous
DTFT
Time:
Freq:
M.H. Perrott © 2007 Sampling Continuous-Time Signals, Slide 17
0T1
T2
T-1
T-2
T-3
T3
T4
T-4
T5
T-5
Xp(f)
f
Tp
1Tp
-10
Tp
2Tp
-2
0T1
T2
T-1
T-2
T-3
T3
T4
T-4
T5
T-5
P(f)
f f
X(f)
t t
x(t)xp(t)
t
Tp
p(t)
0 T 2T-T-2TTp
T
Relationship Between FT and Fourier Series
FT
Continuous, Non-Periodic
Non-Periodic, Continuous
Continuous, Periodic
Non-Periodic, Discrete
Fourier Series
Time:
Freq:
M.H. Perrott © 2007 Sampling Continuous-Time Signals, Slide 18
Summary• The impulse train and its Fourier Transform form a
very powerful analysis tool using pictures– Sampling, comparison of FT, DTFT, Fourier Series
• Sampling analysis:– Time domain: multiplication by an impulse train followed by
re-scaling of time axis (and conversion to stem symbols)– Frequency domain: convolution by an impulse train followed
by re-scaling of frequency axis
• Prevention of aliasing– Sample faster than Nyquist sample rate of signal bandwidth– Use anti-alias filter to cut out high frequency noise
• Up next: downsampling, upsampling, reconstruction