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.
What to notice
- Flip Truncate → Round — the red mean line jumps from −0.5 LSB straight onto zero. That snap is the fix: one extra add.
- Make the quantizer coarser (fewer bits) — the staircase turns blocky and the DC offset grows. It is always −0.5 LSB, so a bigger LSB means a bigger offset.
- Under Truncate, every step of the blue curve sits on or below the ideal sine — the error is never positive. That one-sidedness is exactly where the DC comes from.
- Under Round the error is still there — but it falls above and below the curve in equal measure. Zero-mean noise, no DC.
Key rules
- Round, don't truncate, whenever the result still carries a signal — truncation's −0.5 LSB mean is a DC offset, not noise.
- Rounding is nearly free — one add of ½ LSB before the shift. There is no good reason to ship the DC.
- DC is worst through integrators — a CIC or IIR accumulator turns a constant bias into an ever-growing ramp. Never feed a truncated signal into one.
- Truncation bias cascades — each truncated stage adds its own −0.5 LSB; down a long chain the offsets simply sum.
- Convergent rounding (round-half-to-even) removes even the tiny tie bias that plain round-half-up leaves — reach for it in long integrators and metering.
Step exam
Answer all 3 questions correctly to complete this step.
-
Plain two's-complement truncation rounds every value toward:
-
The average (mean) error of truncation is approximately:
-
A constant -0.5 LSB error on every sample appears in the signal as: