skip to content

How does the bit depth of a recorder covering a fixed input range set the size of its worst-case quantization error?

level: middleimportance: must knowfreq 68%

answer

  1. levels first, then the step
  2. range divided by two to the b
  3. round to nearest, half a step
  4. each bit halves the step
  5. about six decibels per bit

basics

~20 s

Bit depth b splits a fixed range R into 2^b levels, so the uniform step is R divided by 2^b and round-to-nearest keeps every in-range sample within half a step. Each added bit halves the step and drops the error floor by about 6 dB.

solid answer

~50 s

With `b` bits you have `2^b` levels covering a fixed input range `R`, so the uniform step is `d = R / 2^b`. Round-to-nearest puts every in-range sample within `d/2` of a level, and if the error is modelled as spread evenly across the bin its RMS value is `d` over the square root of twelve - a floor that does not depend on how loud the signal is. That is why bit depth buys dynamic range rather than accuracy in any absolute sense: one more bit halves `d`, quarters the error power, and lowers the floor by about 6 dB, so sixteen bits sit roughly 96 dB below full scale. The range `R` is fixed by the stage in front of the converter; bits subdivide it and never extend it, so a depth quoted without its range says nothing about the step.

code

pseudocode · 13 lines
pseudocode
levels = 2^b                      # b bits index this many levels
step   = (hi - lo) / levels       # uniform step over the input range

function quantize(x):
    if x < lo:   return 0                     # clipped at the bottom
    if x >= hi:  return levels - 1            # clipped at the top
    return floor((x - lo) / step)             # bin index 0 .. levels-1

function reconstruct(i):
    return lo + (i + 0.5) * step              # centre of the bin

# for any x inside [lo, hi):
#   |reconstruct(quantize(x)) - x| <= step / 2

go deeper

for a junior

Remember the two-step chain: b bits give two-to-the-b levels, those levels divide the input range, and rounding to the nearest of them costs at most half a step.

for a middle

Derive it at the whiteboard, including why error power falls fourfold per added bit and why the range is fixed by the stage in front of the converter rather than by the depth.

for a senior

Turn it into a budget: pick the depth from the quietest detail that must clear the error floor and the loudest peak that must not clip, then defend the headroom between them.

for a principal

Weigh depth against everything it scales - storage, bandwidth, the width of intermediate arithmetic - and decide where in the pipeline it is acceptable to drop to fewer bits.

## From bits to a step size The chain has three links and candidates who get it wrong usually skip the middle one. 1. `b` bits index **`2^b` distinct levels**. Twelve bits give 4096, sixteen give 65,536. 2. Those levels divide a **fixed input range `R`** that comes from the analogue stage ahead of the converter, not from the bit depth. 3. Uniformly spaced, they sit `d = R / 2^b` apart, and `d` - the **step**, sometimes called the least significant step - is the quantity every error statement is about. So a converter spanning 2 V at 12 bits has a step of `2 / 4096`, about 0.49 mV. The same 12 bits over a 20 V span give a step ten times larger. **Bit depth alone never tells you the step.** ## What round-to-nearest buys Round-to-nearest assigns each input to the closest level, which is what makes the error bound clean: - the **worst-case error** on an in-range sample is `d/2`, at every magnitude; - if the input is modelled as landing uniformly inside its bin, the **RMS error** is `d` over the square root of twelve, and the error power is `d^2 / 12`; - the floor is **level-independent**: a loud passage and a quiet one carry the same absolute error, and only their ratio to it differs; - the model has a **precondition** - it holds when the signal crosses several levels between samples, and degrades for signals comparable in size to a single step. Truncation instead of rounding doubles the worst case to a full step and adds a bias of half a step in one direction, which is why round-to-nearest is the default assumption in any interview answer. ## Where 6 dB per bit comes from Add one bit: the level count doubles, `d` halves, and error power - which scales with `d^2` - falls by a factor of four. In decibels that is `10 x log10(4)`, about **6.02 dB**. The slope is exact and general. The additive constant in a full signal-to-error figure is not: it depends on the signal's amplitude distribution and on what is called full scale, so quote the slope and treat any single headline number as conditional. | Bits | Levels | Step over a 2 V range | Floor below full scale | |---|---|---|---| | 8 | 256 | about 7.8 mV | about 48 dB | | 12 | 4096 | about 0.49 mV | about 72 dB | | 16 | 65,536 | about 31 uV | about 96 dB | | 24 | 16,777,216 | about 0.12 uV | about 144 dB | The last row is the honest caution in the table: at that depth the step is far below the noise of the analogue stage feeding it, so the extra bits describe noise rather than signal. Depth stops buying anything once the step sits under the physical noise floor, and that ceiling is a property of the hardware and the environment, not of the arithmetic. ## Depth without range is meaningless Two statements sound the same and are not. *This is a 16-bit capture* fixes the level count. *This is a 16-bit capture of a 2 V span* fixes the step, and therefore the error. Every practical consequence follows from the second: - a **wider range** at the same depth means a coarser step and more absolute error, in exchange for clipping later; - a **narrower range** resolves more finely and clips sooner, so the gain staging in front of it matters more; - **more bits over an unchanged range** lower the floor and leave the clipping point exactly where it was. ## Choosing a depth Treat it as a budget with two ends. The **top** is the loudest peak you must represent without clipping, plus headroom for what you did not predict. The **bottom** is the quietest detail that must still stand above the error floor. The span between them, in decibels, divided by roughly six, is the number of bits you need; round up, then add the headroom bits you decided to reserve. Everything downstream - storage, bandwidth, the width of intermediate arithmetic - scales with the answer, which is why the decision is made once, deliberately, and documented with the range it assumes.

  • Why is the quantization error floor described as independent of the signal level?
    Because a uniform grid has the same step everywhere, so the absolute error stays under half a step whatever the sample's magnitude. A loud passage and a quiet one carry the same error and differ only in their ratio to it. The model weakens for signals comparable in size to one step, where the error stops resembling noise and starts tracking the signal instead.
  • Two recorders use the same bit depth but different input ranges - what differs?
    The step, and therefore the absolute error. The wider range spreads the same number of levels further apart, so each sample can be off by more; the narrower range resolves finer but clips sooner. Bit depth fixes how many levels exist and never how far apart they sit, so a depth quoted without a range is an incomplete statement.
  • Where does the roughly 6 dB per bit figure come from?
    Each extra bit halves the step. Error power scales with the square of the step, so halving it quarters the power, and a factor of four is about 6.02 dB. The slope is general; the additive constant in a full signal-to-error figure depends on the signal's amplitude distribution and on the chosen full-scale reference, so it is not.

saying these in an interview costs you the question

  • Says more bits raise the maximum recordable level
  • Quotes a bit depth without saying what range it spans
  • Thinks the error floor rises with the signal level on a uniform grid
  • Claims each extra bit halves the error power rather than quartering it
  • Believes storing a shallow capture at greater depth improves it
  • Confuses the level count with the step size