Signals and Systems

7.3 Undersampling, Aliasing, and Digital Signal Processing Fundamentals

Imron Rosyadi

Undersampling, Aliasing, and Digital Signal Processing Fundamentals

Bridging Continuous and Discrete Worlds

Introduction: The Importance of Sampling

  • Connecting Worlds: Sampling is the bridge between continuous-time (analog) signals and discrete-time (digital) signals.
  • Digital Advantage: Allows us to process analog signals using powerful and flexible digital systems (computers, microcontrollers, DSPs).
  • Core Concept: How do we represent a continuous signal with a finite set of discrete values?
  • Reconstruction: How do we get the original continuous signal back from its samples?
  • The Sampling Theorem: The theoretical foundation for perfect reconstruction.

Figure 7.19: Discrete-time processing of continuous-time signals.

Recap: The Sampling Theorem

  • Condition for Perfect Reconstruction: A band-limited signal \(x(t)\) with highest frequency \(\omega_M\) can be perfectly reconstructed from its samples \(x(nT)\) if the sampling frequency \(\omega_s\) is strictly greater than twice the highest frequency. \[ \omega_s > 2\omega_M \]
  • Nyquist Rate: The minimum sampling rate, \(2\omega_M\), is called the Nyquist rate.
  • Ideal Reconstruction: Achieved by passing the sampled signal through an ideal lowpass filter with a cutoff frequency \(\omega_c\) such that \(\omega_M < \omega_c < \omega_s - \omega_M\).

Why “strictly greater than”?

As we’ll see, sampling exactly at \(2\omega_M\) can lead to issues, especially with phase.

Undersampling: The Effect of Aliasing

  • Definition: Aliasing occurs when the sampling frequency \(\omega_s\) is less than twice the highest frequency \(\omega_M\) in the signal ($ _s < 2_M $).
  • Consequence: The spectral replicas of the original signal \(X(j\omega)\) in the sampled signal’s spectrum \(X_p(j\omega)\) overlap.
    • This overlap means the original signal’s spectrum is no longer recoverable by lowpass filtering.
  • Time Domain: While the reconstructed signal \(x_r(t)\) will still match the original signal \(x(t)\) at the sampling instants (\(x_r(nT) = x(nT)\)), it will not be equal to \(x(t)\) between samples.

Figure 7.15 (d) Spectrum of sampled signal with ωs < 2ω0: Spectral overlap due to undersampling.

Aliasing is generally undesirable!

It introduces distortion where higher frequencies in the original signal are indistinguishable from lower frequencies after sampling, making perfect reconstruction impossible.

Aliasing: Frequency Domain Perspective (Sinusoidal Input)

  • Consider \(x(t) = \cos(\omega_0 t)\). Its spectrum \(X(j\omega)\) has impulses at \(\pm\omega_0\).
  • When sampled, \(X_p(j\omega)\) contains replicas of \(X(j\omega)\) centered at \(k\omega_s\).
  • No Aliasing: If \(\omega_0 < \omega_s/2\), the replicas don’t overlap. The lowpass filter correctly extracts \(\cos(\omega_0 t)\).
    • E.g., \(\omega_0 = \omega_s/6\) or \(\omega_0 = 2\omega_s/6\).
  • Aliasing Occurs: If \(\omega_0 > \omega_s/2\), the replicas overlap.
    • The lowpass filter extracts a different frequency.
    • For \(\omega_s/2 < \omega_0 < \omega_s\), the reconstructed signal is \(x_r(t) = \cos((\omega_s - \omega_0)t)\).
    • The original frequency \(\omega_0\) is “aliased” to a lower frequency \(\omega_s - \omega_0\).

Note

This phenomenon is often called frequency folding, as frequencies above \(\omega_s/2\) are folded back into the baseband spectrum.

Aliasing: Time Domain Impact & Phase Reversal

  • Time Domain Visualization: The lowpass filter, when aliasing occurs, attempts to fit a sinusoid of frequency less than \(\omega_s/2\) to the sampled points.
    • This results in a reconstructed signal that has a different frequency than the original.
  • Phase Reversal: For \(x(t) = \cos(\omega_0 t + \phi)\), aliasing can also cause a phase reversal.
    • When \(\omega_s/2 < \omega_0 < \omega_s\), the reconstructed signal might be \(x_r(t) = \cos((\omega_s - \omega_0)t - \phi)\).
    • The sign of the phase \(\phi\) is reversed.

Figure 7.16 (c) Aliasing with ω0 = 4ωs/6: Original signal (solid), samples, and reconstructed signal (dashed) showing aliasing.

