Skip to content
Tactiverge

School/□ Systems Engineer/Week 20

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?

About 35 min · 3 goals · Checked by automated tests

1.Why should I care?

When a sensor reading shows an oscillation nobody can explain, the first question an experienced engineer asks is: could this be an alias? Being able to compute the exact impostor frequency lets you test that hypothesis in seconds.

  • ◇ Derive the alias formula f_alias = |f − k·fs| with k the integer nearest f/fs.
  • ◇ Predict the apparent frequency of any undersampled sinusoid.
  • ◇ Explain the backwards-wheel effect as a negative alias.

2.Discover

Fix fs = 10 Hz. Step f through 3, 7, 13 and 17 Hz and write down the alias each time. What pattern do you see? Predict f = 23 Hz before you try it.

Loading the interactive…

Can't use the interactive? Read a description instead

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.

3.Checkpoint: guided practice

Check what you just discovered before going on. Hints appear after a wrong answer.

Practice 1

A 900 Hz whistle is sampled at 1 kHz. What alias frequency, in Hz, appears?

Hz

Practice 2

Sampled at fs = 100 Hz, which frequency gives exactly the same samples as a 20 Hz cosine?

4.Predict

A 70 Hz sinusoid is sampled at 100 Hz. At what frequency does it appear?

Guess first. Being wrong here is how the surprise works.

5.Understand

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.

Explain it another way

Frequencies above Nyquist bounce off a wall at fs/2 and come back down, like a ball bouncing between the floor (0) and a ceiling (fs/2).

Derivation: The exact alias formula
  1. Samples of x(t) = cos(2πft) are x[n] = cos(2π·(f/fs)·n).

  2. 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.

  3. Cosine is even, so a negative frequency gives the same samples as its magnitude: cos(−θ) = cos θ.

  4. Choose k = round(f/fs) so that f − k·fs lies between −fs/2 and +fs/2.

  5. 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.)

Worked example 1

A 4200 rpm fan is sampled by a 100 Hz sensor. What vibration frequency appears in the data?

4200 rpm = 70 Hz. k = round(70/100) = 1, f_alias = |70 − 100| = 30 Hz.

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.

6.Practice on your own

Practice, not a test. Wrong answers get a hint and another try.

Practice 3 · a fresh version every time

A 330 Hz sinusoid is sampled at fs = 250 Hz. At what frequency (between 0 and fs/2) does it appear in the samples, in hertz?

Hz

Practice 4

A wheel turns 23 times a second and is filmed at 24 frames per second. How many times per second does it appear to turn (use a negative number for backwards)?

rev/s

Practice 5

A 1730 Hz tone is sampled at 500 Hz. What alias, in Hz?

Hz

7.Apply it

Your rover's 50 Hz IMU log shows a 6 Hz wobble, but the wheels spin at about 44 Hz. Is the wobble plausibly an alias of the wheels? Show the calculation and propose two fixes.

8.Reflect

Concepts: Sampling rate and aliasing