Where a signal becomes a number

When a floor stops being a floor

Quantisation error is treated as noise and behaves like noise while the input crosses many levels. As the amplitude falls it stops: measured at the bins its harmonics occupy, the share of the error's power sitting in harmonics of the input rises from 0.29% at 230 levels to 76% at 1.3. The floor has not moved. It has become a distortion product locked to the signal, and the fix is to add noise on purpose — one whole least significant bit, and no more.

Assumes: The floor a converter sets · The distortion a linear model cannot have

The previous essay measured a quantiser’s signal-to-noise ratio and found the standard formula correct to a tenth of a decibel. It also listed the hypothesis that formula rests on and deferred it: that the error is noise — spread across the band, unrelated to the signal that produced it.

That hypothesis is not a small print. It is the difference between a converter whose imperfection sounds like a hiss and one whose imperfection sounds like the music, and the amplitude at which it stops holding is measurable.

The amplitude at which a converter's floor becomes distortioncomputed by solving, not by drawing. The quantisation error is transformed and the power in harmonics of the input is measured directly, at the bins those harmonics occupy. Undithered, the share rises from 0.29% at 230 levels to 76.5% at 1.3: the error has stopped being spread and has become a deterministic staircase locked to the signal. The sweep is drawn against the levels the input uses rather than against volts because it is then the same sweep for every converter — a twelve-bit part and a sixteen-bit part agree here to 0.0e+0, so what decides the character of the error is how many levels the signal crosses and not how many the converter owns. With 1 least significant bit of dither the share stays under 0.34% at every amplitude, for 3.03 dB of signal to noise. Adding noise to a converter's input improves what comes out of it, which is true and sounds like it should not be — and the amount is one whole step, not "some": a quarter of a step leaves 52.7% and a half leaves 25.6%, because a dither smaller than a step cannot make the quantiser cross one.100µ1m10m100m1levels the input usesshare of the error in harmonics of the input131030100300no dither1 LSB of ditherconverter12 bitsat 230 levels0.29%at 1.3 levels76.5%dither, 1 LSBworst 0.34%and it costs3.03 dBsame at 16 bits to0.0e+0solved, then checked — the error's own spectrum76% harmonic at 1.3 levels
Fig. 1 The share of the quantisation error’s power that sits in harmonics of the input, swept against the number of levels the input crosses. Undithered it climbs from 0.29% to 76%. The second curve is the same sweep with dither added; the slider is how much, and the answer is one whole step.

The error is not random and never was

A quantiser is a deterministic function. Given a sample it returns the nearest level, every time, with no randomness anywhere. Calling its error “noise” is a modelling decision, and like every modelling decision on this site it has a range.

The range is easy to state qualitatively. When a signal sweeps across many levels between one sample and the next, the error takes essentially arbitrary values in (−q/2, +q/2) and successive errors are unrelated to one another — so a statistical description is a good one. When the signal barely moves between samples, the error is a slowly varying function of the signal, repeating exactly as the signal repeats, and a statistical description is describing something that is not there.

What is harder is to say where the change happens, and the trap is that the total error hardly changes at all across it. The root mean square of the error stays close to q/√12 the whole way down. Only its arrangement changes: from spread to concentrated, at frequencies that are harmonics of the input.

Measuring the arrangement

The measurement is a direct one. Take the error sequence, transform it, and add up the power sitting at the harmonics of the input — the second through the twelfth. Divide by the total.

Two constructional details decide whether that measurement is about anything.

The bins have to be the input’s harmonics, not the record’s first few. A record of 8,192 samples holding 129 cycles has its input at line 129 and its third harmonic at line 387. Asking for lines 2 to 12 measures a part of the spectrum where nothing lives, and returns a small, smooth, entirely meaningless number that falls with amplitude — which is what a first version did, in the opposite direction from the effect. binPower evaluates the transform at named bins for this reason.

The tone has to be low enough that twelve harmonics fit. coherentCycles picks about a third of the record, which puts the twelfth harmonic four times past half the sample rate, where it folds back onto somebody else’s bin. The character sweep picks five tones between a sixty-fourth and a twenty-eighth of the record instead, and the gate checks that twelve harmonics of the largest of them stay inside the band.

With both in place:

levels the input crosses share of the error in harmonics
230 0.29%
128 0.53%
64 0.84%
26 1.18%
13 23.7%
5.1 30.4%
2.6 62.9%
1.3 76.5%

The transition is not gentle and it is not at a round number: somewhere between twenty-six levels and thirteen the error stops being mostly spread and becomes mostly not. Below five levels the majority of what a data sheet would call the noise floor is at harmonics of the signal.

6.02 bits + 1.76 dB, measured — and the overload that is blamed on it. computed by solving, not by drawing. A coherent sinusoid is quantised and the ratio is read off the error sequence, never from the formula. One step inside full scale the two agree to 0.15 dB at every bit count from 8 to 16. Driven to exactly full scale the same converter measures 0.83 dB worse at 8 bits when driven to exactly full scale, and the reason is in the count beside it: 327 of 8192 samples hit the top code. A mid-tread converter's largest code is one step below full scale, so a sinusoid that reaches full scale is already overloading — half a step of overload, at the peak, where the error correlates with the signal. The loss halves with every bit for the same reason the clipped count does — 0.83, 0.47, 0.21, 0.06, -0.13 dB — and by sixteen bits it is inside the measurement's own scatter. The formula was never the approximation.
Fig. 2 The measurement this essay qualifies. The ratio agrees with 6.02N + 1.76 dB to 0.15 dB at every bit count — at full amplitude, where the error is spread. Every number in that figure is arithmetically correct at low amplitude too, and describes something that is no longer noise.

The result the sweep is drawn in levels for

The x-axis is the number of levels the input crosses rather than an amplitude in volts, and that is not presentation.

Run the identical sweep on a twelve-bit converter and on a sixteen-bit one and the two agree to the floor of the arithmetic — zero, at all eight points. The character of the quantisation error is a function of how many levels the signal crosses and contains nothing whatever about how many levels the converter owns.

That has a consequence worth stating in the language a designer uses. A sixteen-bit converter given a signal 90 dB below full scale is in exactly the state an eight-bit converter is in with a signal 42 dB down. More bits do not buy a better-behaved error at low amplitudes; they buy the same behaviour at a lower absolute level. The distortion products of a quiet passage in a twenty-four-bit recording are as much distortion as they would be in an eight-bit one, sitting further down.

It also explains a measurement practice that otherwise looks superstitious. A converter tested only at full scale is tested in the one regime where the noise treatment is sound, and the number it returns — the one the previous essay measured to a tenth of a decibel — says nothing about how it behaves on the signals it will actually see.

The amplitude at which a converter's floor becomes distortion. computed by solving, not by drawing. The quantisation error is transformed and the power in harmonics of the input is measured directly, at the bins those harmonics occupy. Undithered, the share rises from 0.29% at 230 levels to 76.5% at 1.3: the error has stopped being spread and has become a deterministic staircase locked to the signal. The sweep is drawn against the levels the input uses rather than against volts because it is then the same sweep for every converter — a twelve-bit part and a sixteen-bit part agree here to 0.0e+0, so what decides the character of the error is how many levels the signal crosses and not how many the converter owns. At 0.5 of a least significant bit the dither is too small to do it: the share still reaches 25.8%, because a dither smaller than a step does not make the quantiser cross one. It costs 0.97 dB and buys nothing, which is the worst place on this slider to be.
Fig. 3 Half a least significant bit of dither. The undithered error reaches 76% of a harmonic and the dithered one 25.81%, costing 0.97 dB of signal-to-noise. The result the sweep is drawn in levels for is that number: dither is paid for in the floor, and half a bit is not enough to buy the whole of what it is for.

Adding noise on purpose

The repair is counter-intuitive in a way that survives explanation: add a small random signal to the input before quantising, and what comes out is better.

Not quieter. The signal-to-noise ratio gets slightly worse, necessarily, because a deliberate noise has been added to a signal. What changes is the error’s arrangement: the added noise makes the quantiser cross a step at moments unrelated to the signal, which breaks the correlation the whole problem consists of.

Measured on the same sweep, with uniform dither of varying size:

