Learning · Step 5

Truncation & DC offset

Every time you drop low bits — after a multiply, when you store a wide result, when you scale a signal down — you quantize. How you drop those bits decides whether the leftover error is harmless noise or a permanent DC offset.

In two's complement, plain truncation is an arithmetic shift right — it is floor, rounding toward −∞. The truncated value is always less than or equal to the true value, so the error always lands in (−1, 0] LSB — it is never positive. Average that one-sided error over a signal and the mean is −½ LSB: a constant bias, the same on every sample.

A fixed value subtracted from every single sample is a DC component, by definition. Truncate a zero-mean sine and its average is no longer zero — the whole waveform sags by ½ LSB. Round-to-nearest instead spreads the error symmetrically over [−½, +½] LSB; the mean is ≈ 0, so the error is zero-mean quantization noise, not a DC offset. Noise you can live with; DC you usually can't.

Half an LSB sounds tiny, and once it is harmless. But it wastes headroom, it thumps on mute/unmute, it stacks up when truncations cascade — and it is catastrophic through an integrator: a CIC or an IIR accumulator turns a constant bias into a ramp. The fix is nearly free: round instead of truncate — one add of ½ LSB before the shift.

Try it

A zero-mean sine, quantized. Drag the quantizer coarseness and flip the mode — watch the red mean line leave zero under truncation and snap back under rounding.

0 +1 −1 → samples mean
ideal sine quantized quantized mean (DC)

What to notice

Key rules

Step exam

Answer all 3 questions correctly to complete this step.

  1. Plain two's-complement truncation rounds every value toward:

  2. The average (mean) error of truncation is approximately:

  3. A constant -0.5 LSB error on every sample appears in the signal as: