· 4 min read
How to Choose a Sample Rate and Avoid Aliasing
Heshan Fernando
Co-founder & COO
A sampled system can only represent frequencies below half its sample rate. Anything above that doesn’t get discarded — it folds back down into the range you’re keeping and appears as a lower frequency that was never there.
That’s aliasing, and the part that matters is that it’s irreversible.
Where the folded frequency lands
The Nyquist frequency is half the sample rate. At 44.1 kHz sampling, it’s 22.05 kHz.
Content above it folds back. For the first fold, the alias appears at:
alias = |sample rate − input frequency|
So a 30 kHz component sampled at 44.1 kHz appears at 14.1 kHz. Not attenuated, not marked as suspect — it appears as a perfectly ordinary 14.1 kHz signal, mathematically identical to a real one.
Which is why it can’t be removed afterwards. Once the sample has been taken, there’s nothing distinguishing the alias from genuine content at that frequency. No filter, no processing, no reconstruction recovers the difference.
The only defence is removing out-of-band content before the converter, with an analogue anti-alias filter.
Why CD audio is 44.1 kHz and not 40
Human hearing extends to roughly 20 kHz. Nyquist says 40 kHz sampling suffices.
But a filter can’t cut off instantly. A real anti-alias filter passes everything below its corner frequency and attenuates above it, over a transition band — and the steeper that transition, the more phase distortion and ringing the filter introduces in the passband.
At 44.1 kHz, the Nyquist frequency is 22.05 kHz. That leaves about 2 kHz between the top of the audible range and the point where folding begins — room for the filter to roll off without needing to be impossibly steep.
The same reasoning explains why higher sample rates ease filter design: more headroom between signal and Nyquist means a gentler filter.
| Sample rate | Nyquist | Headroom above 20 kHz |
|---|---|---|
| 40 kHz | 20 kHz | None — impossible filter |
| 44.1 kHz | 22.05 kHz | ~2 kHz |
| 48 kHz | 24 kHz | 4 kHz |
| 96 kHz | 48 kHz | Generous |
Beyond audio
The same rule applies to any sampled system.
Sensor data. Sampling a vibration signal at 100 Hz when there’s content at 130 Hz produces an alias at 30 Hz that looks like a real vibration mode. Structural monitoring systems have chased phantom resonances this way.
Images. Spatial aliasing is why a striped shirt produces moiré patterns on camera, and why cameras have optical low-pass filters.
Time-series data. Sampling a daily-cycling process weekly can produce apparent trends that are entirely artefacts of the sampling interval.
The last one catches analysts rather than engineers, and it’s the same mathematics.
Common mistakes to avoid
- Sampling at exactly twice the highest frequency, leaving no filter transition band.
- Assuming digital filtering after sampling can remove aliases — it cannot.
- Ignoring out-of-band noise, which aliases just as readily as signal.
- Increasing sample rate to fix aliasing without also considering the analogue filter.
- Sampling a periodic process at an interval close to its period, which produces spectacular artefacts.
How to do it with Nyquist Sampling Calculator
The Nyquist Sampling Calculator shows the Nyquist frequency and where content folds to.
- Enter the highest frequency you need to capture.
- Check the proposed sample rate gives a Nyquist frequency comfortably above it.
- Look at where out-of-band content would alias — that’s what the filter must remove.
- Leave headroom for the anti-alias filter’s transition band.
Other signal processing tools are in the tools directory.
Frequently asked questions
Why is CD audio 44.1 kHz rather than 40?
Because human hearing extends to roughly 20 kHz and a filter can’t cut off instantly. The extra headroom gives the anti-alias filter a transition band.
Can aliasing be removed afterwards?
No. Once folded down, an aliased component is mathematically identical to a real signal at that frequency. It must be filtered out before the converter.
Does a higher sample rate always help?
It eases filter design and helps in processing that generates harmonics. For capture alone, once the Nyquist frequency comfortably exceeds the signal bandwidth, more rate mostly means more data.
Final thought
Filter before you sample. Everything else about sample rate selection is a trade-off; that one is a requirement, because after the converter it’s too late.