FísicaEterna
← Back to Concepts
SignalsIntermediate

Aliasing: the frequency nobody played

Recording a note badly does not give you a weaker or dirtier note: it gives you a different, lower note that nobody played. It is the same reason wheels spin backwards in films.

What you are looking at

  1. The blue curve is the real signal and never changes throughout. The gold dots are the moments it gets looked at.
  2. When the red curve appears, notice that it passes through every dot: it fits the samples exactly as well as the blue one does.
  3. The limit sits at the top right. The moment the sampling rate crosses it is the exact moment the false wave is born.

01Digitising means looking every so often

Turning sound into numbers is simpler than it sounds: you look at the signal every so often and write down the value. Nothing more.

Whatever the signal did between one look and the next is recorded nowhere. And that is where the whole problem lives.

02There is a threshold, and it is exact

As long as you look often enough, the dots are enough to rebuild the wave without losing anything. But the threshold is not a matter of judgement: you must sample at more than twice the highest frequency you want to capture.

This is the Nyquist limit, and it is a theorem, not an engineering rule of thumb. Above it you recover the whole signal; below it you do not.

03Below the limit you do not lose quality: you invent a signal

This is the part that is hard to believe. The very same dots, with none missing, now describe a different, slower wave, which fits the samples just as well and does not exist in the original signal.

It is not noise and it is not distortion. It is a new frequency, clean and perfectly predictable: it comes from folding the real frequency against the sampling rate. In the animation the red curve is drawn from that calculation, which is why it passes exactly through every dot.

A badly sampled high note does not sound muffled: it sounds low. It is in disguise.

04The fix is not to look faster

There is always a speed ceiling, so the real way out is different: remove beforehand whatever you will not be able to follow.

Every analogue-to-digital converter carries a filter — the anti-aliasing filter — that strips out high frequencies before sampling. If it did not, those frequencies would not vanish: they would come back disguised as low ones, in the middle of the music.

f_alias = | f − round(f / f_s) · f_s |The false frequency is the distance from the real one to the nearest multiple of the sampling rate

Where this is used

The 44,100 Hz of a CD

Human hearing reaches about 20,000 Hz. Twice that is 40,000, and the rest is margin for the filter to work in. Audio’s oddest number is simply Nyquist with headroom.

Wheels that turn backwards

A spoke that almost completes a full turn between frames looks as if it slipped back a little. At 24 frames per second, film cannot keep up with them.

The moiré on a striped shirt on TV

When the stripes are finer than the camera’s pixel grid, coloured bands appear that are not on the shirt. It is aliasing, but in space instead of time.

Jagged edges in a video game

Graphics cards’ "anti-aliasing" attacks the same problem: the screen samples continuous geometry onto a finite grid, and diagonal edges come out as stairsteps.

Explaining it to a child

The idea, in plain wordsIf you watch something spinning very fast but only glance at it now and then, your eyes can make you believe it is going slowly, or even backwards. Your eyes are not failing: there are simply not enough glances.

Try it together
  1. Switch a fan on and film it with a phone. Watch the video afterwards: the blades often look slow, frozen, or turning backwards.
  2. Look at the same fan with your eyes, without the phone. It looks blurry and fast, as it should.
  3. Without a fan: have one person wave a hand quickly side to side while the other blinks rapidly. The hand seems to jump rather than move.

The question to leave them withIf the camera looks 30 times a second and the blade turns 30 times a second, what position will it always be caught in?

For the classroom

Ten minutes with the animation, ready to take into a room. Free under CC BY 4.0, like everything else here.

Who it is for

From age 15. Does not need waves: it needs knowing what a frequency is.

What they will be able to do afterwards

The student explains why a wheel can look like it is turning backwards, and what condition stops that happening.

The activity
  1. Show any video of a car wheel on the motorway —there are thousands— and ask which way it turns. Let them argue. There is never agreement.
  2. Ask: "is the car going backwards?" Obviously not. So something we are seeing is not what is happening.
  3. Play the animation. The key is how many times per second you look, compared with how many times per second it turns.
  4. Close with the number: you have to sample more than twice as fast as what you want to see. Below that, what appears is a frequency that does not exist.
Exit questions
  1. A video records at 24 frames per second. What is the fastest frequency it can truly capture?

    Answer: Less than 12 turns per second. Above that what you see is a ghost: a frequency invented by the sampling, not the real one.

  2. Why is digital audio sampled 44,100 times a second?

    Answer: Because human hearing reaches about 20,000 Hz and you must sample more than twice that. 44,100 leaves margin above 40,000 for the filter.

  3. If the wheel turns at exactly the frequency you record at, what do you see?

    Answer: A completely still wheel, even though it is spinning flat out. Every frame catches it in the same position.

Watch out for this

The first explanation offered is always "it is an optical illusion" or "the camera is faulty". It is neither: the camera works perfectly and so does the eye. The problem is that you are looking at intervals, and that is enough.

FísicaEterna classroom guide · CC BY 4.0 · fisicaeterna.cl

Take it with you

The animation is yours to use: in a class, in a video, in a course. Just credit the source.

Embed it on your site

Copy this code and paste it wherever you want it to appear.

The code behind it

It is written in Remotion, which renders video by writing React. The bar and the number are not drawn next to the figure: they come out of the calculation on the same geometry you are watching. If the drawing lies, the number lies with it.

Aliasing.tsx · Remotion

Licence

This animation is under CC BY 4.0: you may copy, redistribute, adapt and use it commercially, as long as you credit the source.

Suggested attributionAliasing: the frequency nobody played — FísicaEterna (fisicaeterna.cl), CC BY 4.0

CC BY 4.0