Lite / Intelligent Robotic Systems / Week 22
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?
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.
Predict
A 9 Hz signal is sampled at 10 Hz. What frequency do the samples seem to show?
- 9 Hz
- 1 Hz
- 19 Hz
- 0 Hz
Guess first, then reveal
Each sample lands 0.9 of a cycle later, which looks exactly like going back by 0.1 of a cycle: a slow 1 Hz wave (running backwards). The alias is |9 − 10| = 1 Hz.
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.
What the interactive shows (text version)
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.
Watch (optional)
Watch for: 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.
“Why Do Cameras Do This? | Rolling Shutter Explained - Smarter Every Day 172” by SmarterEveryDay (opens YouTube; streaming video uses a lot of data)
The video is optional. Everything you need is in this lesson's text.
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
Intuitive
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.
Technical
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.
Mathematical
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.
Applied
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.
Practice
Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.
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.
Reflect
Why is an alias more dangerous than noise of the same size?
Write your answer on paper or in your own notes. Lite never stores what you write.