SFDR & quantization
Drag the bit-depth slider down. Watch the noise floor lift and the spurs poke through. The reading underneath is your SFDR — the difference between the fundamental tone and the loudest spur, in dB. This is the single most useful number for "how clean does my fixed-point port sound?"
What is SFDR?
Spurious-Free Dynamic Range is the ratio of the RMS amplitude of the fundamental signal to the RMS amplitude of the largest spurious tone in the output spectrum. Quantization is what creates those spurs: rounding a continuous sine to a finite-bit integer is a deterministic, slightly non-linear operation, and any non-linearity creates harmonic and intermodulation spurs.
The "ideal" theoretical limit for an N-bit quantizer feeding a full-scale sine is well-known:
SNRideal ≈ 6.02 · N + 1.76 (dB) ENOB = (SNDR − 1.76) ÷ 6.02 (effective number of bits)
SFDR isn't quite the same as SNR. SNR averages noise across the
whole spectrum; SFDR cares only about the loudest single spike.
For most quantizers SFDR is lower than SNR by a few dB
when the signal frequency is rationally related to fs
(the spurs pile up on a few bins) and higher when the
ratio is irrational (the energy spreads as broadband noise).
Try it
What just happened
- The page synthesises a full-precision sine at the chosen frequency, quantizes it to N bits (rounding half-away-from-zero, saturating at ±1), and FFTs the result with a Hann window.
- The blue trace is the magnitude spectrum in dBFS. The dashed cyan line marks the fundamental bin; the orange line marks the single loudest non-fundamental bin — the "worst spur."
- SFDR is just
20·log10(fundamental / spur)— the dB distance between those two markers. - Drop the bits and you'll see the noise floor walk up by ~6 dB per bit lost, and the harmonic spurs (at 2×, 3×, … of the fundamental, aliased back into Nyquist) start poking through.
- Toggle dither on. The spurs spread out into broadband noise: SNR is unchanged but SFDR improves — sometimes dramatically. That's the point of dithering.
Useful formulas
Quantization step (LSB): Δ = 1 / 2^(N−1) for full-scale ±1
Quantization noise power: σ² = Δ² / 12 (uniform over ±Δ/2)
SNR (full-scale sine, dB): 6.02 · N + 1.76
ENOB: (SNDR − 1.76) / 6.02
SFDR (dB): 20 · log10(A_fund / A_spur)
Coherent-bin condition: k_signal ÷ NFFT must be irreducible
(lowest possible spur) Tips that show up in this tool
- Coherent vs. incoherent sampling. Pick a signal frequency that's a power-of-two fraction of fs (e.g. 0.0625 · fs). The spurs lock onto a few bins. Now nudge the frequency by 0.001: the spurs spread out and SFDR improves — sometimes by 10 dB. For audited measurements, you usually want coherent sampling so the spurs land on bins and the FFT picks them up cleanly.
- Window choice matters. This tool uses Hann (good general-purpose). With a rectangular window the spurs are hidden under the leakage skirt and SFDR reads worse than it really is. Heavier windows (Blackman, Kaiser) widen the main lobe but suppress side-lobes — the trade-off you tune per measurement.
- Dithering. Adding a small random signal (~½ LSB rectangular, or ½ LSB triangular for non-modulated noise) decorrelates the quantization error from the input. The total noise power goes up slightly, but the spurs disappear — SFDR can improve 20 dB or more. Triangular dither is the gold-standard for audio.
- Oversampling. Doubling fs spreads the same quantization noise power over twice the bandwidth, so the in-band noise drops by 3 dB per doubling. For a 16-bit converter sampled 4× higher than needed, the in-band SNR is ~6 dB better.
Next steps in Mantissa
- Use the Fixed-point converter to see what a single sample does under different rounding rules.
- Use the Q auto-suggest tool to pick a Q-format that doesn't waste bits on unused headroom — the cheapest way to gain SFDR is to use every bit you have.
Step exam
Answer all 3 questions correctly to complete this step.
-
SFDR stands for:
-
Each bit you drop from the quantizer lifts the noise floor by about:
-
Turning on dither does what to the quantization spurs?