Textbooks/Signals and Systems/Chapter 3Lite (plain text) version
3Aliasing: when samples lie
Version 1 · Technically checked (automated checks only) · 4 source lessons · 8 practice items
Introduction
Sample too slowly and a fast signal does not disappear; it disguises itself as a slow one. Wagon wheels in films turn backwards for the same reason. The alias frequency can be predicted exactly by folding the true frequency around multiples of the sample rate. Once aliased, no software can separate the impostor from a real signal, so the cure is an analogue low-pass filter before the sampler.
Explanation
This chapter is built from 4 School lessons. Each part below is the lesson's own explanation; open the lesson for its predict-and-discover activities.
3.1 Aliasing: when samples tell lies
In films, car wheels sometimes spin backwards while the car speeds forwards. The camera isn't broken. What is it doing?
Aliasing in one sentence
When a signal contains frequencies above fₛ/2, sampling folds them down into the range 0 to fₛ/2, where they look exactly like genuine low-frequency signals. After sampling, nothing can tell them apart: the information is gone.
The wagon-wheel effect
A spoked wheel looks identical after turning by one spoke gap. If, between frames, it turns almost exactly one gap, it looks almost still; slightly less than a gap, it seems to creep backwards. Films at 24 fps, strobe lights and LED lighting that flickers at a fixed rate all create this illusion with real machines.
Preventing aliasing
Prevent it before sampling: an analogue anti-aliasing filter removes frequencies above fₛ/2, or you raise fₛ above twice the highest frequency present. A digital filter after sampling is too late: the alias is already mixed into the band you care about.
Derivation: Where the alias frequency comes from
Sample x(t) = sin(2πft) at instants t = k/fₛ: the samples are x[k] = sin(2πf·k/fₛ).
Add any whole number m of sample rates to the frequency: sin(2π(f + m·fₛ)·k/fₛ) = sin(2πf·k/fₛ + 2πmk). Since mk is a whole number, the extra 2πmk changes nothing.
So f, f ± fₛ, f ± 2fₛ, … all give identical samples: they are aliases of each other.
Also sin(−θ) = −sin(θ), so a frequency −a gives the same samples as +a with the phase flipped. Frequencies are indistinguishable from their mirror images too.
The sampler shows the alias closest to zero: f_alias = |f − k·fₛ|, where k·fₛ is the whole multiple of fₛ nearest to f. It always lies between 0 and fₛ/2.
Example: f = 23 Hz, fₛ = 10 Hz. The nearest multiple is 20 Hz, so f_alias = |23 − 20| = 3 Hz.
Wagon wheel: N identical spokes at r rev/s make a pattern repeating at N·r Hz. Filmed at F fps, it appears to turn at (signed alias of N·r at F) ÷ N rev/s. A negative alias means it seems to turn backwards.
Common mix-ups
- Aliasing is a kind of random noise.
✓ It is a deterministic false signal, perfectly repeatable, which is what makes it so convincing. - You can remove aliasing with a digital filter afterwards.
✓ Once folded, the alias sits inside the band you want. It must be filtered out before sampling.
3.2 Predicting the impostor
A 900 Hz whistle is recorded at 1 kHz. Play it back and you hear a low hum instead. Exactly what pitch, and why?
Folding
Picture the frequency axis folded like a paper fan at every multiple of fs/2. Any frequency lands somewhere in the first panel, 0 to fs/2. That landing place is the alias. With fs = 100 Hz: 30, 70, 130 and 170 Hz all land on 30 Hz.
Negative aliases and backwards wheels
A film camera at 24 frames/s filming a wheel turning 23 times per second sees it advance 23/24 of a turn per frame: indistinguishable from going back 1/24 of a turn. f − fs = −1 Hz: the wheel seems to turn backwards once per second. For a rotation the sign matters; for a cosine on a graph it does not.
Using the formula as a detective
If a log shows a mystery 30 Hz wobble and you sample at 100 Hz, candidates are 30, 70, 130, 170 Hz… Check the machine for anything at those frequencies, like a motor at 4200 rpm (70 Hz). If you find one, you have caught an alias, and the fix is filtering before sampling or sampling faster.
Derivation: The exact alias formula
Samples of x(t) = cos(2πft) are x[n] = cos(2π·(f/fs)·n).
Adding a whole number of cycles per sample changes nothing: cos(2π(f − k·fs)n/fs) = cos(2πfn/fs − 2πkn) = x[n] for every integer k.
Cosine is even, so a negative frequency gives the same samples as its magnitude: cos(−θ) = cos θ.
Choose k = round(f/fs) so that f − k·fs lies between −fs/2 and +fs/2.
Therefore f_alias = |f − round(f/fs)·fs|, always between 0 and fs/2. (For sine waves the sign of f − k·fs also flips the phase: that is the 'backwards' wheel.)
Common mix-ups
- The alias is always fs − f.
✓ Only when f is between fs/2 and fs. In general subtract the nearest whole multiple of fs. - Software can tell an alias from a real low frequency afterwards.
✓ The samples are identical. Only knowledge from outside (a filter, a faster sensor) can tell them apart.
3.3 Stopping aliases before they start
Every audio interface and many sensor boards put a filter in front of the ADC. If the ADC is digital, why does it need an analog guard?
Filter first, sample second
An anti-aliasing filter is a low-pass filter before the ADC that shrinks everything above fs/2 enough that its aliases are buried below the noise floor. Digital filtering after sampling cannot help: by then the alias sits at an allowed frequency and looks exactly like real signal.
The RC low-pass
A resistor in series and a capacitor to ground form the simplest low-pass. Its cut-off fc = 1/(2πRC) is where the output falls to 1/√2 (−3 dB). Above fc the gain falls roughly as fc/f: −20 dB per decade. With R = 1.6 kΩ and C = 100 nF, fc ≈ 995 Hz.
Oversample, then decimate
Real filters roll off gradually. A common trick: sample much faster than needed (oversample), so a gentle analog filter suffices, then use a sharp digital low-pass and keep every Mth sample (decimation). Delta-sigma audio ADCs work this way internally.
Common mix-ups
- The cut-off frequency is where the filter blocks everything.
✓ At fc the gain is still 0.707. A first-order filter only reaches one tenth at ten times fc.
3.4 Choosing a sample rate for a real robot
Sampling at 10 kHz is safe but drains the battery. Sampling at 20 Hz is cheap but might lie. How do you pick?
Start from the frequencies
List what the signal contains: the frequencies you want (the tilt, the heartbeat, the wall getting closer) and the ones you don't (motor vibration, mains hum at 50 or 60 Hz, switching noise). The sample rate must exceed twice the highest frequency that reaches the sampler, wanted or not.
Filter, then sample
An analogue low-pass filter in front of the converter cuts unwanted high frequencies so they can't alias. A common digital pattern is oversample, filter, decimate: sample fast, low-pass filter digitally, then keep every Mth sample. The filter must run on the fast samples, before you throw any away.
Count the cost
Data rate = channels × sample rate × bytes per sample. Six 16-bit channels at 1 kHz is 12 kB/s, about 43 MB an hour. Processing cost scales the same way. Control loops also need the delay between sample and action to be small compared with the system's response time.
Common mix-ups
- Choose the sample rate from the signal you want only.
✓ Everything that reaches the sampler counts, including vibration and interference you don't want. - Keeping every 10th sample is a harmless way to save memory.
✓ It is sampling at a tenth of the rate and aliases unless you filter first.
Open the full lesson: Choosing a sample rate for a real robot →
Worked examples
Aliasing: when samples tell lies: example 1
A 130 Hz vibration is sampled at 100 Hz. What frequency appears?
Solution
Nearest multiple of 100 Hz to 130 Hz is 100 Hz; |130 − 100| = 30 Hz. The log shows a convincing 30 Hz vibration that does not exist.
Aliasing: when samples tell lies: example 2
A 5-spoke wheel turns at 4.6 rev/s, filmed at 24 fps. What do you see?
Solution
Pattern frequency 5 × 4.6 = 23 Hz. Signed alias: 23 − 24 = −1 Hz. Apparent speed −1 ÷ 5 = −0.2 rev/s: slowly backwards.
Predicting the impostor: example 1
A 4200 rpm fan is sampled by a 100 Hz sensor. What vibration frequency appears in the data?
Solution
4200 rpm = 70 Hz. k = round(70/100) = 1, f_alias = |70 − 100| = 30 Hz.
Stopping aliases before they start: example 1
Choose C for an RC anti-aliasing filter with R = 10 kΩ and fc ≈ 160 Hz.
Solution
C = 1/(2π·R·fc) = 1/(2π × 10⁴ × 160) ≈ 99.5 nF, so a standard 100 nF part.
Choosing a sample rate for a real robot: example 1
Mains hum at 50 Hz leaks into a sensor sampled at 52 Hz. What appears?
Solution
|50 − 52| = 2 Hz: a slow, convincing 2 Hz wobble. Either filter the hum out before sampling, sample far faster (e.g. 1 kHz) and filter digitally, or choose fₛ so the hum is easy to spot and remove.
Interactive figures
Interactive figure (online). Description: The wagon-wheel explorer shows six consecutive film frames of a spoked wheel. With 6 spokes at 24 fps: at 4 rev/s every frame looks identical (stand-still); at 3.8 rev/s the spokes step slightly backwards each frame; at 1 rev/s they step forwards by 15 degrees per frame. The readout gives the pattern frequency, the alias and the apparent speed.
Interactive figure (online). Description: With fs = 10 Hz in the sampler: 3 Hz shows as 3 Hz, 7 Hz as 3 Hz, 13 Hz as 3 Hz and 17 Hz as 3 Hz, because each is 3 Hz away from a multiple of 10 Hz. 23 Hz also shows as 3 Hz.
Laboratory
Everything runs in your browser. No kit, nothing mains-powered. Simulations are simplified educational models.
Studio
Code Lab
Write alias_of(f, fs) and check it against sampled sinusoids at five frequencies above fs / 2.
Open Code Lab →Simulation OS experiment
Simulation OS: Washing-machine spin cycle
Find a drum speed at which a slow sampler would report a misleadingly slow vibration.
Open Simulation OS: Washing-machine spin cycle →
Guided practice
Answers are checked on the server; wrong answers get a hint and another try. Signed in, solved items also count towards the source lesson.
- A 70 Hz signal is sampled at 50 Hz. What is the alias frequency, in Hz? (Hz)
- An 8-spoke wheel is filmed at 24 fps. What is the slowest non-zero speed at which it appears perfectly still, in rev/s? (rev/s)
- Your logged vibration shows a 30 Hz peak you suspect is an alias. What is the most convincing test?
- Average more data
- Change the sample rate: a real 30 Hz stays at 30 Hz, an alias moves
- Apply a digital low-pass filter at 40 Hz
- A 900 Hz whistle is sampled at 1 kHz. What alias frequency, in Hz, appears? (Hz)
- Sampled at fs = 100 Hz, which frequency gives exactly the same samples as a 20 Hz cosine?
- 40 Hz
- 80 Hz
- 120 Hz
- Both 80 Hz and 120 Hz
- An RC low-pass has R = 1.6 kΩ and C = 100 nF. What is fc = 1/(2πRC), in Hz (nearest 5 Hz)? (Hz)
- Why can't a digital filter after the ADC remove aliases?
- Digital filters are too slow
- After sampling, an alias is indistinguishable from a real signal at that frequency
- Digital filters only work on audio
- It can, if it has enough taps
- Mains hum at 50 Hz is sampled at 45 Hz. At what frequency does it appear, in Hz? (Hz)
Engineering applications
Rolling shutters
Phone cameras read the image row by row, so fast propellers and guitar strings appear bent or frozen. It is aliasing in space and time, and no editing afterwards can recover the true motion.
Anti-aliasing filters
Data acquisition boards put an analogue low-pass filter in front of every ADC. It removes frequencies the sampler cannot represent before they can fold down and pollute the measurement.
Watch
Optional verified videos. Nothing loads from YouTube until you press play.
- Why do car wheels spin backwards on video? (Javier Mota)
- Why Do Cameras Do This? | Rolling Shutter Explained - Smarter Every Day 172 (SmarterEveryDay)
Chapter summary
- Frequencies above fs / 2 fold back and appear as lower alias frequencies.
- Alias = |f − round(f / fs) × fs|; for 900 Hz at 1000 Hz it is 100 Hz.
- Aliased samples are identical to a real low-frequency signal, so the damage cannot be undone digitally.
- Prevent aliasing with an analogue low-pass filter before sampling, plus a higher sample rate.
Glossary
- Sampling and aliasing
- Sampling measures a signal at regular intervals. Any frequency above half the sample rate, the Nyquist frequency, is indistinguishable from a lower 'alias' frequency.
- Low-pass filter (moving average and EMA)
- A low-pass filter lets slow changes through and attenuates fast ones. In firmware the simplest are the moving average and the exponential moving average.
- Frequency and period
- Frequency is how many cycles happen per second; the period is the time for one cycle. Each is the reciprocal of the other.
Definitions from the Field Guide.
Project: Catch an alias
Simulate a vibration sensor that sees a 120 Hz motor whine but samples at only 100 Hz. Predict the alias, show it in a plot of the samples, then design the cheapest fix: a filter cut-off, a new sample rate or both. Justify your choice with numbers.
Deliverables
- The predicted alias frequency with working
- A plot showing the alias in the samples
- The chosen fix with its cut-off or rate
Keep your work in your Engineering Journal; it stays private unless you choose to share it.
References
- Alan V. Oppenheim and Ronald W. Schafer (2010). Discrete-Time Signal Processing, 3rd edition. Pearson.
- Richard G. Lyons (2010). Understanding Digital Signal Processing, 3rd edition. Prentice Hall.
- Harry Nyquist (1928). "Certain Topics in Telegraph Transmission Theory". Transactions of the American Institute of Electrical Engineers 47(2), 617–644.
Publication record
- Version
- 1
- Status
- Technically checked (automated checks only)
- Technical review
- Automated checks only, last run 2026-11-29. No human, educator or mentor review is claimed.src/content/textbooks/textbooks.test.ts: schema, every lesson, diagram, practice item, video, Field Guide entry, lab and reference resolves; figure numbers recomputed; no practice answers in client payloads.
- Written by
- Compiled and written by the Tactiverge team with AI assistance, from Tactiverge School lessons that were themselves written with AI assistance.
- Licence
- All rights reserved by the founders unless a licence is approved.
- Corrections
- None recorded yet.Spotted a mistake? Use “Report a problem” on any chapter, or see the corrections page.