Aliasing
A high frequency disguised as a low one. The problem is not that it gets distorted: it is that afterward there is no way to tell, because the samples are exactly the same.
01One frequency disguised as another
When the sampling frequency is not high enough, the replicas of the spectrum get into the useful band and a high signal appears in the place of a low one. This is called an alias, and the frequency at which it shows up comes from a simple calculation:
The problem is not that the signal gets distorted: it is that there is no way to tell afterward. Once sampled, the alias signal is indistinguishable from a real signal at that low frequency. There is no subsequent processing that can separate it, because the samples are exactly the same.
A sinusoid sampled at a fixed \( f_s \). Raise its frequency beyond \( f_s/2 \) and watch how the same samples are explained by a different, much slower sinusoid.
02Where you see it without looking for it
| Situation | What is observed | Why |
|---|---|---|
| The wheels of a wagon in the movies | They turn backward or stand still | 24 frames per second sample the rotation of the spokes |
| A striped shirt on television | Bands of color that do not exist appear | The spatial pattern exceeds the resolution of the sensor |
| An oscilloscope with a slow timebase | A fast sinusoid looks slow and with a pulsing amplitude | The sampling rate dropped below twice the frequency |
| An image shrunk without filtering | Textures with strange patterns, the moiré effect | Decimating without a prior anti-aliasing filter |
| Strobe light on a motor | The shaft appears stopped | It is aliasing used on purpose |
The last row is worth remembering: aliasing is not only a defect. A stroboscope and a sequential-sampling oscilloscope use it on purpose to observe signals much faster than their electronics, sampling at a frequency barely different from that of the signal so that the alias falls in a band that is comfortable to measure.
03The anti-aliasing filter is not optional
The sampling theorem requires the signal to be bandlimited, and no real signal is: there is always noise and high-frequency components. That is why an analog low-pass goes before the converter, and it has to be analog: once sampled, the damage is already done.
This is where the usual tension appears: the closer the useful band is to \( f_s/2 \), the sharper the filter has to be, and a sharp filter is high-order, expensive and has nasty group delay.
The elegant way out is to sample much faster than necessary. If the useful band is 20 kHz and you sample at 5 MHz, what folds onto the band is above 4.9 MHz, and a first-order analog filter already attenuates it more than enough. Then you decimate digitally, where the filter can be sharp and linear-phase at no analog cost.
That is the idea behind sigma-delta converters, which sample at tens of megahertz with a single bit and do all the fine work in the digital domain. That is why a modern audio codec needs barely an RC at the input where the converters of the eighties had eighth-order filters.
04In the lab
With \( f_s = 8 \) kHz, calculate the frequency at which signals of 3, 5, 9, 11 and 16 kHz appear. Verify that 3 and 5 kHz land in the same place, and explain why they cannot be distinguished.
Using a microcontroller, sample a 1.1 kHz sinusoid at 1 kS/s and plot the samples. Check that a 100 Hz sinusoid is seen, and that raising it to 1.2 kHz gives a 200 Hz one.
For a 12-bit converter with a 10 kHz useful band and \( f_s = 48 \) kHz, determine at what frequency the folding starts and how much attenuation is needed there. Choose the order of the anti-aliasing filter.
05Common mistakes
- Believing you can filter afterward. Once sampled, the alias is indistinguishable from a legitimate signal.
- Putting the anti-aliasing filter in the digital domain. It has to be analog, before the converter.
- Forgetting wideband noise. Even if the useful signal is slow, the noise folds anyway.
- Trusting that the converter “filters something”. A sample-and-hold is not an anti-aliasing filter.
- Decimating without filtering. Lowering the sampling frequency also generates aliasing, and there the filter can indeed be digital.
06Self-assessment
With \( f_s = 8 \) kHz, how does a 9 kHz signal appear?
As 1 kHz: \( |9 - 8| = 1 \).
And an 11 kHz one?
As 3 kHz: \( |11 - 8| = 3 \). It is confused with a real 3 kHz signal.
Why does the anti-aliasing filter have to be analog?
Because the folding happens at the moment of sampling. Afterward there is nothing left to separate.
Why do the wagon wheels turn backward in the movies?
Because 24 frames per second sample the rotation of the spokes, and the alias can come out negative: it appears to rotate backward.
What advantage does oversampling give?
It moves the folding band away, so the analog filter can be much simpler and the fine work is done digitally.
Is aliasing good for anything?
Yes: the stroboscope and the sequential-sampling oscilloscope use it on purpose to observe signals faster than their own electronics.
07Further reading
- Alan V. Oppenheim and Alan S. Willsky. Signals and Systems. 2nd ed. (Spanish edition, “Señales y sistemas”), Prentice Hall, 1997. Aliasing derived from the overlap of replicas, with graphical examples.
- Walt Kester (ed.). Data Conversion Handbook. Analog Devices / Newnes, 2005. Real anti-aliasing filter design, oversampling and sigma-delta architectures.
- Richard G. Lyons. Understanding Digital Signal Processing. 3rd ed., Prentice Hall, 2010. Folding explained with figures you understand at first glance, and bandpass sampling.