dither worst harmonic share cost in signal to noise
none 76.5%
0.25 step 52.1% 0.26 dB
0.5 step 25.8% 0.97 dB
1 step 0.34% 3.03 dB
2 steps 0.31% 7.10 dB
4 steps 0.32% 12.41 dB

One whole step is the answer, and less than one is nearly useless. A dither smaller than a step cannot make the quantiser cross one, so at a quarter of a step the error is still locked to the signal more than half the time and the cost — a quarter of a decibel — has bought almost nothing. That is the worst place on the slider to be: a design that added “a little dither” would pay and not be paid.

More than one step is the other error, and it is the expensive one. Two steps leaves the harmonic share where one step left it, at about three tenths of a per cent, and costs 7.10 dB instead of 3.03. Four steps costs 12.41 dB for the same result. The knee is sharp and it is at exactly one step, which is what makes it a design rule rather than a judgement.

Why one step, and not some other number

The knee at one step is a measurement, and it is worth saying what mechanism puts it there, because the reason is short and it predicts the shape of the table rather than merely agreeing with it.

The error is locked to the signal whenever the quantiser’s decision — which level is nearest — is decided by the signal alone. A dither of amplitude d moves the decision only for samples lying within d/2 of a decision boundary; every other sample rounds exactly as it would have. So a dither of half a step randomises the decision for half the samples and leaves the other half where they were, and half a locked error is still a locked error: the harmonics fall by about a factor of three in power, which is what the table shows between none and half a step.

At a full step every sample lies within half a dither of a boundary, whatever the signal is doing, so every decision has been made unpredictable and the lock is gone entirely. Below that the effect is partial. Above it the lock stays broken at every whole step and comes partly back between them, which is the dither that is a decision’s measurement rather than this one’s. That is a threshold rather than a trend, and it is why the table’s middle rows are the interesting ones: 52.1% at a quarter step and 25.8% at a half are not “not quite enough dither”, they are a fraction of the samples still locked, and the fraction is roughly the fraction of a step the dither is short by.

The cost behaves quite differently and it is worth noting the asymmetry. The dither’s own power adds to the error’s in quadrature, so it grows as the square of the dither amplitude while the benefit saturates at one step. That is the whole design rule, and it comes out of the two curves rather than out of a convention: the benefit has a knee and the cost does not.

Two routes, and what the second one is for

The dithered measurement is taken against the clean signal, not against the dithered one, and the distinction decides whether the table above means anything.

The dither is part of what the converter did. A reader wants to know how far the output is from the signal that was presented, and the signal presented was the clean one. Measuring against the dithered input would report the error of a converter that had been fed something else — and it would make dither look free, since the added noise would sit on the reference rather than in the error.

That is the same discipline as the noise field’s insistence that its two routes share only the netlist, and the same as the power field computing its neutral current twice from routes that share only the solve. A comparison is worth what its two sides do not have in common.

The shape this argument has, three fields apart

This is the third time this collection has found a linear description holding up numerically while describing the wrong object, and the three are worth putting side by side because the mechanism is the same each time.

The power factor of a rectifier’s current. A phasor calculation gives a displacement factor of exactly 1.000000 while the true power factor is 0.780, because a phasor describes a sinusoid and the current is not one. The calculation is not wrong; its object is not present.

The distortion of a small-signal model. A linear model has no distortion by construction, so asking it how much distortion a stage produces is asking a question its form cannot answer. It returns a clean answer to a question it has not been asked.

The noise of a quantiser at low amplitude. q/√12 is still the right root mean square. What it is the root mean square of has stopped being noise.

In each case the failure is invisible from the number, which stays plausible; and in each case the detection is the same — measure a property the model implies but does not compute. A phasor calculation implies a sinusoidal current, so measure the harmonics. A linear model implies no second harmonic, so measure the second harmonic. A noise treatment implies a spread error, so measure how much of it is at harmonics of the input.

