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.
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.
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.
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!
Visualizing Sampling
Adjust the sampling rate and watch what happens. When fs < 2·fsignal, the samples can’t capture the wave shape.
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.
Aliasing in Action
- Movie wheels — spinning backward at 24 fps
- LED lights — flickering on phone video
- Moiré patterns — in photos of fine textures
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.
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)
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.