Lite / Engineering Complex Systems / Week 19
Rounding to the nearest step
Why does a 16-bit recording sound clean but an 8-bit one hiss, when both sample just as fast?
Why should I care?
Choosing an ADC is choosing how much rounding noise you can tolerate. Too few bits and a sensor's small changes vanish into the steps; too many and you pay in cost, power and speed. Engineers size this with one formula you can derive in five lines.
- Compute the quantisation step Δ = V/2^N and the maximum error of an ideal ADC.
- Derive and apply SNR ≈ 6.02N + 1.76 dB for a full-scale sine.
- Explain why a signal that uses only part of the ADC range loses resolution.
Predict
You upgrade an ADC from 8 bits to 9 bits. Roughly how much does the best-case signal-to-noise ratio improve?
- About 1 dB
- About 6 dB
- It doubles to twice as many dB
- About 12.5 %
Guess first, then reveal
Each extra bit halves the step Δ, which cuts the noise power by 4, and 10·log₁₀ 4 ≈ 6.02 dB. The quantiser's readout shows the same jump every time you add a bit.
Discover
Start at 3 bits and full amplitude. Note the measured SNR, then add bits one at a time. Then go back to 8 bits and turn the amplitude down to 0.25. How many dB do you lose, and how many bits is that worth?
What the interactive shows (text version)
The quantiser shows a sine wave and its staircase approximation. With 3 bits there are 8 levels and the measured SNR is about 20 dB; every extra bit adds about 6 dB, matching 6.02N + 1.76. Reducing the amplitude to 0.25 of full scale costs about 12 dB.
Understand
Steps and codes
An ideal N-bit ADC splits its input range V into 2^N equal steps of size Δ = V/2^N and outputs the code of the step the input falls in. A 12-bit ADC on a 3.3 V range has Δ = 3.3/4096 ≈ 0.81 mV. A rounding quantiser is never more than Δ/2 away from the truth.
Error behaves like noise
For a signal that wanders across many steps, the rounding error looks like random noise spread evenly between ±Δ/2, with power Δ²/12. That is why quantisation is often called quantisation noise, and why the SNR formula works. It fails for very slow or tiny signals, where the error follows the signal and shows up as distortion instead.
Use the whole range
The formula assumes a full-scale sine. A signal using a quarter of the range has 1/16 of the power but the same Δ, so it loses 20·log₁₀ 4 ≈ 12 dB: two bits' worth. Engineers add an amplifier in front of the ADC so the signal fills the range without clipping.
Explain it another way
Intuitive
Measuring with a ruler marked only in centimetres, every reading is up to half a centimetre out. Finer marks (more bits) mean smaller errors, but only if the thing you measure is big enough to span many marks.
Technical
Each bit doubles the number of levels. Effective number of bits (ENOB) is quoted from measured SINAD: ENOB = (SINAD − 1.76)/6.02. Real converters lose a bit or two to thermal noise and nonlinearity.
Mathematical
Δ = V/2^N, |e| ≤ Δ/2, σₑ² = Δ²/12, SNR_dB ≈ 6.02N + 1.76 (full-scale sine). Using a fraction k of full scale subtracts 20·log₁₀(1/k) dB.
Applied
CD audio uses 16 bits: about 98 dB of SNR, more than the gap between a quiet room and a loud concert. Many microcontroller ADCs are 10 or 12 bits, plenty for a temperature sensor but marginal for audio.
Derivation: Where 6.02N + 1.76 dB comes from
An N-bit quantiser spanning a full range of 2A (from −A to +A) has step Δ = 2A/2^N.
Rounding error e lies between −Δ/2 and +Δ/2. If it is spread evenly (true for busy signals), its mean square is σₑ² = Δ²/12.
A full-scale sine of amplitude A has power P = A²/2.
SNR = P/σₑ² = (A²/2) / (4A²/(12·4^N)) = 1.5 · 4^N.
In decibels: 10·log₁₀(1.5) + N·10·log₁₀(4) = 1.76 + 6.02N dB.
Worked example 1
An 8-bit ADC spans 0–5 V. Find Δ, the maximum error and the best-case SNR.
Δ = 5/256 = 19.5 mV. Maximum rounding error = Δ/2 ≈ 9.8 mV. SNR ≈ 6.02 × 8 + 1.76 = 49.9 dB.
Worked example 2
You need 70 dB of SNR. How many bits?
N ≥ (70 − 1.76)/6.02 = 11.3, so 12 bits.
Common mix-ups
A faster sample rate fixes quantisation noise.
✓ Sample rate decides which frequencies you capture; bit depth decides the rounding error. They are separate knobs (oversampling helps only when combined with filtering).Any 16-bit ADC gives 98 dB.
✓ That is the ideal full-scale figure. Small signals and real-world noise give less.
Practice
Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.
Apply it
A load cell gives 0–20 mV and your microcontroller's 12-bit ADC spans 0–3.3 V. How many steps does the load cell span directly? Choose an amplifier gain to use most of the range without clipping, and say how many dB that recovers.
Reflect
When would you pick a 10-bit ADC over a 16-bit one, even though the 16-bit one is 'better'?
Write your answer on paper or in your own notes. Lite never stores what you write.