Signals and Systems Chapter 7: Sampling The Concept and Representation of Periodic Sampling of a CT Signal Analysis of Sampling in the Frequency Domain The Sampling Theorem - the Nyquist Rate In the Time Domain: Interpolation Undersampling and Aliasing Review/Examples of Sampling/Aliasing DT Processing of CT Signals
Book Chapter#: Section# SAMPLING We live in a continuous-time world: most of the signals we encounter are CT signals, e.g. x(t). How do we convert them into DT signals x[n]? Sampling, taking snap shots of x(t) every T seconds T sampling period x [n] ≡x (nT), n = ..., -1, 0, 1, 2, ... regularly spaced samples Applications and Examples Digital Processing of Signals Strobe Images in Newspapers Sampling Oscilloscope … How do we perform sampling? Computer Engineering Department, Signal and Systems
Why/When Would a Set of Samples Be Adequate? Book Chapter#: Section# Why/When Would a Set of Samples Be Adequate? Observation: Lots of signals have the same samples By sampling we throw out lots of information (all values of x(t) between sampling points are lost). Key Question for Sampling: Under what conditions can we reconstruct the original CT signal x(t) from its samples? Computer Engineering Department, Signal and Systems
Impulse Sampling: Multiplying x(t) by the sampling function Book Chapter#: Section# Impulse Sampling: Multiplying x(t) by the sampling function Computer Engineering Department, Signal and Systems
Analysis of Sampling in the Frequency Domain Book Chapter#: Section# Analysis of Sampling in the Frequency Domain Multiplication Property: Important to note: Sampling Frequency Computer Engineering Department, Signal and Systems
Book Chapter#: Section# Illustration of sampling in the frequency-domain for a band-limited signal (X(jω)=0 for |ω| > ωM) drawn assuming: No overlap between shifted spectra Computer Engineering Department, Signal and Systems
Reconstruction of x(t) from sampled signals Book Chapter#: Section# Reconstruction of x(t) from sampled signals If there is no overlap between shifted spectra, a LPF can reproduce x(t) from xp(t) Computer Engineering Department, Signal and Systems
Reconstruction of x(t) from sampled signals Book Chapter#: Section# Reconstruction of x(t) from sampled signals Suppose x(t) is band-limited, so that : Then x(t) is uniquely determined by its samples {x(nT)} if : where ωs = 2π/T X(jω)=0 for |ω| > ωM ωs > 2ωM = The Nyquist rate Computer Engineering Department, Signal and Systems
Observations on Sampling Book Chapter#: Section# Observations on Sampling In practice, we obviously don’t sample with impulses or implement ideal low-pass filters. One practical example: The Zero-Order Hold Computer Engineering Department, Signal and Systems
Observations (Continued) Book Chapter#: Section# Observations (Continued) Sampling is fundamentally a time varying operation, since we multiply x(t) with a time-varying function p(t). However, is the identity system (which is TI) for band-limited x(t) satisfying the sampling theorem (ωs > 2ωM ). What if ωs ≤ 2ωM? Something different: more later. Computer Engineering Department, Signal and Systems
Book Chapter#: Section# Time-Domain Interpretation of Reconstruction of Sampled Signals: Band-Limited Interpolation The low-pass filter interpolates the samples assuming x(t) contains no energy at frequencies ≥ ωc Computer Engineering Department, Signal and Systems
Original CT signal After Sampling After passing the LPF Book Chapter#: Section# Original CT signal After Sampling After passing the LPF Computer Engineering Department, Signal and Systems
Interpolation Methods Book Chapter#: Section# Interpolation Methods Band-limited Interpolation Zero-Order Hold First-Order Hold : Linear interpolation Computer Engineering Department, Signal and Systems
Undersampling and Aliasing Book Chapter#: Section# Undersampling and Aliasing When ωs ≤ 2ωM => Undersampling Computer Engineering Department, Signal and Systems
Undersampling and Aliasing (continued) Book Chapter#: Section# Undersampling and Aliasing (continued) Higher frequencies of x(t) are “folded back” and take on the “aliases” of lower frequencies Note that at the sample times, xr (nT) = x (nT) Xr (jω) ≠ X(jω) Distortion because of aliasing Computer Engineering Department, Signal and Systems
A Simple Example X(t) = cos(ωot + Φ) Picture would be Modified… Demo: Sampling and reconstruction of cosωot
Sampling Review Demo: Effect of aliasing on music.
Strobe Demo Δ > 0, strobed image moves forward, but at a slower pace Δ = 0, strobed image still Δ < 0, strobed image moves backward. Applications of the strobe effect (aliasing can be useful sometimes):— E.g., Sampling oscilloscope
DT Processing of Band-LimitedCT Signals Why do this? —Inexpensive, versatile, and higher noise margin. How do we analyze this system? —We will need to do it in the frequency domain in both CT and DT —In order to avoid confusion about notations, specify ω—CT frequency variable Ω—DT frequency variable (Ω = ωΤ) Step 1:Find the relation between xc(t) and xd[n], or Xc (jω) and Xd (ejΩ)
Time-Domain Interpretation of C/D Conversion Note: Not full analog/digital (A/D) conversion – not quantizing the x[n] values
Frequency-Domain Interpretation of C/D Conversion
Illustration of C/D Conversion in the Frequency-Domain
D/C Conversion yd[n] →yc(t) Reverse of the process of C/D conversion Again, Ω = ωΤ
Now the whole picture Overall system is time-varying if sampling theorem is not satisfied It is LTI if the sampling theorem is satisfied, i.e. for bandlimited inputs xc (t), with When the input xc(t) is band-limited (X(jω) = 0 at |ω| > ωM)and the sampling theorem is satisfied (ωS> 2ωM), then
Frequency-Domain Illustration of DT Processing of CT Signals
Assuming No Aliasing In practice, first specify the desired Hc(jω), then design Hd(ejΩ).
Example:Digital Differentiator Applications: Edge Enhancement Courtesy of Jason Oppenheim. Used with permission.
Construction of Digital Differentiator Bandlimited Differentiator Desired: Set Assume (Nyquist rate met) Choice for Hd(ejΩ):
Band-Limited Digital Differentiator (continued)
Changing the Sampling Rate
Downsampling b e c d f a n Downsample by a factor of 2 b d f n -3 -2 –1 0 1 2 n Downsample by a factor of 2 b d f -1 0 1 n Downsample by a factor of N: Keep one sample, throw away (N-1) samples Advantage? Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Downsampling A continuous-time signal -3T -2T –T 0 T 2T 3T A continuous-time signal Suppose we now sample at two rates: C/D C/D (1) (2) T MT Q: Relationship between the DTFT’s of these two signals? Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Downsampling (2) (1) MT T Change of variable: C/D C/D Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Downsampling Change of variable: Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Downsampling Change of variable:
Downsampling If M=2,
Downsampling (example)
Downsampling (example) What could go wrong here?
Downsampling with aliasing (illustration) Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Downsampling (preventing aliasing) Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Downsampling with aliasing (illustration) Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Upsampling It is the process of increasing the sampling rate by an integer factor. Application? C/D (1) T C/D (2) T/L Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Upsampling b d f b e c d f a n -3 -2 –1 0 1 2 -3 -2 –1 0 1 2 n Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Upsampling
gain L and cut-off frequency Upsampling Question: How can we obtain from ? Proposed Solution: Low-pass filter with gain L and cut-off frequency L Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Upsampling b d f b e c d f a n d f n -3 -2 –1 0 1 2 -3 -2 –1 0 1 2 -3 -2 –1 0 1 2 n d f -3 -2 –1 0 1 2 n Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Upsampling Shifting property: Q: Relationship between the DTFT’s of these three signals? Shifting property:
Upsampling (Eq.1) On the other hand: (Eq.2) (Eq.1) and (Eq.2) Hossein Sameti, Dept. of Computer Eng., Sharif University of Technology
Upsampling In order to get from we thus need an ideal low-pass filter.
Upsampling L