Electronics & Circuits · Study deck

Aliasing and Anti-Alias Filter Contracts

Picture a motor sensor that should watch slow bearing motion.

Voltage Vera is your guide for this deck.

analogdigitalaliasing
Voltage Vera, the module guide, in a scene from this chapter.
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • Compute the Nyquist frequency and determine whether an input tone can be represented honestly.
  • Calculate where an out-of-band tone folds when sampled at a chosen rate.
  • Explain why aliasing is irreversible after the ADC and must be prevented before sampling.
  • Place analog anti-alias filtering before the ADC and leave transition-band margin through oversampling.
iotclass.org

Major section

Start Simple

A much faster electrical buzz reaches the same input.

  • If the device takes too few samples, that buzz can appear as a slow wave and trigger the wrong alarm.
  • The design team must block the unwanted part before it becomes data.
  • Feed known tones below, near, and above the chosen limit.
  • This opening does not design every filter or converter.
iotclass.org

Major section

Phoebe's Field Notes: Why the Alias Must Be Stopped in Hardware

The mathematical gist.: At the chapter's 100 Hz sample rate, Nyquist is 50 Hz and each sample is 10.0 ms apart.

  • The fold rule f_{alias}=|f_{in}-kf_s| makes 80, 120, and 180 Hz inputs all appear at 20 Hz.

Numbers to remember

50 HzNyquist is 50 Hz
10.0 mseach sample is 10.0 ms apart.
iotclass.org

Major section

Overview: Above Half the Sample Rate, Frequencies Fold

The Nyquist-Shannon theorem sets one hard rule: to capture a signal whose highest frequency is fmax, you must sample at fs > 2 × fmax (strictly greater).

  • The Nyquist frequency is fs / 2 — the highest frequency your sampled data can honestly represent.
  • The ceiling of what the data can represent.

Why it matters

A later dashboard threshold is not a correction, because it only sees the false low-frequency pattern after sampling has already made it look real.

Aliasing in sampling showing a high-frequency input wave, sparse sample points, and an apparent lower-frequency waveform reconstructed from those samples.
Aliasing in sampling showing a high-frequency input wave, sparse sample points, and an apparent lower-frequency waveform reconstructed from those samples.
iotclass.org

Major section

Overview: Above Half the Sample Rate, Frequencies Fold (continued)

After sampling, those points cannot reveal which curve produced them, so a digital filter cannot recover the lost distinction.

  • The dangerous part is what happens to frequencies above fs / 2: they do not simply disappear.
  • They fold back (alias) into the 0 – fs/2 band and appear as lower-frequency signals that are indistinguishable from real ones.
  • Sampling exactly at 2 × fmax is not enough in practice; leave margin.
iotclass.org

Major section

Practitioner: Computing Where a Tone Lands

A single tone at frequency fin sampled at fs appears in the data at f_alias = | fin − fs × round(fin / fs) | — that is, it folds into the 0 – fs/2 band.

  • Every frequency that is a mirror image around a multiple of fs/2 lands on the same apparent frequency.
  • Worked example — 50 Hz mains hum.: You sample a slow sensor at fs = 80 Hz, so the Nyquist frequency is 40 Hz.
  • Ambient 50 Hz powerline interference is above 40 Hz, so it aliases to |50 − 80| = 30 Hz.
  • Practitioner evidence should pair each alias calculation with an action.
iotclass.org

Major section

Practitioner: Computing Where a Tone Lands (continued)

Your data now contains a phantom 30 Hz wander that looks exactly like a real 30 Hz signal — and a digital filter cannot tell them apart.

  • A dangerous alias is not only "above Nyquist"; it is "above Nyquist and landing inside a frequency band the product interprets as meaningful behavior.".
  • The fix must happen before sampling — an analog anti-alias low-pass filter, or a higher sample rate.
  • If the alias lands outside the decision band, document why it is harmless or still attenuated.
iotclass.org

Major section

Under the Hood: Why a High Sample Rate Alone Is Not Enough

The theorem requires fs > 2 × fmax, so engineers leave headroom — often sampling at 5× to 10× the signal bandwidth.

  • Second, the anti-alias filter must be analog and physically before the ADC, because once aliasing has happened it is baked into the samples.
  • A real low-pass filter has a finite roll-off, not a brick wall, so it needs a transition band between the signal bandwidth and fs/2 to attenuate out-of-band energy.
  • The filter contract should state more than a component value.