The amplitude at which a converter's floor becomes distortion. computed by solving, not by drawing. The quantisation error is transformed and the power in harmonics of the input is measured directly, at the bins those harmonics occupy. Undithered, the share rises from 0.29% at 230 levels to 76.5% at 1.3: the error has stopped being spread and has become a deterministic staircase locked to the signal. The sweep is drawn against the levels the input uses rather than against volts because it is then the same sweep for every converter — a twelve-bit part and a sixteen-bit part agree here to 0.0e+0, so what decides the character of the error is how many levels the signal crosses and not how many the converter owns. With 2 least significant bits of dither the share stays under 0.31% at every amplitude, for 7.10 dB of signal to noise. Adding noise to a converter's input improves what comes out of it, which is true and sounds like it should not be — and the amount is one whole step, not "some": a quarter of a step leaves 52.7% and a half leaves 25.6%, because a dither smaller than a step cannot make the quantiser cross one.
Fig. 4 Two least significant bits: the dithered error falls to 0.31% of a harmonic and the cost rises to 7.10 dB. The shape this argument has, three fields apart, is the same as degeneration in an amplifier and as feedback around a distorting stage — a deterministic error is exchanged for a larger random one, and the exchange is always at a loss in total power.
The amplitude at which a converter's floor becomes distortion. computed by solving, not by drawing. The quantisation error is transformed and the power in harmonics of the input is measured directly, at the bins those harmonics occupy. Undithered, the share rises from 0.29% at 230 levels to 76.5% at 1.3: the error has stopped being spread and has become a deterministic staircase locked to the signal. The sweep is drawn against the levels the input uses rather than against volts because it is then the same sweep for every converter — a twelve-bit part and a sixteen-bit part agree here to 0.0e+0, so what decides the character of the error is how many levels the signal crosses and not how many the converter owns. At 0.25 of a least significant bit the dither is too small to do it: the share still reaches 52.1%, because a dither smaller than a step does not make the quantiser cross one. It costs 0.26 dB and buys nothing, which is the worst place on this slider to be.
Fig. 5 A quarter of a least significant bit. The dithered error is still 52.12% of a harmonic and the cost is only 0.26 dB — nearly all of the distortion and almost none of the price. Across the settings drawn the dithered harmonic runs 52.12%, 25.81%, 0.34%, 0.31% and 0.32% while the cost runs 0.26, 0.97, 3.03, 7.10 and 12.41 dB, so the useful range is narrow and one bit is the choice because it is where the harmonic has become inaudible and the floor has not yet risen by much.

Where the error goes instead, drawn as a spectrum

The tables above are integrals, and an integral hides the shape it integrated. It is worth naming what the spectrum of a locked quantisation error actually looks like, because the shape is what identifies the mechanism on a bench.

At low amplitude the quantised output of a sinusoid is close to a staircase with very few treads, and a staircase is an odd function of a sinusoid — so its Fourier series contains odd harmonics predominantly: third, fifth, seventh, falling slowly. That is the same series a symmetric limiter produces, and this collection has drawn it once already in the semiconductor field, where a differential pair’s even harmonics come out at 10⁻¹⁶ of the fundamental — the arithmetic’s floor rather than a small residue — because the device’s symmetry forbids them.

The consequence for a measurement is specific. A quantiser’s low-level distortion sits at odd multiples of the input, and above the third or fifth those multiples are usually above half the sample rate, so they fold. A converter tested with a tone at two fifths of Nyquist produces a fifth harmonic that lands back in the band at a frequency bearing no simple relation to the input, which is the origin of the “birdies” or “idle tones” a low-level converter measurement is full of.

That is the same folding the first essay in this field measured, arriving from inside the converter rather than from its input, and it is why the two halves of this field are one field: the sampling identity and the quantisation error are separate mechanisms that meet in every low-level measurement anybody makes.

The amplitude at which a converter's floor becomes distortion. computed by solving, not by drawing. The quantisation error is transformed and the power in harmonics of the input is measured directly, at the bins those harmonics occupy. Undithered, the share rises from 0.29% at 230 levels to 76.5% at 1.3: the error has stopped being spread and has become a deterministic staircase locked to the signal. The sweep is drawn against the levels the input uses rather than against volts because it is then the same sweep for every converter — a twelve-bit part and a sixteen-bit part agree here to 0.0e+0, so what decides the character of the error is how many levels the signal crosses and not how many the converter owns. With 4 least significant bits of dither the share stays under 0.32% at every amplitude, for 12.41 dB of signal to noise. Adding noise to a converter's input improves what comes out of it, which is true and sounds like it should not be — and the amount is one whole step, not "some": a quarter of a step leaves 52.7% and a half leaves 25.6%, because a dither smaller than a step cannot make the quantiser cross one.
Fig. 6 And where the error goes instead, at four bits of dither: the harmonic is 0.32% and the price is 12.41 dB. Nothing has been removed — the same error power is spread across the band rather than gathered into lines. A floor stops being a floor when its error correlates with the signal, and dither is what decorrelates it, at a cost that is itself a floor.

