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?
About 40 min · 3 goals · Checked by automated tests
1.Why should I care?
Aliasing is not noise you can average away: it is a false signal that looks completely real. A vibration sensor sampled too slowly can report a gentle wobble when the machine is shaking itself apart. Knowing how to predict an alias is how engineers avoid trusting it.
- ◇ Explain aliasing as a high frequency appearing as a lower one after sampling.
- ◇ Calculate the apparent (alias) frequency |f − k·fₛ| for a given f and fₛ.
- ◇ Explain the wagon-wheel effect and name ways to prevent aliasing.
2.Watch
→ Watch the propeller turn into curved shapes. The camera samples the picture one line at a time, so different parts of the image are taken at different moments: another way that sampling creates things that are not really there.
Slow-motion footage of propellers turned into strange shapes by a camera that samples the picture line by line: a vivid sampling artefact.
Length: see YouTube · captions on YouTube · source
Nothing loads from YouTube until you press play.
The video is optional: everything you need is also in the lesson text and the interactive.
3.Predict
A 9 Hz signal is sampled at 10 Hz. What frequency do the samples seem to show?
Guess first. Being wrong here is how the surprise works.
4.Discover
Set 6 spokes at 24 fps. Find a wheel speed where the wheel seems to stand still, one where it creeps forwards and one where it creeps backwards. Step frame by frame. Then use the readout to predict the next 'stand still' speed before you find it.
Loading the interactive…
Can't use the interactive? Read a description instead
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.
5.Checkpoint: guided practice
Check what you just discovered before going on. Hints appear after a wrong answer.
Practice 1
A 70 Hz signal is sampled at 50 Hz. What is the alias frequency, in Hz?
6.Understand
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.
Explain it another way
A clock's second hand photographed once every 59 seconds seems to tick slowly backwards round the dial. The camera saw it at the 'wrong' moments.
Sampling maps frequency f to the folded frequency f_a = |f − fₛ·round(f/fₛ)| ∈ [0, fₛ/2]. The spectrum of the sampled signal is the original spectrum repeated every fₛ; overlap of these copies is aliasing.
Signed alias a = f − fₛ·round(f/fₛ) ∈ (−fₛ/2, fₛ/2]. For the wheel, apparent rev/s = a(N·r, F)/N. Stand-still happens whenever N·r is a whole multiple of F: r = k·F/N.
Safety standards for rotating machinery warn about the stroboscopic effect, where flickering lights make a spinning saw blade or lathe chuck appear stationary.
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.
Worked example 1
A 130 Hz vibration is sampled at 100 Hz. What frequency appears?
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.
Worked example 2
A 5-spoke wheel turns at 4.6 rev/s, filmed at 24 fps. What do you see?
Pattern frequency 5 × 4.6 = 23 Hz. Signed alias: 23 − 24 = −1 Hz. Apparent speed −1 ÷ 5 = −0.2 rev/s: slowly 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.
7.Practice on your own
Practice, not a test. Wrong answers get a hint and another try.
Practice 2 · a fresh version every time
A 46 Hz vibration is sampled at 20 Hz with no anti-aliasing filter. At what frequency does it appear in the samples, in Hz?
Practice 3 · a fresh version every time
A 55 Hz vibration is sampled at 50 Hz with no anti-aliasing filter. At what frequency does it appear in the samples, in Hz?
Practice 4
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?
Practice 5
Your logged vibration shows a 30 Hz peak you suspect is an alias. What is the most convincing test?
8.Apply it
A drone's motors spin at 6000 rpm and its flight controller samples the gyro at 1 kHz without an anti-aliasing filter. Compute the motor frequency, check whether it aliases, and predict the false frequency the controller would 'see' if the sample rate dropped to 90 Hz.
9.Reflect
Concepts: Sampling rate and aliasing · Signals: amplitude, frequency and period