iotclass.org

Major section

Under the Hood: Why a High Sample Rate Alone Is Not Enough (continued)

A first-order RC filter rolls off slowly, so it may need a much higher sample rate than the ideal Nyquist line suggests.

  • Under the hood, the ADC input path also has loading and acquisition limits.
  • A large filter resistor can interact with the ADC sample-and-hold capacitor; a weak op-amp can settle too slowly; a multiplexed input can carry charge from the previous channel.
  • Those effects do not change the Nyquist theorem, but they can make the anti-alias filter fail in hardware.
iotclass.org

Major section

Release Checklist

The anti-alias filter is analog and physically before the ADC input.

  • The highest meaningful signal frequency is stated, not guessed from the desired reporting interval.
  • The selected sample rate puts fs / 2 safely above the signal bandwidth and leaves transition-band room for a real analog filter.
  • Reconstruction filtering is reviewed separately for DAC or PWM output paths.

Key terms

Digital filtering and averaging
Digital filtering and averaging are documented as post-sampling cleanup, not as an alias-prevention substitute.
Oversampling cost
Oversampling cost is budgeted in ADC current, CPU time, buffer size, storage, and radio payload volume.
iotclass.org

Deck summary

Key takeaways

A much faster electrical buzz reaches the same input.

  • The mathematical gist.: At the chapter's 100 Hz sample rate, Nyquist is 50 Hz and each sample is 10.0 ms apart.
  • The Nyquist-Shannon theorem sets one hard rule: to capture a signal whose highest frequency is fmax, you must sample at fs > 2 × fmax (strictly greater).
  • After sampling, those points cannot reveal which curve produced them, so a digital filter cannot recover the lost distinction.
  • Your data now contains a phantom 30 Hz wander that looks exactly like a real 30 Hz signal — and a digital filter cannot tell them apart.
iotclass.org

Retrieval practice

Recall check 1 of 3

Voltage Vera says: answer from memory, then check your reasoning.

Q1An ADC samples at fs = 1 kHz. What is the highest signal frequency the resulting data can faithfully represent?

A500 Hz, the Nyquist frequency (fs / 2).
B1 kHz, the full sample rate.
C2 kHz, twice the sample rate.
DThere is no limit if the resolution is high enough.
Show answer

Answer: A The Nyquist frequency is fs / 2 = 500 Hz; anything above it folds back and aliases.

iotclass.org

Retrieval practice

Recall check 2 of 3

Voltage Vera says: answer from memory, then check your reasoning.

Q2A sensor is sampled at fs = 80 Hz. A 50 Hz powerline component is present at the input. At what frequency does it appear in the sampled data?

A30 Hz, because it folds to |50 - 80| = 30 Hz
B50 Hz, matching the physical powerline component at the ADC input.
C40 Hz, because everything collapses to the Nyquist frequency.
DIt disappears, because it is above the Nyquist frequency.
Show answer

Answer: A 50 Hz exceeds the 40 Hz Nyquist frequency, so it aliases to |50 - 80| = 30 Hz and masquerades as a real 30 Hz signal.

iotclass.org

Retrieval practice

Recall check 3 of 3

Voltage Vera says: answer from memory, then check your reasoning.

Q3A low-frequency wander keeps appearing in your data. Adding more digital filtering never removes it. What is happening, and what is the correct fix?

AIt is an alias of an out-of-band component; once folded it is indistinguishable from a real in-band signal.
BThe digital filter is simply too weak; a steeper digital filter will eventually remove it.
CThe ADC resolution is too low; adding bits will remove the wander.
DThe reconstruction filter after the DAC is missing; adding it fixes the input aliasing.
Show answer

Answer: A Aliasing is irreversible in the digital domain, so no digital filter helps.

iotclass.org

Print reference

Answers

Answer key.

  1. A · The Nyquist frequency is fs / 2 = 500 Hz; anything above it folds back and aliases.
  2. A · 50 Hz exceeds the 40 Hz Nyquist frequency, so it aliases to |50 - 80| = 30 Hz and masquerades as a real 30 Hz signal.
  3. A · Aliasing is irreversible in the digital domain, so no digital filter helps.
iotclass.org