Table of contents
Sampling, Aliasing and Filtering: What Changes in the Signal
How sampling and aliasing create false frequencies, how to predict where an alias lands, and how much anti-aliasing filter a SAR or delta-sigma ADC needs.
A data logger samples a temperature probe at 100 Hz. The plot shows a steady 40 Hz ripple that no thermal system could produce. The ripple is real data in the sense that it’s in the file, but it isn’t in the probe. It’s the 60 Hz mains hum picked up by the wiring, sampled too slowly and folded down to 100 − 60 = 40 Hz. That is sampling and aliasing in one picture: a frequency that was never in the band shows up inside it, at a place you can predict with subtraction. This article shows how to predict where an alias lands, why no digital filter can remove it afterwards, and how to size the analog filter that stops it.
Key Takeaways
- An alias appears at |f − k·fs|, the distance from the real frequency to the nearest multiple of the sample rate. You can calculate it before you see it.
- Mains hum, switching regulators and motor drives are the usual culprits, because they put strong energy just above the band people sample.
- Filter order matters less than the gap between your band edge and the first frequency that folds into it. Doubling that gap often saves more than adding poles.
- A delta-sigma ADC relaxes the analog filter because its modulator samples much faster, but it still needs protection near multiples of the modulator frequency.
- Test for aliasing by injecting a tone above half the sample rate and looking for it at its predicted alias frequency.
The forum symptom: “a peak that isn’t there”
Posts about aliasing rarely use the word. They say “my FFT shows a peak at a frequency I’m not generating”, “the reading wobbles slowly but the scope shows nothing slow”, or “changing the sample rate moved the noise”. That last one is the giveaway. Real signal stays at its frequency when you change the sample rate. An alias moves.
The confusion is understandable, because sampled data carries no label saying which frequencies were real. Once a sequence of numbers exists, a 40 Hz tone and a 60 Hz tone sampled at 100 Hz produce exactly the same samples. The information that would distinguish them was discarded at the moment of sampling.
So aliasing is not a noise problem to be averaged away. It’s a bookkeeping problem: any energy above half the sample rate gets reassigned to a frequency below it. The only questions are how much energy is up there and how much of it you let through.
How sampling and aliasing actually work
The rule and where it came from
Harry Nyquist’s 1928 paper in the Transactions of the AIEE showed that the frequency band a telegraph signal needs is directly proportional to its signaling speed. Claude Shannon’s 1949 paper in the Proceedings of the IRE turned the idea into the sampling theorem engineers use today: a signal containing no frequencies above B is completely determined by samples spaced 1/(2B) apart. Half the sample rate, fs/2, is therefore the highest frequency a sampled system can represent without ambiguity. That is the Nyquist frequency.
Michael Unser’s review “Sampling: 50 Years After Shannon” (Proceedings of the IEEE, 2000) is a useful reminder of what the theorem assumes. Shannon’s reconstruction works for band-limited signals, and much of the later theory deals with the realistic case where the input is not band-limited and a prefilter has to make it so. In hardware, that prefilter is the anti-aliasing filter.
Where the alias lands
Analog Devices’ tutorial MT-002 (Kester, 2008) describes the spectrum of a sampled signal as images at |±k·fs ± fa| for every integer k. Every band of width fs/2 (a Nyquist zone) folds into the first one, from DC to fs/2. In practice you find the alias by subtracting the nearest multiple of the sample rate:
f_alias = | f − k·fs |, k = round(f / fs)
Some worked numbers at fs = 1 kHz:
- A 1.2 kHz tone appears at |1200 − 1000| = 200 Hz.
- A 900 Hz tone appears at |900 − 1000| = 100 Hz.
- A 2.05 kHz tone appears at |2050 − 2000| = 50 Hz.
And the logger from the opening: at fs = 100 Hz, 60 Hz mains appears at |60 − 100| = 40 Hz, and its 180 Hz third harmonic appears at |180 − 200| = 20 Hz.
Why software can’t fix it
After sampling, the 40 Hz alias and a genuine 40 Hz signal are the same numbers. A digital filter that removes one removes the other. That is why every converter tutorial puts the anti-aliasing filter in the analog domain, ahead of the sampler.
What the filter has to do
The filter must attenuate everything that could fold into your band of interest. If you care about DC to fa and sample at fs, the first frequency that folds into your band is fs − fa. MT-002 puts it plainly: set the passband edge at fa and the stopband at fs − fa, and the narrower that transition band, the steeper and harder to build the filter. A Butterworth filter rolls off at about 6 dB per octave per pole, so 60 dB across one octave needs at least 10 poles.
Why delta-sigma converters change the calculation
A delta-sigma ADC samples internally at many times the output rate. Analog Devices’ Analog Dialogue RAQ #109 (Pachchigar, 2014) notes modulator rates of typically 32 to 256 times the signal bandwidth, with the digital decimation filter doing most of the anti-aliasing work and relaxing the requirement on the analog input. Texas Instruments’ application note SBAA377B (Thodi & Halder, 2022, rev. 2024) shows both the strength and the remaining gap for one audio-band device family: notches in the modulator transfer function attenuate the bands around multiples of the modulator frequency by more than 100 dB, decimation stages give more than 70 dB of stopband attenuation, and a first- or second-order external filter is still recommended when strong out-of-band interference is present. The same RAQ notes the trade: a successive-approximation (SAR) ADC has no pipeline latency, while a delta-sigma’s digital filter adds group delay.
How much a Butterworth filter actually attenuates
The attenuation of an n-pole Butterworth low-pass at frequency f is 10·log₁₀(1 + (f/fc)²ⁿ) dB. The table uses a 100 Hz passband (fc = 100 Hz) and shows the attenuation at the first frequency that folds into the band, fs − 100 Hz, for two sample rates. The values are calculated, not measured.
| Sample rate | First folding frequency | Ratio to fc | 1 pole | 2 poles | 4 poles |
|---|---|---|---|---|---|
| 250 Hz | 150 Hz | 1.5 | 5.1 dB | 7.8 dB | 14.3 dB |
| 1 kHz | 900 Hz | 9 | 19.1 dB | 38.2 dB | 76.3 dB |
The comparison is the useful part. At 250 Hz sampling, even a 4-pole filter gives only about 14 dB at the first folding frequency, which is useless for a 12-bit system whose ideal SNR is about 74 dB. At 1 kHz sampling the same 4-pole filter gives 76 dB. Raising the sample rate fourfold did more than any reasonable increase in filter order could. The real requirement depends on how much energy sits at those frequencies; a quiet environment needs less attenuation than one next to a motor drive.
What to actually do
List what lives above your Nyquist frequency
Before choosing a filter, write down the strong sources above fs/2: mains (50 or 60 Hz and harmonics), switching regulator frequencies, PWM and motor-drive frequencies, radio and clock leakage, sensor resonances. Calculate where each one would alias. If a predicted alias lands in your band, that source drives the filter specification.
Choose the sample rate to make the filter practical
MT-002 recommends starting at 2.5 to 4 times the highest frequency of interest. The table above shows why: the wider the transition band, the fewer poles you need. If the application only needs data at 100 Hz, you can still sample at 1 kHz and decimate digitally to 100 Hz, which also buys process gain. RAQ #109 gives the rule of thumb: dynamic range improves by about 3 dB per doubling of the oversampling ratio for white noise.
Put the filter corner where the phase shift is acceptable
A filter’s corner frequency is not where it stops affecting the signal. Phase shift and amplitude droop start well below fc. If your application cares about phase (control loops, multi-channel timing, vibration phase), set the corner high enough that the in-band phase error is tolerable, then let the sample rate supply the remaining margin.
Keep the simple RC on delta-sigma inputs
A delta-sigma ADC doesn’t need a steep analog filter, but it does need some. A first- or second-order RC network protects against interference near the modulator frequency, which the digital filter can’t remove, and it gives the input a defined impedance. The TI note above recommends exactly this when strong out-of-band signals are present.
Test for aliasing on the bench
Inject a sine from a signal generator at a frequency above fs/2, chosen so its predicted alias lands in your band. Capture data and look at the predicted frequency. With the filter working, the alias should sit at or below the noise floor. Then change the sample rate slightly: anything that moves is an alias.
What not to do
Don’t rely on averaging to remove aliased interference. Averaging a 40 Hz alias over many cycles reduces it, but averaging over a non-integer number of cycles leaves a residue that changes with timing, and it also blurs the real signal. And don’t set the sample rate at exactly twice the band edge. The theorem’s limit assumes an ideal filter that can’t be built.
How to put it to work
If you have an hour
Write down your sample rate, your band of interest and the three strongest interference sources in the enclosure. Calculate each one’s alias with |f − k·fs|. If any land in your band, you have found your next bench test.
If you have a sprint
Run the injection test above at three frequencies (just above fs/2, near fs, and near the strongest interference source), with and without the anti-aliasing filter. Record attenuation at each predicted alias frequency, with the generator amplitude and sample rate written next to the result.
If you want it to last the product’s lifetime
Keep the interference list and the alias calculations with the design files. When the power supply, motor drive or enclosure changes, the frequencies change, and the filter that was adequate may not be anymore. Rerun the injection test as part of the change review.
The question to ask yourself: “If I changed my sample rate by 10% today, which peaks in my data would move?”
Frequently asked questions
What is aliasing in sampling?
Aliasing is the effect where a frequency above half the sample rate appears in sampled data as a lower frequency. The alias lands at |f − k·fs|, the distance to the nearest multiple of the sample rate. Once sampled, an alias is indistinguishable from a real signal at that frequency, so it must be prevented with an analog filter before the ADC.
What is the Nyquist frequency?
The Nyquist frequency is half the sample rate, fs/2. It is the highest frequency a sampled system can represent without ambiguity. Frequencies above it fold back into the band below it. To sample a signal faithfully, the sample rate must be more than twice the highest frequency present after filtering.
Can you remove aliasing after sampling?
No. Sampling discards the information that distinguishes an alias from a real signal at the same frequency, so any digital filter that removes the alias also removes real data there. You can only prevent aliasing, by filtering the analog signal before the sampler or by sampling fast enough that a practical filter suppresses the interference.
Do delta-sigma ADCs need an anti-aliasing filter?
Usually a simple one. Their oversampling modulator and digital decimation filter handle most anti-aliasing, so a steep analog filter is unnecessary. But interference near multiples of the modulator frequency can still alias, so manufacturers commonly recommend a first- or second-order RC filter at the input, especially when strong out-of-band signals are present.
How do I choose an anti-aliasing filter cutoff?
Set the cutoff a little above your highest frequency of interest so in-band amplitude and phase error stay acceptable, then choose the sample rate and filter order so the first frequency that folds into your band (fs minus the band edge) is attenuated below your noise floor. Sampling faster usually beats adding filter poles.
For the full path from sensor to number, see the signal chain walkthrough; for the filter design itself, see choosing an anti-aliasing filter and oversampling and decimation.
Sources
- Nyquist, H. (1928). “Certain Topics in Telegraph Transmission Theory.” Transactions of the American Institute of Electrical Engineers, 47(2), 617–644. https://doi.org/10.1109/T-AIEE.1928.5055024
- Shannon, C. E. (1949). “Communication in the Presence of Noise.” Proceedings of the IRE, 37(1), 10–21. https://doi.org/10.1109/JRPROC.1949.232969
- Unser, M. (2000). “Sampling: 50 Years After Shannon.” Proceedings of the IEEE, 88(4), 569–587. https://doi.org/10.1109/5.843002
- Kester, W. (2008). “What the Nyquist Criterion Means to Your Sampled Data System Design.” Analog Devices Tutorial MT-002, Rev. A. https://www.analog.com/media/en/training-seminars/tutorials/MT-002.pdf
- Pachchigar, M. (2014). “ADCs for High Dynamic Range: Successive-Approximation or Sigma-Delta?” Analog Dialogue, RAQ Issue 109. Analog Devices. https://www.analog.com/en/resources/analog-dialogue/raqs/raq-issue-109.html
- Thodi, D., & Halder, T. (2022, rev. 2024). “TLV320ADCx140, TLV320ADCx120, PCMx120-Q1, PCMx140-Q1 Integrated Analog Anti-Aliasing Filter and Flexible Digital Filter.” Texas Instruments Application Note SBAA377B. https://www.ti.com/lit/pdf/sbaa377



