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 falias=∣fin−kfs∣f_{alias}=|f_{in}-kf_s|falias​=∣fin​−kfs​∣ makes 80, 120, and 180 Hz inputs all appear at 20 Hz.

Once those tones share the same samples, software cannot identify the original; an analogue filter must attenuate them before conversion.

Let Eddie connect sample period, Nyquist, fold order, alias frequency, and the analogue-filter boundary.

Numbers to remember

100 HzSample rate
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.
  • A later digital filter cannot restore that lost fact.

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)

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.
  • Once a component has aliased, no amount of later digital processing can separate it from a genuine signal at the same apparent frequency — the information is gone.
  • The path must return to the analogue edge.
iotclass.org

Major section

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

Once sampled, those points cannot show which of the two waves made them.

  • The release contract should therefore name the accepted signal band, the credible interference band, the chosen sample rate, and the analog filter that attenuates everything that could fold into the measurement band.
  • Sampling exactly at 2 × fmax is not enough in practice; leave margin.
  • The ceiling of what the data can represent.
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).
  • The dangerous part is what happens to frequencies above fs / 2: they do not simply disappear.
  • Once sampled, those points cannot show which of the two waves made them.
iotclass.org

Retrieval practice

Recall check 1 of 5

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

Q1An ADC samples at fs = 1 kHz. What is its Nyquist frequency (the theoretical upper band edge before filter margin)?

A1 kHz, the full ADC sample rate rather than half
B2 kHz, twice the ADC sample rate rather than half
C500 Hz, half the ADC's 1 kHz sample rate
DNo upper band edge when the ADC resolution is high
Show answer

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

iotclass.org

Retrieval practice

Recall check 2 of 5

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?

A50 Hz, matching the analog powerline input at the ADC
B30 Hz, because 50 Hz folds to |50 − 80| Hz
C40 Hz, because the aliases of these signals all land at the Nyquist limit.
DNo tone, because out-of-band powerline energy is removed before sampling.
Show answer

Answer: B 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 5

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

Q3A useful signal ends near the filter passband edge. Why sample faster than the bare Nyquist limit?

ATo remove already folded tones with a digital filter after ADC conversion.
BTo put the anti-alias filter after the ADC rather than ahead of it.
CTo make a physical analog filter roll off instantly at the passband edge.
DTo leave an analog filter transition band before unwanted tones fold into band.
Show answer

Answer: D More spacing lets a real analog filter attenuate unwanted tones before sampling.

iotclass.org

Retrieval practice

Recall check 4 of 5

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

Q4A board has an ADC input and a DAC output. Which filter placement has the right job?

APut both filters after the ADC and expect them to undo already aliased samples.
BPut the DAC output filter before the ADC and omit input anti-alias filtering.
CPut analog low-pass filtering before the ADC and reconstruction filtering after the DAC.
DPut a digital filter after the DAC to prevent tones from aliasing at the ADC.
Show answer

Answer: C Input protection and output reconstruction sit on different sides of conversion.

iotclass.org

Retrieval practice

Recall check 5 of 5

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

Q5An out-of-band motor tone reaches the ADC, and a lower-frequency artifact appears in the samples. The artifact disappears when an analog low-pass filter is added before the ADC. What phenomenon produced it?

AWeak digital filtering: a steeper filter after sampling will remove the tone.
BAliasing: an out-of-band tone folded into the sampled measurement band.
CLow ADC resolution: adding converter bits will remove the folded tone.
DMissing DAC reconstruction: an output filter will fix the ADC input artifact.
Show answer

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

iotclass.org

Print reference

Answers

Answer key.

  1. C · The Nyquist frequency is fs / 2 = 500 Hz; anything above it folds back and aliases.
  2. B · 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. D · More spacing lets a real analog filter attenuate unwanted tones before sampling.
  4. C · Input protection and output reconstruction sit on different sides of conversion.
  5. B · Aliasing is irreversible in the digital domain, so no digital filter helps.
iotclass.org