Sampling & Aliasing
Sampling turns continuous signals into numbers. Learn the Nyquist–Shannon sampling theorem, aliasing and how to calculate alias frequencies, anti-aliasing filters, reconstruction (zero-order hold, sinc interpolation), oversampling and decimation, undersampling (bandpass sampling), and quantisation.
Every digital audio recording, oscilloscope, SDR and sensor system samples signals. Sample too slowly and high frequencies masquerade as lower ones (aliasing) — an error that cannot be removed afterwards.
An analogy
Aliasing is like a film of a spinning wagon wheel that appears to rotate backwards: the camera's frame rate is too low to capture the true motion.
The sampling theorem
A band-limited signal with no content above f_max is perfectly represented by samples taken faster than 2f_max. CD audio samples at 44.1 kHz to capture 20 kHz hearing.
Aliasing
Frequencies above f_s/2 fold back into 0…f_s/2. A 30 kHz tone sampled at 44.1 kHz appears at 14.1 kHz. Anti-aliasing low-pass filters must remove such content before the ADC.
Reconstruction
DACs output a staircase (zero-order hold) with a sinc-shaped roll-off; a reconstruction filter removes images around multiples of f_s.
Oversampling and bandpass sampling
Oversampling relaxes analog filters and, with decimation filtering, improves SNR (sigma-delta converters). Bandpass (under-)sampling deliberately aliases a narrowband RF/IF signal down to baseband — used in SDR receivers.
Formulas
- Nyquist criterion:
f_s > 2 f_max - Alias frequency:
f_a = |f − k f_s| (k = nearest integer to f/f_s) - Oversampling SNR gain:
ΔSNR = 10 log₁₀(OSR) (≈ 0.5 bit per doubling) - Quantisation SNR:
SQNR = 6.02 N + 1.76 dB
Worked example: Alias
Given: 30 kHz tone, f_s = 44.1 kHz
Find: Apparent frequency.
- k = round(30/44.1) = 1
- f_a = |30 − 44.1| = 14.1 kHz
Answer: 14.1 kHz (audible, wrong)
Worked example: Oversampling gain
Given: 16× oversampling with ideal decimation
Find: SNR improvement.
- 10 log 16 = 12 dB ≈ 2 extra bits
Answer: +12 dB
Common mistakes
- Wrong: Sampling exactly at 2f_max. — Right: Leave margin for realisable anti-alias filters.
- Wrong: Filtering after sampling to remove aliases. — Right: Aliases must be prevented before sampling.
Applications
- Audio: 44.1/48/96 kHz sampling.
- Oscilloscopes: Sample rate ≥ 5× bandwidth for good waveforms.
- SDR: Bandpass sampling of RF signals.
Key takeaways
- f_s > 2f_max.
- Aliases: f_a = |f − k f_s|.
- Filter before sampling.
- Oversampling improves SNR.
Going further
- Sigma-delta modulation: Noise shaping with oversampling.
- Polyphase decimation: Efficient multirate filtering.
- Jitter: Clock jitter limits SNR at high frequencies.