Interactive simulations

8-bit sample conversion, live in the browser. Equation numbers refer to the sample conversion page. Everything runs locally in your browser; nothing is sent anywhere.

1. Aliasing and the low-pass filter (eq. 2–3)

Sampling at 8363 Hz cannot tell a tone above 4181.5 Hz from a lower one. Move the tone past the Nyquist line, then switch on the filter.

input tone after filter alias (what you hear) sample point Nyquist 4181.5 Hz
Time, 1.5 ms: tone, sample points and the tone the points appear to have
Frequency, 0–24 kHz

2. Quantization with and without dither (eq. 5–6)

A decaying tone is rounded to a few bits. Without dither the error follows the signal; with TPDF dither it becomes noise and the tail survives on average.

input no dither RPDF dither TPDF dither
Input and quantized output
Error ν = output − input

3. Monte Carlo check of the error moments (eq. 7–8)

For each input value z between two quantizer steps, draw many dither values and measure the mean and the mean square of the error. TPDF should give a flat q²/4 line.

no dither RPDF TPDF theory: q²/4 (TPDF), q²/12
E[ν | z]
E[ν² | z]

Also in Rust: the same simulations in three-d, compiled to WebAssembly.

Renderer: loading… (Canvas 2D · WebGL bloom)

Code: the math is in js/dsp.js (with equation numbers), each simulation in its own module, and the shared glow theme in assets/glow/. Static figures are rendered by scripts/demo.py from the same palette.