Fiveable

🔌Intro to Electrical Engineering Unit 20 Review

QR code for Intro to Electrical Engineering practice questions

20.1 Sampling theorem and aliasing

20.1 Sampling theorem and aliasing

Written by the Fiveable Content Team • Last updated August 2025
Written by the Fiveable Content Team • Last updated August 2025
🔌Intro to Electrical Engineering
Unit & Topic Study Guides

Sampling Theorem

Nyquist-Shannon Sampling Theorem and Bandlimited Signals

The Nyquist-Shannon sampling theorem answers a fundamental question: how often do you need to sample a continuous signal to capture all of its information? Without this guarantee, converting analog signals to digital form would be guesswork.

The theorem applies specifically to bandlimited signals, meaning signals whose frequency content doesn't extend beyond some maximum frequency. That maximum frequency component is called the bandwidth. Any signal with energy above that limit is considered non-bandlimited, and the theorem's guarantees no longer hold cleanly.

Some real-world examples of approximately bandlimited signals:

  • Audio signals occupy roughly 20 Hz to 20 kHz (the range of human hearing)
  • Standard-definition video signals have bandwidth around 4.2 MHz

Sampling Rate and Nyquist Frequency

The sampling rate fsf_s is the number of samples taken per second when converting a continuous-time signal to discrete time, measured in hertz (Hz). A higher sampling rate captures more detail about the original signal.

The Nyquist frequency fNf_N is defined as half the sampling rate:

fN=fs2f_N = \frac{f_s}{2}

This represents the highest frequency that can be accurately represented in the sampled signal. Any frequency content above fNf_N will not be captured correctly.

The theorem states that to perfectly reconstruct a bandlimited signal with bandwidth BB, you need:

fs2Bf_s \geq 2B

This minimum value 2B2B is called the Nyquist rate. Think of it this way: you need at least two samples per cycle of the highest frequency present. One sample alone can't tell you whether a wave is going up or down, so two per period is the bare minimum to track the oscillation.

Nyquist-Shannon Sampling Theorem and Bandlimited Signals, Nyquist frequency - Wikipedia

Aliasing and Undersampling

Aliasing

Aliasing occurs when you sample below the Nyquist rate. Frequency components above fNf_N don't just disappear; they "fold back" into the spectrum below fNf_N, masquerading as lower frequencies. The result is distortion that you can't undo after the fact, because the aliased components become indistinguishable from real low-frequency content.

Mathematically, a frequency ff that's above the Nyquist frequency appears in the sampled signal as a mirror image reflected across fNf_N. For example, if fs=8f_s = 8 kHz (so fN=4f_N = 4 kHz) and the signal contains a 5 kHz tone, that tone shows up as a 3 kHz tone in the sampled data (it folds back by 54=15 - 4 = 1 kHz from the Nyquist frequency, landing at 41=34 - 1 = 3 kHz).

You've likely seen aliasing without realizing it:

  • Wagon wheel effect in video: wheel spokes appear to rotate backwards because the frame rate undersamples the rotation frequency
  • Stroboscopic effect in audio: a high-pitched tone, when undersampled, sounds like a completely different lower-pitched tone
Nyquist-Shannon Sampling Theorem and Bandlimited Signals, Nyquist–Shannon sampling theorem - Wikipedia, the free encyclopedia

Undersampling and the Frequency Spectrum

Undersampling simply means sampling below the Nyquist rate. It causes the copies of the signal's spectrum (which repeat at multiples of fsf_s) to overlap. This spectral overlap is exactly what aliasing looks like in the frequency domain: high-frequency components fold on top of low-frequency components, and you can no longer separate them.

To prevent aliasing, you have two tools:

  1. Choose a high enough sampling rate so that fNf_N exceeds the signal's maximum frequency
  2. Apply a low-pass filter before sampling (called an anti-aliasing filter) to remove any frequency content above fNf_N

In practice, you almost always use both.

Oversampling and Filtering

Oversampling

Oversampling means sampling at a rate significantly higher than the Nyquist rate. This gives you more headroom and several practical benefits:

  • The sampled signal more accurately represents the original continuous signal
  • Quantization noise gets spread across a wider frequency band, improving the signal-to-noise ratio (SNR)
  • The anti-aliasing filter design becomes much easier (more on this below)

A familiar example: audio CDs sample at 44.1 kHz. Since human hearing tops out at about 20 kHz, the Nyquist rate is 40 kHz. The extra 4.1 kHz of margin is deliberate oversampling that gives the anti-aliasing filter room to roll off gradually rather than needing a perfectly sharp cutoff at 20 kHz. Sigma-delta analog-to-digital converters (ADCs) take this even further, oversampling by large factors to achieve high resolution.

Anti-Aliasing Filter

An anti-aliasing filter is a low-pass filter placed before the sampler. Its job is to remove (or at least heavily attenuate) any frequency content above fNf_N so that aliasing doesn't occur.

An ideal anti-aliasing filter would have a perfectly sharp cutoff right at fNf_N, passing everything below and blocking everything above. In reality, every filter has a transition band where it gradually rolls off, so some small amount of energy above fNf_N may leak through.

This is where oversampling helps: the gap between the signal's highest frequency and fNf_N gets wider, so the filter's transition band can be more gradual. A gentler rolloff is far easier and cheaper to build in hardware.

Common implementations include:

  • Analog RC or active filters placed before the ADC
  • Digital FIR filters used in multi-stage conversion systems where initial oversampling is followed by decimation