What is not claimed

Two limits on the result above, stated because the field is new.

Uniform dither is one choice among several. The measurement here uses one step peak-to-peak of uniformly distributed noise, which is the standard rectangular dither and is what the table describes. Triangular dither of two steps peak-to-peak has a different and in some respects better property — it removes the dependence of the error’s own power on the signal as well as its correlation — at a cost of another 1.76 dB. That is a real distinction and it is not measured here.

Nothing here is about what a listener hears. The claim is about where the error’s power sits in frequency, which is a fact about the signal. Whether a distortion product at a stated level is more objectionable than a noise floor at the same level is a question about perception, and this collection’s boundary with the acoustics site puts it firmly on the other side.

The boundary this puts on the previous essay’s number

It is worth closing by restating what has been taken away, because the previous essay’s result stands and this one narrows it rather than contradicting it.

6.02N + 1.76 dB is the ratio of a full-scale sinusoid to the root mean square of the error, and that remains true at every amplitude — the arithmetic of a root mean square does not care how the error is arranged. What this essay establishes is that the denominator stops being a noise floor, and every use of the formula that treats it as one inherits the boundary.

Three such uses are common and all three are wrong below about thirteen levels.

The crossing that motivates the first of them is the floor a converter sets, where a quantiser’s floor and a source resistor’s are compared directly and found to cross at 18.80 bits — an arithmetic that assumes both are noise, and which this essay bounds from the other side.

Adding contributions in quadrature. A quantisation floor and a thermal floor add as squares because they are independent. A distortion product and a thermal floor do not: the product is at a known frequency, so a measurement resolving that frequency sees it at its full height rather than diluted across the band.

Trading bandwidth for resolution. Halving the bandwidth halves a noise floor’s power because the noise is spread. A harmonic of the input is not spread, and halving the bandwidth either keeps it entirely or excludes it entirely, depending on where it landed.

Reading an effective bit count. The previous essay defines effective bits by inverting the formula. Below the transition, the number it returns is still arithmetically correct and no longer describes a converter that would be interchangeable with a lower resolution one — the two have the same total error and put it in completely different places.

All three are repairable in one move, which is the dither the middle of this essay measures. One whole step, 3.03 dB, and the floor is a floor again at every amplitude the converter can represent — which is the reason dither is not an audio refinement but a condition for the arithmetic in the rest of the field to mean what it says.

Two circuits elsewhere in this collection are the same argument with the sign reversed, and reading them beside this one says what the difference depends on. Two thresholds because there is a floor has noise under a single threshold and wants it gone: a slow crossing is decided 22.7 times rather than once, and the repair is hysteresis measured in standard deviations of the noise — 3.57 of them — rather than in volts. A quantiser is a row of thresholds and wants the noise there. The difference is entirely what happens downstream: a converter’s output is averaged, by a filter or by a later stage, and averaging a dithered error recovers information a locked one has destroyed, while a comparator’s output is a decision that nothing averages and every extra transition is a whole event.

And one bit, and where the noise went is the case where a converter deliberately makes its error worse in total in order to move it: putting the quantiser inside a loop with an integrator takes the in-band noise down 8.99 dB per doubling of the rate against oversampling’s 3.01, at the cost of a great deal more error out of band. Both essays are about distribution rather than magnitude, and both are only available because the total is fixed and known — which is what this essay measures and why it has to come first.

Part 3 on quantisation

One argument about Quantisation, and one of 4 essays on it so far, each part numbered by how much of the idea it assumes. What sits either side of it:

What links here

Essays that reach for this one mid-argument — the half of a link its own author cannot write down, the 8 sharing most with it of 11.

The objects named here

The third axis, after the field and the idea: the things themselves, and every essay that touches each one.

Correlation timeDitherEffective bitsQuantisationTotal harmonic distortion