The Nyquist-Shannon Theorem requirement is strictly \(\omega_s > 2\omega_M\).

Sampling exactly at \(2\omega_M\) is not sufficient.

Example 7.1:

  • \(x(t) = \cos((\omega_s/2)t + \phi)\) sampled at \(\omega_s\).
  • Reconstructed: \(x_r(t) = (\cos \phi) \cos((\omega_s/2)t)\).
  • Perfect reconstruction only if \(\phi = 0\).
  • If \(x(t) = \sin((\omega_s/2)t)\) (\(\phi = -\pi/2\)), then \(x_r(t) = 0\). Samples are all zero!

Interactive Demo: Understanding Aliasing

Adjust the signal frequency and sampling frequency to observe aliasing.

Real-World Example: The Stroboscopic Effect

  • Analogy: A strobe light illuminating a rotating object, or camera frames capturing a moving object.
  • The strobe/camera acts as a sampling system, capturing brief snapshots at a periodic rate.
  • Perception of Aliasing:
    • If strobe frequency \(\omega_s\) is much higher than rotational speed \(\omega_{rot}\), motion is perceived correctly.
    • If \(\omega_s < 2\omega_{rot}\), the rotation appears slower, or even in the wrong direction (due to phase reversal)!
  • Examples:
    • Car wheels in old Western movies appearing to spin backward.
    • Helicopter blades appearing stationary or slow-moving in videos.

Discrete-Time Processing of Continuous-Time Signals

  • Motivation: Leverage digital systems (DSPs, microprocessors) for flexible and powerful signal processing.
  • Overall System: A cascade of three operations:
    1. C/D (Continuous-to-Discrete) Converter: Transforms \(x_c(t)\) to \(x_d[n]\).
    2. Discrete-Time System: Processes \(x_d[n]\) to \(y_d[n]\) (e.g., digital filter).
    3. D/C (Discrete-to-Continuous) Converter: Transforms \(y_d[n]\) back to \(y_c(t)\).

C/D and D/C Conversion Details

C/D Conversion:

  1. Periodic Sampling: \(x_c(t)\) is multiplied by an impulse train \(p(t) = \sum \delta(t-nT)\) to get \(x_p(t)\).
  2. Impulse-to-Sequence Mapping: The impulse train \(x_p(t)\) is mapped to a discrete-time sequence \(x_d[n]\) where \(x_d[n] = x_c(nT)\).
    • This effectively normalizes the time axis.

D/C Conversion:

  1. Sequence-to-Impulse Mapping: \(y_d[n]\) is converted into an impulse train \(y_p(t) = \sum y_d[n]\delta(t-nT)\).
  2. Lowpass Filtering: The impulse train \(y_p(t)\) is passed through an ideal lowpass filter to reconstruct \(y_c(t)\).
    • This interpolates between the sample values.

Frequency Domain Perspective of C/D Conversion

  • Spectrum of Sampled Impulse Train (\(X_p(j\omega)\)): \[ X_p(j\omega) = \frac{1}{T} \sum_{k=-\infty}^{+\infty} X_c\left(j(\omega - k\omega_s)\right) \]
    • This shows \(X_p(j\omega)\) as periodic replicas of \(X_c(j\omega)\).
  • Spectrum of Discrete-Time Sequence (\(X_d(e^{j\Omega})\)): \[ X_d(e^{j\Omega}) = \sum_{n=-\infty}^{+\infty} x_c(nT) e^{-j\Omega n} \]
  • Relationship between \(X_p(j\omega)\) and \(X_d(e^{j\Omega})\): \[ X_d(e^{j\Omega}) = X_p(j\Omega/T) \]
    • The discrete-time frequency \(\Omega\) is related to the continuous-time frequency \(\omega\) by \(\Omega = \omega T\).
    • This means \(X_d(e^{j\Omega})\) is a frequency-scaled version of \(X_p(j\omega)\).

Tip

The scaling \(\Omega = \omega T\) is crucial for understanding how continuous-time frequencies map to discrete-time frequencies. The range \([-\omega_s/2, \omega_s/2]\) in continuous time maps to \([-\pi, \pi]\) in discrete time.

