Skip to content

Sampling rate and aliased frequency

Explain how aliasing and anti-alias filters change sampled evidence.

Explain how aliasing and anti-alias filters change sampled evidence., your practice guide

Explain how aliasing and anti-alias filters change sampled evidence.
Predict the reading, then compare it with the measurement.

Python 3 in your browser (JupyterLite)

Python · no install

Explain how aliasing and anti-alias filters change sampled evidence.

Tier 2 · Web · paste-in setup · No account

Version tested: Python 3.12.7 / Pyodide 0.27.6 in JupyterLite 0.6.4; Chromium real browser capture, 2026-10-09. Date: 2026-10-09.

Open the notebook in your browser and run each Python cell; no install or account is needed.

Three ways to run: use JupyterLite here with no install; run main.py locally from the downloadable lab folder; or open the same notebook in Google Colab.

Open in your browser (new tab)

Steps

Screens captured against Python 3 in your browser (JupyterLite) Python 3.12.7 / Pyodide 0.27.6 in JupyterLite 0.6.4; Chromium real browser capture, 2026-10-09 on 2026-10-09; the tool may have moved on — the text steps are the contract.

  1. 1 Step 1

    Do
    Run the Step 1 notebook cell to inspect the synthetic 7 Hz source and reference sample table.
    You will see
    SYNTHETIC sine fixture; seed=207; no random draws; source(t)=sin(2*pi*7 Hz*t); duration=1.000 s; reference time_s signal; 0.000 0.000; 0.025 0.891
    Why it matters
    The original generated signal fixes the source frequency before sampling.
    Real JupyterLite notebook output for step 1 of Sampling rate and aliased frequency.
    Step 1 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)
  2. 2 Step 2

    Do
    Run the Step 2 notebook cell to sample at 40 Hz and read the dominant frequency bin.
    You will see
    40 Hz sampling: Nyquist limit=20 Hz; sample count=40; spacing=0.025 s; dominant 1-second Fourier bin=7 Hz; inferred period=0.143 s
    Why it matters
    The faster sample rate keeps 7 Hz below its Nyquist limit.
    Real JupyterLite notebook output for step 2 of Sampling rate and aliased frequency.
    Step 2 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)
  3. 3 Step 3

    Do
    Run the Step 3 notebook cell to sample the same source at 10 Hz and inspect the slower sequence.
    You will see
    10 Hz sampling: Nyquist limit=5 Hz; same 7 Hz source; sample count=10; dominant 1-second Fourier bin=3 Hz; The visible sequence cycles more slowly.
    Why it matters
    The slower rate puts 7 Hz above its Nyquist limit.
    Real JupyterLite notebook output for step 3 of Sampling rate and aliased frequency.
    Step 3 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)
  4. 4 Step 4

    Do
    Run the Step 4 notebook cell to compare the predicted alias with the measured Fourier bin.
    You will see
    Alias prediction for 7 Hz sampled at 10 Hz; f_alias=abs(f_source-round(f_source/f_s)*f_s); apparent frequency=3 Hz; predicted == measured: True
    Why it matters
    Agreement between arithmetic and the sampled spectrum identifies the alias.
    Real JupyterLite notebook output for step 4 of Sampling rate and aliased frequency.
    Step 4 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)
  5. 5 Step 5

    Do
    Run the Step 5 notebook cell to apply a four-point boxcar before decimation and compare RMS values.
    You will see
    Causal 4-point boxcar at 40 Hz, then keep every fourth sample; filter output[n]=mean(high[4*n-k], k=0..3); raw RMS=0.707; filtered RMS=0.274; RMS ratio=0.387
    Why it matters
    An average can attenuate a tone before downsampling, with limited rejection.
    Real JupyterLite notebook output for step 5 of Sampling rate and aliased frequency.
    Step 5 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)
  6. 6 Step 6

    Do
    Run the Step 6 notebook cell and check the two rates, alias calculation, and filter limitation.
    You will see
    RESULT CARD: synthetic 7 Hz source; seed=207; 40 Hz: dominant bin 7 Hz; A 4-point boxcar attenuates this tone but is not a complete anti-alias design.; This synthetic run does not establish a real sensor bandwidth.
    Why it matters
    The result must keep the simulated source and filter limitation visible.
    Real JupyterLite notebook output for step 6 of Sampling rate and aliased frequency.
    Step 6 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)

Chapter checks

These questions refer to the chapter’s examples. Use the return links to review their answers.

  1. You need to sample a 500 Hz signal. What is the minimum sampling rate according to Nyquist?

    Return to the chapter’s knowledge check
  2. An ADC samples at eight kilohertz and the wanted signal ends at one kilohertz. Which anti-alias filter plan is reviewable?

    Return to the chapter’s knowledge check

Caution

This synthetic sine run does not establish a real sensor bandwidth or the suitability of a production anti-alias filter.

Return to Sampling and Aliasing: Nyquist and Filters · Browse Labs