Signal Sampling & Nyquist Theorem

Set a signal frequency and sampling rate to see whether the signal is faithfully captured or aliased.

Loading interactive simulation...

Two different frequencies can leave identical samples behind 🖖

Sampling works only when the sample rate captures the fastest oscillation content. If fs < 2 fsignal, different continuous frequencies produce identical samples, so reconstruction locks onto a false lower alias frequency.

At least two dots per wave 🖖

To pin down a wave you have to catch it both rising and falling — at least two samples in every cycle. With fewer, those same dots could belong to many different waves, and the digital copy guesses wrong. CD audio uses 44,100 samples per second because human hearing tops out near 20 kHz, and 2 × 20 kHz leaves comfortable margin.

Why wheels spin backward on film 🖖

The wagon-wheel effect is Nyquist in the visible world. A movie camera samples motion at 24 frames per second; if a spoked wheel turns slightly less than one spoke-gap between frames, each shot lands just short of the last, so the eye reads the wheel as rotating slowly backward. Same maths as audio aliasing — the frame rate is the sample rate, and fast rotation folds into a false slow one.

Problem solved in full

  1. The 6 dB-per-bit rule and stray 1.76 for an 8-bit converter 5 steps

    Derive the 6 dB-per-bit rule from scratch for an 8-bit converter — where does the stray 1.76 come from? — then say what it does not promise.

    1. Rounding to the nearest level leaves an error no bigger than half a step, and over a busy signal that error is spread evenly across the interval. Its variance is the integral of e² over a uniform distribution.

    2. The reference signal is a sine filling the full input range, so its power is half the square of its amplitude.

    3. Divide the two. The full-scale range cancels, which is the reason the result is a pure function of bit count and not of voltage.

    4. Take logarithms. The 6.02 is 20 log₁₀2 — one bit doubles the number of levels — and the 1.76 is the leftover 3/2 from the previous line.

    5. Evaluate at 8 bits, then at 16. Every extra bit is worth just over 6 dB, so CD audio's eight extra bits buy 48 dB.

    Answer

    49.92 dB, and the 1.76 is 10 log₁₀(3/2). It is the ratio between a sine's mean-square value and the quantiser's uniform error variance, and it is the only part of the formula that is not just counting bits. Notice what never appears: the sample rate. A 24-bit converter running at 8 kHz has 146 dB of amplitude resolution and still cannot represent a 5 kHz tone — bits buy vertical precision, sample rate buys bandwidth, and no amount of one substitutes for the other. That is why the two sliders on this page are genuinely independent axes rather than two ways of saying "quality".

References (2)

Example problems

  • Safe (no alias) - Safe: fₛ=12 > 2×5=10 Hz, no aliasing
  • Aliased - Aliased: fₛ=7 < 2×5, false frequency appears
  • Critical Nyquist - Critical: fₛ=2f exactly, borderline case
  • CD Audio - CD audio: 44.1 kHz, 16-bit, well above Nyquist for 1 kHz