Equivalent Continuous-Time System

  • When the input \(x_c(t)\) is band-limited and the sampling theorem is satisfied, the overall system (C/D -> Discrete-Time System -> D/C) behaves like a continuous-time LTI system.
  • Its equivalent continuous-time frequency response \(H_c(j\omega)\) is related to the discrete-time system’s frequency response \(H_d(e^{j\Omega})\) by: \[ H_c(j\omega) = \begin{cases} H_d(e^{j\omega T}), & |\omega| < \omega_s/2 \\ 0, & |\omega| > \omega_s/2 \end{cases} \]
  • This relationship is the foundation for implementing continuous-time filters using discrete-time filters.

Equivalent Continuous-Time System

Figure 7.25(f) Yc(jω) spectrum

Figure 7.26 Hc(jω) vs Hd(e^jΩ): Relationship between discrete-time and equivalent continuous-time frequency responses.

Application: Digital Differentiator

  • Goal: Implement a system where \(y_c(t) = \frac{d}{dt} x_c(t)\).
  • Continuous-Time Ideal Differentiator: \(H_c(j\omega) = j\omega\).
  • Band-Limited Differentiator: \[ H_c(j\omega) = \begin{cases} j\omega, & |\omega| < \omega_c \\ 0, & |\omega| > \omega_c \end{cases} \]
  • Corresponding Discrete-Time Filter: Using \(\Omega = \omega T\) and \(\omega_s = 2\omega_c\), the discrete-time frequency response is: \[ H_d(e^{j\Omega}) = j\left(\frac{\Omega}{T}\right), \quad |\Omega| < \pi \]

Application: Digital Differentiator

Figure 7.27 Continuous-time ideal band-limited differentiator

Ideal \(H_c(j\omega)\)

Figure 7.28 Discrete-time filter for differentiator

Corresponding \(H_d(e^{j\Omega})\)

Example: Impulse Response of Digital Differentiator

  • Consider input \(x_c(t) = \frac{\sin(\pi t/T)}{\pi t}\) (a sinc function, band-limited).
  • Sampled input \(x_d[n] = x_c(nT) = \frac{1}{T}\delta[n]\).
  • The continuous-time derivative is \(y_c(t) = \frac{d}{dt} x_c(t) = \frac{\cos(\pi t/T)}{T t} - \frac{\sin(\pi t/T)}{\pi t^2}\).
  • The discrete-time output \(y_d[n] = y_c(nT)\) is: \[ y_d[n] = \begin{cases} \frac{(-1)^n}{nT^2}, & n \neq 0 \\ 0, & n=0 \end{cases} \]
  • Since \(x_d[n]\) is a scaled impulse, \(y_d[n]\) is the impulse response of the discrete-time filter: \[ h_d[n] = \begin{cases} \frac{(-1)^n}{nT}, & n \neq 0 \\ 0, & n=0 \end{cases} \]

Tip

This example demonstrates how to find the impulse response of a discrete-time filter that implements a continuous-time operation by analyzing its response to a specific band-limited input.

Application: Half-Sample Delay

  • Goal: Implement a continuous-time delay: \(y_c(t) = x_c(t - \Delta)\).
  • Continuous-Time Delay: \(H_c(j\omega) = e^{-j\omega\Delta}\).
  • Band-Limited Delay: \[ H_c(j\omega) = \begin{cases} e^{-j\omega\Delta}, & |\omega| < \omega_c \\ 0, & \text{otherwise} \end{cases} \]
  • Corresponding Discrete-Time Filter: \[ H_d(e^{j\Omega}) = e^{-j\Omega\Delta/T}, \quad |\Omega| < \pi \]
  • If \(\Delta/T\) is an integer, \(y_d[n] = x_d[n - \Delta/T]\) (simple shift).
  • If \(\Delta/T\) is not an integer (e.g., \(\Delta/T = 1/2\) for a half-sample delay), \(y_d[n]\) requires band-limited interpolation to effectively sample the shifted continuous signal.

Application: Half-Sample Delay

Figure 7.29(a) CT delay magnitude and phase

Ideal \(H_c(j\omega)\)

Figure 7.29(b) DT delay magnitude and phase

Corresponding \(H_d(e^{j\Omega})\)

Interactive Demo: Half-Sample Delay

Visualize a continuous signal, its samples, and the effect of a fractional delay.

Sampling of Discrete-Time Signals

  • Analogy: Similar principles apply to sampling discrete-time signals.
  • Process: Impulse-train sampling of a discrete-time signal \(x[n]\).
    • Produces \(x_p[n]\) where \(x_p[n] = x[n]\) at \(n=kN\) and \(0\) otherwise.
    • \(N\) is the sampling period (number of samples skipped).
  • Frequency Domain: \[ X_p(e^{j\omega}) = \frac{1}{N} \sum_{k=0}^{N-1} X(e^{j(\omega - k\omega_s)}) \]
    • Here, \(\omega_s = 2\pi/N\) is the discrete-time sampling frequency.
  • Aliasing: Occurs if \(\omega_s < 2\omega_M\), where \(\omega_M\) is the highest frequency in \(X(e^{j\omega})\) within \([0, \pi]\).
  • Reconstruction: Lowpass filter with gain \(N\) and cutoff \(\omega_s/2\).

Discrete-Time Decimation (Downsampling)

  • Problem with \(x_p[n]\): It contains many zeros, which are inefficient for storage or transmission.
  • Decimation (Downsampling): Creates a new sequence \(x_b[n]\) by extracting only the non-zero samples of \(x_p[n]\). \[ x_b[n] = x_p[nN] = x[nN] \]
    • Effectively reduces the sampling rate by a factor of \(N\).
  • Frequency Domain: The spectrum of the decimated signal \(X_b(e^{j\omega})\) is a frequency-scaled version of \(X_p(e^{j\omega})\): \[ X_b(e^{j\omega}) = X_p(e^{j\omega/N}) \]
    • Decimation “stretches” the spectrum of the original sequence over a larger portion of the frequency band \([-\pi, \pi]\).
  • Use Case: If the original continuous-time signal was oversampled, or if filtering reduced its bandwidth, decimation can reduce the data rate without aliasing.

Discrete-Time Decimation (Downsampling)

Figure 7.34 Relationship between xp[n] and xb[n]

Sampling vs. Decimation

Figure 7.35 Frequency-domain illustration of sampling and decimation

Effect of decimation in frequency domain

Discrete-Time Interpolation (Upsampling)

  • Reverse of Decimation: Increases the effective sampling rate of a discrete-time sequence.
  • Process to Upsample by a factor of \(L\):
    1. Zero-Insertion: Insert \(L-1\) zeros between each sample of the input sequence \(x[n]\) to create a zero-padded sequence \(x_p[n]\).
    2. Lowpass Filtering: Pass \(x_p[n]\) through a lowpass filter to smooth out the inserted zeros and reconstruct the interpolated sequence \(y[n]\).

Caution

The lowpass filter is crucial to remove the spectral images introduced by zero-insertion and prevent unwanted high-frequency components in the upsampled signal.

Example: Combined Decimation and Interpolation

  • Sometimes, a single decimation or interpolation factor isn’t enough, or a non-integer factor is desired.
  • Scenario (Example 7.5): A sequence \(x[n]\) with spectrum \(X(e^{j\omega})\) that is zero for \(2\pi/9 \le |\omega| \le \pi\).
    • Maximum decimation without aliasing is \(N=4\).
    • However, the spectrum after decimation by 4 still has unused bandwidth.
  • Achieving non-integer rate change (e.g., \(9/2\)):
    1. Upsample by a factor of \(L=2\).
    2. Downsample by a factor of \(M=9\).
    • Overall rate change: \(L/M = 2/9\).
    • This allows the spectrum to be stretched to fill the entire frequency band \([-\pi, \pi]\) without aliasing.

Example: Combined Decimation and Interpolation

Figure 7.38(a) Spectrum of x[n]

Original \(X(e^{j\omega})\)

Figure 7.38(d) Spectrum after upsampling by 2 and downsampling by 9

Final spectrum after rate change by 2/9

Note

This technique is vital in multi-rate signal processing, allowing efficient conversion between different sampling rates.

Summary

  • Sampling Theorem: Foundation for converting continuous to discrete signals, requiring \(\omega_s > 2\omega_M\) for perfect reconstruction.
  • Aliasing: Distortion caused by undersampling (\(\omega_s < 2\omega_M\)), where higher frequencies are “folded” into lower frequencies, leading to incorrect reconstruction.
    • Can be exploited in applications like the stroboscope effect.
  • Discrete-Time Processing of Continuous-Time Signals: A powerful paradigm involving C/D conversion, discrete-time filtering, and D/C conversion.
    • Allows implementation of continuous-time LTI systems digitally.
    • Applications include digital differentiators and fractional delays.
  • Discrete-Time Sampling:
    • Decimation (Downsampling): Reduces data rate by extracting every \(N\)th sample, efficient for oversampled or band-limited signals.
    • Interpolation (Upsampling): Increases data rate by inserting zeros and lowpass filtering, essential for sample rate conversion.

Important

Understanding these concepts is fundamental for designing and analyzing virtually all modern digital signal processing systems in ECE.