The Nyquist Theorem
& Aliasing Visualised

Watch how discrete sampling measures a continuous analog wave. Drag the Time Window Zoom slider to space out individual sample points and observe how phantom aliased waves emerge when the Nyquist limit is violated.

🎛 Guided Presets & Controls

Presets:
Signal Frequency (Hz) — analog tone
50 Hz
Sampling Rate (Hz) — ADC clock speed
250 Hz
Time Window Zoom (sec) — point spacing
0.08 s
Signal Frequency
50 Hz
Sampling Rate
250 Hz
Nyquist Limit (fs/2)
125 Hz
Perceived Alias Freq
None
Nyquist Status
OK ✓
▬ Blue Solid: True Continuous Signal  •  ● Yellow Dots & Stems: ADC Samples Taken  •  - - Red Dashed: Reconstructed Phantom Alias
Frequency Domain Spectrum — Blue Peak: Input Frequency, Red Peak: Folded Alias Peak, Dashed Line: Nyquist Cutoff ($f_s / 2$)

Nyquist criterion satisfied. Signal frequency (50 Hz) is below Nyquist (125 Hz). Sampling faithfully captures the original signal.

1. Point Spacing & Time Window

By zooming the time window to 0.08 seconds (80 ms), we are magnifying a tiny slice of time. At 250 Hz, one sample is recorded every 4 ms ($1 / 250\text{ s}$). The vertical yellow stems show the exact instant and voltage recorded by the analog-to-digital converter (ADC).

2. How the Red Phantom Alias Form

When the signal moves faster than half the sampling clock ($f > f_s / 2$), the yellow sample dots are too sparse to capture the rapid blue waves. The ADC only "sees" the yellow dots — and the simplest smooth curve passing through those exact yellow dots is the red dashed slow wave ($f_{\text{alias}} = |f - \text{round}(f/f_s) \cdot f_s|$).

3. The Fundamental Ambiguity of Sampling

Notice how the yellow sample dots lie simultaneously on both the fast blue wave and the slow red wave! Once sampled, a computer cannot distinguish whether those numbers came from a 180 Hz signal or a 20 Hz signal. This is why aliasing is permanent and uncorrectable after sampling.

4. How the Anti-Aliasing Filter Protects Data

Hardware EEG amplifiers use an analog low-pass filter before the ADC to block all frequencies above $f_s / 2$. Try toggling the Anti-alias Filter: ON button: high frequencies above Nyquist are attenuated to near-zero before sampling, ensuring no phantom red waves ever corrupt your recordings.

📚 Mathematical Foundations

The Nyquist–Shannon Theorem proves that an analog signal $x(t)$ with maximum frequency $f_{\text{max}}$ can be perfectly reconstructed without loss if sampled at:

$$f_s > 2 \cdot f_{\text{max}} \quad \implies \quad f_{\text{Nyquist}} = \frac{f_s}{2}$$

When $f > f_{\text{Nyquist}}$, the frequency component folds back into the passband $[0, f_s/2]$ according to:

$$f_{\text{alias}} = \left| f - \text{round}\left(\frac{f}{f_s}\right) \cdot f_s \right|$$