Aliasing Filter Calculation Audit

Aliasing Filter Calculation Audit

Ada re-derives this chapter’s own numbers step by step, at full precision

foundations
math-foundations
calculation-audit
electronics
beginner
Ada ADA · CALCULATION AUDIT

Aliasing Filter Calculation Audit

Sampling a slow sensor at 80 Hz puts Nyquist at 40 Hz, so ambient 50 Hz mains hum cannot be represented honestly — it folds to a phantom 30 Hz wander that a digital filter can never separate from a real signal. The reflex is to clean that wander up in software afterwards. This audit re-derives the fold arithmetic and asks whether a 30 Hz alias is a software problem at all, or a sample-rate and analog-filter decision that must happen before the ADC.

Companion to the chapter Aliasing and Anti-Alias Filter Contracts — every number here comes from that chapter.

Ada: Aliasing checks are useful only when the numbers expose both the frequency ceiling and the false frequency that software will see. Carry the sample-rate arithmetic through before deciding whether filtering or faster sampling is the real fix.

See the relationship before changing it

The figure reads from left to right. The blue card is input frequency. The middle card applies this page's rule. The green card is observed alias. Walk the arrows once: set the input, apply the rule, then read the result with its unit.

The retained audit below checks several chapter fixtures. This model keeps those stated values fixed and changes only input frequency, so the numeric fixture does not switch without explanation.

Input frequency changes observed alias An input card leads through the rule alias = |input - 80 x round(input / 80)| to the observed alias result. INPUT PAGE INPUT APPLY THE RULE predict calculate check units OUTPUT RESULT
Walk the arrows. Once sampled, a folded tone is indistinguishable from a real signal at the alias frequency.

Derive the baseline in four named moves

  1. 1

    Name the input. The chapter baseline is 50 Hz.

  2. 2

    Name the relationship. alias = |input - 80 x round(input / 80)|

  3. 3

    Substitute with units. |50 - 80 x round(50 / 80)| = 30 Hz

  4. 4

    Read the result. Keep the unit beside the value. Use it only inside the technical boundary on this page.

Predict, then change input frequency

Try Predict the direction of alias = |input - 80 x round(input / 80)|. Test another input frequency, then compare observed alias.

50 Hz
Chapter baseline
Observed alias

Observe Once sampled, a folded tone is indistinguishable from a real signal at the alias frequency. Reset input frequency to 50 and compare observed alias.

Explain Once sampled, a folded tone is indistinguishable from a real signal at the alias frequency.

Check yourself

What should you do before trusting a moved-control result?
Answer: Predict its direction, apply the shown relationship, keep the units, and reset to the worked baseline.
What does this small model leave out?
Answer: Only input frequency moves here. Field effects named in the technical boundary stay fixed.
Try

Choose Calculate with an 80 Hz sample rate and 50 Hz mains component, then inspect Check.

Observe

Nyquist reads 40 Hz and the out-of-band 50 Hz component folds to a false 30 Hz signal.

Explain

Sampling cannot distinguish frequencies separated by integer multiples of 80 Hz, so analogue attenuation must happen before the 50 Hz component aliases to 30 Hz.

Technical boundaries

For the alias case, excluded from this fixed arithmetic are component tolerances, higher-order filter response, ADC aperture jitter, non-stationary interference, or analogue saturation.

fs = 80 Hz, so Nyquist = fs / 2 = 80 / 2 = 40 Hz
50 Hz mains hum is above 40 Hz, so it cannot be represented honestly
f_alias = |fin - fs x round(fin / fs)| = |50 - 80 x round(50 / 80)| = |50 - 80 x 1| = 30 Hz
For the 100 Hz table: Nyquist = 100 / 2 = 50 Hz; 80, 120, and 180 Hz all fold to 20 Hz
Oversampling rule of thumb from this page: a 20 Hz signal band at 5x to 10x means fs = 100 Hz to 200 Hz, leaving transition-band room for the analog filter

The decision follows the arithmetic: if a 30 Hz wander matters to the product, do not try to remove it later with digital cleanup. Move the analog cutoff below the dangerous interference, raise the sample rate enough to leave filter transition room, or prove by sweep testing that the out-of-band source is below the error budget.

Every number above is taken from the chapter’s own material and re-derived step by step.