The strobe-light theorem
Picture a nightclub strobe light flashing over a spinning fan. The fan never stops, yet in the strobe's flicker it can appear frozen, crawling forward, or even spinning backward. Nothing about the fan changed — only how often you looked at it. This is the entire problem of sampling in one image: a digital system never watches a signal continuously. It blinks. An analog-to-digital converter grabs the voltage at one instant, then waits, then grabs again, producing a discrete-time signal — a string of numbers spaced T seconds apart. Everything that happens between the blinks is gone forever.
The astonishing news, proved by Harry Nyquist and Claude Shannon, is that this gappy string of numbers can be lossless. If a signal contains no frequency higher than f_max, then sampling at a rate f_s greater than 2·f_max captures it perfectly — the original continuous waveform can be reconstructed exactly, with no information lost in the gaps. That magic threshold, 2·f_max, is the Nyquist rate. Sample above it and the snapshots tell the whole truth; sample below it and they begin to lie.
When the snapshots lie: a worked alias
Let's break the rule on purpose and watch the disaster unfold. Take a clean 1 kHz sine tone — a single pure pitch, roughly a high C two octaves up — and sample it at only 1.2 kHz. The Nyquist rate this signal demands is 2 × 1 kHz = 2 kHz, but we're sampling at 1.2 kHz, far too slow. The Nyquist frequency of our sampler is just 1.2 kHz / 2 = 600 Hz, and our 1 kHz tone sails right past it. So what does the ADC actually record?
Frequencies above the Nyquist frequency don't vanish — they fold. Any frequency f gets mirrored about f_s and its multiples, reappearing inside the legal band as an alias at f_alias = |f − k·f_s| for whatever integer k brings it into [0, f_s/2]. Plug in: |1000 − 1200| = 200 Hz. The samples taken from our 1 kHz tone are *numerically identical* to the samples a genuine 200 Hz tone would produce. The ADC can't tell them apart, and neither can anything downstream. A pure high pitch has been replaced by a phantom low one.
ANALOG 1 kHz sine (period = 1.000 ms)
/\ /\ /\ /\ /\
/ \ / \ / \ / \ / \
/ \ / \ / \ / \ /
\ / \ / \ / \ /
\/ \/ \/ \/
SAMPLE every 0.833 ms (f_s = 1.2 kHz)
x x x x
\ / \ / \ /
\ / \ / \ /
`--x--` `--x--` `--x--`
The sample dots (x) trace a SLOW 200 Hz wave
f_alias = |1000 - 1200| = 200 Hz
Reconstructed output: a 200 Hz tone that was NEVER played.The guard at the gate: the anti-aliasing filter
Here is the cruel part: aliasing is irreversible. Once a 1 kHz tone has folded down to 200 Hz, no amount of clever DSP can un-fold it, because there is genuinely no information left to tell the phantom 200 Hz from a real one. You cannot fix aliasing after the ADC — you can only prevent it *before*. The defence is an anti-aliasing filter: an analog low-pass filter wired directly in front of the converter, whose job is to throw away every frequency above the Nyquist frequency before the sampler ever sees it.
in ──►[ Anti-alias ]──►[ ADC ]──► samples ──►[ DSP ]
[ low-pass ] f_s = 1.2 kHz
[ filter ]
kills f > 600 Hz BEFORE sampling
Frequency view:
gain
1 |‾‾‾‾‾‾\
| \ <-- filter rolls off here
| \____
0 |_____________\________________ f
0 600 Hz | 1 kHz tone
f_s/2 ^ blocked, never aliasesNo real filter is a perfect brick wall, so engineers pad the margin: CD audio carries content up to 20 kHz yet samples at 44.1 kHz, not the bare 40 kHz minimum. That 2.05 kHz of headroom between 20 kHz and the 22.05 kHz Nyquist frequency gives the analog filter room to roll off gracefully. The same anti-aliasing logic later returns *digitally* — when you downsample with FIR filters you must low-pass first, for exactly the same fold-prevention reason.
- Decide the highest frequency your signal genuinely contains, f_max (e.g. 20 kHz for music).
- Choose a sampling rate comfortably above 2·f_max, leaving headroom for a non-ideal filter (44.1 kHz, not 40 kHz).
- Place an analog low-pass anti-aliasing filter before the ADC, with its cutoff below f_s / 2.
- Only now let the ADC sample — anything that survives the filter is legal and cannot fold.
The other axis: bits, quantization, and 6 dB a step
Sampling chops time into instants; that's only half of digitisation. The other half chops *amplitude* into levels. When the ADC measures the voltage at each instant, it must round that exact value to the nearest rung on a finite ladder — a process called quantization. An N-bit converter has 2^N rungs: 8 bits give 256 levels, 16 bits give 65,536. Whatever falls between two rungs is rounded away, and that rounding error behaves like a faint hiss added to your signal — quantization noise.
Here's the beautiful regularity. Every bit you add halves the gap between rungs, which halves the rounding error, which doubles the signal-to-noise ratio. In decibels, doubling is +6 dB — so each bit buys you about 6 dB of SNR. The standard formula for a full-scale sine wave is SNR ≈ 6.02·N + 1.76 dB. Run the numbers: a 16-bit CD gives 6.02×16 + 1.76 ≈ 98 dB, a vast, near-silent noise floor. An 8-bit converter manages only ≈ 50 dB — fine for a doorbell chime, audibly grainy for music.
SNR ~= 6.02 * N + 1.76 (dB), full-scale sine
---------------------------------------------
N bits | levels | SNR (dB) | feel
-------+----------+----------+----------------
8 | 256 | ~50 | retro / lo-fi
12 | 4096 | ~74 | instrumentation
16 | 65536 | ~98 | CD audio
24 | 16.7 M | ~146 | studio master
Each extra bit -> x2 finer steps -> +6 dB.Why this rung holds up the whole track
Every sample-rate number you'll meet from here on is a Nyquist decision in disguise. Telephone speech samples at 8 kHz because intelligible voice lives below 4 kHz. Bluetooth and most podcasts run 16 kHz or 48 kHz; pro audio leans on 96 or 192 kHz to push the anti-aliasing filter far out of the audible band. A software-defined radio digitising a 100 MHz slice of spectrum needs an ADC clocking past 200 MS/s. None of these are arbitrary — each is 2·f_max plus a margin, the same arithmetic you just did for a 1 kHz tone.
And aliasing isn't only a villain. Undersample on purpose — bandpass sampling — and the very fold that ruined our tone can intelligently slide a narrow high-frequency band down into a slow one your cheap ADC can digitise, a trick at the heart of modern radios. The rule never changes; you just choose which side of it to stand on. Master this rung and the rest of the track — spectra, FIR filters, resampling, the FFT — becomes a series of consequences rather than a series of surprises.