DSP 101
M02 · L01
Module 2: Sampling & Quantization

The Sampling Theorem

How do we capture a continuous signal in discrete form without losing information? Nyquist and Shannon gave us the answer — and it changed everything.

01 / 11
DSP 101
M02 · L01
The Process

From Continuous to Discrete

Real-world signals — audio, temperature, vibration — are continuous. To process them digitally, we take snapshots at regular intervals. Each snapshot is a sample.

Sampling Rate (fs)
The number of samples per second, measured in Hz. More samples = more detail captured.
02 / 11
DSP 101
M02 · L01
The Key Question

How Fast Must We Sample?

Sample too slowly and you lose information. Sample too fast and you waste storage. Harry Nyquist and Claude Shannon answered this: you must sample at least twice the highest frequency in the signal.

Nyquist Rate
f_s \geq 2 \cdot f_{\max}
03 / 11
DSP 101
M02 · L01
The Theorem

The Nyquist-Shannon Theorem

A bandlimited signal with no frequency components above fmax can be perfectly reconstructed from samples taken at fs ≥ 2·fmax. No information is lost!

44.1 kHz
CD Audio
8 kHz
Phone
Why these rates?
CD: fmax=20 kHz → need ≥40 kHz. Phone: fmax=3.4 kHz → need ≥6.8 kHz.
04 / 11
DSP 101
Interactive
Try It

Visualizing Sampling

Adjust the sampling rate and watch what happens. When fs < 2·fsignal, the samples can’t capture the wave shape.

fsig3.0 Hz
fs8.0 Hz
fs = 8.0 Hz ≥ 2 × 3.0 Hz = 6.0 Hz — OK!
05 / 11
DSP 101
M02 · L01
The Danger

What Happens Below Nyquist?

When you sample below 2·fmax, you get aliasing. The sampled signal looks like a completely different, lower frequency signal. It’s like watching a car wheel on video — sometimes it appears to spin backward.

The Stroboscopic Effect
A camera at 24 fps makes a wheel spinning at 23 rps appear to rotate at just 1 rps — backward! At 25 rps it crawls forward at 1 rps instead. This is exactly aliasing.
06 / 11
DSP 101
M02 · L01
Real-World Examples

Aliasing in Action

  • Movie wheels — spinning backward at 24 fps
  • LED lights — flickering on phone video
  • Moiré patterns — in photos of fine textures
Alias Frequency
f_{\text{alias}} = |f_{\text{signal}} - n \cdot f_s|
07 / 11
DSP 101
M02 · L01
The Solution

The Anti-Aliasing Filter

Before sampling, pass the signal through a low-pass filter that removes all frequencies above fs/2. This prevents aliasing. Every ADC has one built in.

Without the filter
High frequencies masquerade as low frequencies in the digital signal — and there’s no way to undo it after sampling.
Cutoff Frequency
f_{\text{cutoff}} = \frac{f_s}{2}
08 / 11
DSP 101
Knowledge Check

Check what stuck

Four questions from this lesson. Answer to see why — the explanation appears whether you were right or wrong. Nothing is scored or saved.

Question 1 of 0
Score 0/0

09 / 11
DSP 101
Key Takeaways
Summary

Key Takeaways

  • Sampling converts continuous signals to discrete
  • Nyquist rate: fs ≥ 2·fmax for perfect reconstruction
  • Below Nyquist → aliasing (false frequencies appear)
  • Anti-aliasing filter removes frequencies above fs/2 before sampling
  • CD audio (44.1 kHz) captures all human hearing (up to ~20 kHz)
10 / 11
DSP 101
Up Next
Coming Up

Aliasing: When You Under-sample

Now that you know the rule, let’s see what happens when you break it. We’ll explore aliasing in depth — the math, the visuals, and how it shows up in real-world systems.

11 / 11