Lecture 7: Sampling
ECE 153/250: DIGITAL SIGNAL PROCESSING
REF: 4.1; 4.2; 4.3
Today’s Topic
❑ Sampling
➢ Nyquist sampling theorem
➢ Time domain representation
➢ Frequency domain representation
➢ 𝑋𝑠 𝑗Ω vs 𝑋 𝑒 𝑗𝜔
Lecture 7: Sampling ECE 153/250 DIGITAL SIGNAL PROCESSING 2
Digital processing of analog signals
❑ Digital processing of analog signals
➢ Analog-to-digital converter
◦ Performs filtering, sampling, and quantization
➢ Digital signal processor
◦ Performs operations e.g., filtering, FFT, etc
➢ Digital-to-analog converter
◦ Performs quantization and reconstruction (filtering)
Analog-to-digital Digital Digital-to-analog Analog
Analog
converter System converter output
input
Lecture 7: Sampling ECE 153/250 DIGITAL SIGNAL PROCESSING 3
Sampling
❑A discrete-time sequence 𝑥[𝑛] is obtained by sampling a
continuous-time signal 𝑥𝑐 𝑡 .
❑ 𝑥[𝑛] is obtained by extracting 𝑥𝑐 (𝑡) every 𝑇 s where 𝑇 is known
as the sampling period or interval.
❑ Relationship between 𝑥𝑐 (𝑡) and 𝑥[𝑛]
➢ 𝑥 𝑛 = 𝑥𝑐 𝑡 ȁ𝑡=𝑛𝑇 = 𝑥𝑐 (𝑛𝑇)
𝑥𝑐 (𝑡) 𝑥[𝑛]
Lecture 7: Sampling ECE 153/250 DIGITAL SIGNAL PROCESSING 4
Sampling Theorem
𝑥𝑐 (𝑡) 𝑥𝑠 (𝑡)
Sampling Theorem: A signal the spectrum of which is band-limited to Ω𝑠 Hz, can be reconstructed
exactly from its samples, if they are taken uniformly at a rate of 𝑅 ≥ 2Ω𝑠 Hz.
❑ Nyquist rate: 2Ω𝑠 Hz
❑ Nyquist frequency: Ω𝑠 Hz
Lecture 9: Pulse Modulation ECE 151: COMMUNICATION SYSTEM 5
Time-domain Representation
❑ Periodic impulse train
➢ 𝑠 𝑡 = σ∞
𝑛=−∞ 𝛿(𝑡 − 𝑛𝑇)
❑ Sampled signal
➢ 𝑥𝑠 𝑡 = 𝑥𝑐 𝑡 𝑠 𝑡
= 𝑥𝑐 𝑡 σ∞𝑛=−∞ 𝛿 𝑡 − 𝑛𝑇
= σ∞𝑛=−∞ 𝑥𝑐 (𝑡)𝛿(𝑡 − 𝑛𝑇)
= σ∞𝑛=−∞ 𝑥𝑐 (𝑛𝑇)𝛿(𝑡 − 𝑛𝑇)
Lecture 7: Sampling ECE 153/250 DIGITAL SIGNAL PROCESSING 6
Frequency Domain Representation
❑ Sampling frequency
➢ 𝛺𝑠 = 2𝜋/𝑇
❑ The Fourier transform of the periodic impulse train 𝑠 𝑡
2𝜋 ∞
➢ 𝑆 𝑗Ω = σ𝑘=−∞ 𝛿(Ω − 𝑘Ω𝑠 )
𝑇
➢ Fourier transform of an impulse train is an impulse train
❑ The Fourier transform of 𝑥𝑠 𝑡
1
➢ 𝑋𝑠 𝑗Ω = 𝑋𝑐 𝑗Ω ∗ 𝑆 𝑗Ω
2𝜋
1 ∞
= σ𝑘=−∞ 𝑋𝑐 𝑗 Ω − 𝑘Ω𝑠
𝑇
Lecture 7: Sampling ECE 153/250 DIGITAL SIGNAL PROCESSING 7
Lecture 7: Sampling ECE 153/250 DIGITAL SIGNAL PROCESSING 8
Aliasing
❑When the sampling rate is too low (below the Nyquist rate), spectral replicas
introduced by sampling overlap, causing distortion
❑Different frequency components become indistinguishable, leading to a loss of
original signal information.
𝑋𝑠 𝑗Ω
𝑋𝑐 𝑗Ω
Ω Ω
−2Ωs −Ωs Ωs 2Ωs
Lecture 9: Pulse Modulation ECE 151: COMMUNICATION SYSTEM 9
Reconstruction
❑ Frequency domain (Low-pass filter)
➢ Theoriginal spectrum is recovered by applying a low-pass filter
➢𝑋𝑟 𝑗Ω = 𝐻𝑟 (𝑗Ω) 𝑋𝑠 (𝑗Ω)
❑ Time domain (Interpolation)
➢ Convolution with the corresponding time-domain filter
➢ 𝑥𝑟 𝑡 = 𝑥𝑠 𝑡 ∗ ℎ𝑟 𝑡 = ℎ𝑟 𝑡 ∗ σ∞ 𝑛=−∞ 𝑥𝑐 (𝑛𝑇)𝛿 𝑡 − 𝑛𝑇
= σ∞𝑛=−∞ 𝑥𝑐 𝑛𝑇 ℎ𝑟 𝑡 − 𝑛𝑇
➢ The interpolation function is the Sinc function
𝜋𝑡
sin 𝑇
◦ ℎ𝑟 𝑡 = 𝜋𝑡
𝑇
Lecture 9: Pulse Modulation ECE 151: COMMUNICATION SYSTEM 10
Reconstruction
𝜋𝑡
sin
𝑇
❑ ℎ𝑟 𝑡 = 𝜋𝑡
𝑇
➢ ℎ𝑟 0 = 1
➢ ℎ𝑟 𝑛𝑇 = 0
❑ 𝑥𝑟 𝑚𝑇 = σ∞
𝑛=−∞ 𝑥𝑐 𝑛𝑇 ℎ𝑟 (𝑚𝑇 − 𝑛𝑇) = 𝑥𝑐 𝑚𝑇
Lecture 7: Sampling ECE 153/250 DIGITAL SIGNAL PROCESSING 11
Example
❑ 𝑥𝑐 𝑡 = cos Ω0 𝑡 ; 𝑋𝑐 𝑗Ω = 𝜋𝛿 Ω − Ω0 + 𝜋𝛿 Ω + Ω0
❑ When Ω0 < Ω𝑠 /2:
Lecture 7: Sampling ECE 153/250 DIGITAL SIGNAL PROCESSING 12
Example
❑ 𝑥𝑐 𝑡 = cos Ω0 𝑡 ; 𝑋𝑐 𝑗Ω = 𝜋𝛿 Ω − Ω0 + 𝜋𝛿 Ω + Ω0
❑ When Ω0 > Ω𝑠 /2:
Lecture 7: Sampling ECE 153/250 DIGITAL SIGNAL PROCESSING 13
Example
❑ Sampling frequency 2Hz
❑ 0.75Hz cos wave and 1.25 Hz cos wave have same sampling points
Lecture 7: Sampling ECE 153/250 DIGITAL SIGNAL PROCESSING 14
𝑥𝑠 𝑡 vs 𝑥[𝑛]
❑ 𝑥𝑠 𝑡 is continuous-time while 𝑥[𝑛] is discrete-time signal
Lecture 7: Sampling ECE 153/250 DIGITAL SIGNAL PROCESSING 15
𝑋𝑠 𝑗Ω vs 𝑋 𝑒 𝑗𝜔
❑ The sampled signal can be expressed as:
➢ 𝑥𝑠 𝑡 = 𝑥𝑐 𝑡 σ∞
𝑛=−∞ 𝛿 𝑡 − 𝑛𝑇
❑ Apply Fourier transform to both sides
➢ 𝑋𝑠 𝑗Ω = σ∞
𝑛=−∞ 𝑥𝑐 𝑛𝑇 𝑒
−𝑗Ω𝑇𝑛
= σ∞
𝑛=−∞ 𝑥[𝑛]𝑒 −𝑗Ω𝑇𝑛
= 𝑋 𝑒 𝑗𝜔 ȁ𝜔=Ω𝑇 = 𝑋 𝑒 𝑗Ω𝑇
1 ∞
➢ 𝑋 𝑒 𝑗Ω𝑇 = σ𝑘=−∞ 𝑋𝑐 𝑗 Ω − 𝑘Ω𝑠
𝑇
1 𝜔 2𝜋𝑘
➢ 𝑋 𝑒 𝑗𝜔 = σ∞ 𝑋 𝑗 −
𝑇 𝑘=−∞ 𝑐 𝑇 𝑇
Lecture 7: Sampling ECE 153/250 DIGITAL SIGNAL PROCESSING 16
Example
❑ Consider a signal
➢ 𝑥𝑐 (𝑡) = cos(4000𝜋𝑡)
➢ Sampling period 𝑇 = 1/6000
1
➢ Thus 𝑥 𝑛 = cos 4000𝜋𝑛 = cos(𝜔0 𝑛)
6000
4000𝜋 2𝜋
◦ 𝜔0 = =
6000 3
❑ In this case
2𝜋
➢ Ω𝑠 = = 12000𝜋
𝑇
➢ Highest frequency of the signal is Ω0 = 4000𝜋
➢ Ω𝑠 > 2Ω0 ⇒ No aliasing
❑ Fourier Transforms
➢ 𝑋𝑐 𝑗Ω = 𝜋𝛿 Ω − 4000𝜋 + 𝜋𝛿 Ω + 4000𝜋
1
➢ 𝑋𝑠 𝑗Ω = σ∞ 𝑋 𝑗 Ω − 𝑘Ω𝑠
𝑇 𝑘=−∞ 𝑐
➢ 𝑋 𝑒 𝑗𝜔 = 𝑋𝑠 𝑗𝜔/𝑇
Lecture 7: Sampling ECE 153/250 DIGITAL SIGNAL PROCESSING 17
Lecture 7: Sampling ECE 153/250 DIGITAL SIGNAL PROCESSING 18
Summary
❑ Sampling Theorem
➢ Nyquist rate
➢ Aliasing
❑ Reconstruction
❑ Next time
➢ Discrete-Time Processing of Continuous-Time Signals
Lecture 7: Sampling ECE 153/250 DIGITAL SIGNAL PROCESSING 19