Where a signal becomes a number

The steps noise cannot even out

Half a step of front-end noise makes an equal-step converter's mean transfer a straight line to 1.6 thousandths of a step. A real converter's steps differ in width, and the same noise leaves it 1.75 steps wrong, rms, over twenty codes — almost exactly the 1.78 its bare staircase had. Noise averages the step widths, but only over the few codes it spans: the residual differential nonlinearity falls as one over √σ, 0.098 steps through one step of noise and 0.020 through sixteen, where equal steps fall to nothing. Their running sum, the integral nonlinearity, is a random walk across the whole range, and noise barely touches it: 0.55 steps rms through one step of noise, 0.39 through sixteen. So averaging a static reading through one step of noise pays for about four readings and then stops at 0.55 steps, where equal steps go on falling as 1/√N to 0.016 at 4,096. Both residues are in proportion to the step spread — 0.55 and 3.4 times it, over forty seeded converters.

Assumes: The floor a converter sets

The noise that was already a dither found that a converter’s own front-end noise does a dither’s work. Gaussian noise of half a step or more makes the quantiser’s error, averaged over the noise, independent of where the input sits: the mean transfer becomes a straight line, the staircase disappears from every average, and the converter behaves as an ideal linear device with a little noise added. That result, like one step of dither per moment before it, was a result about a converter whose steps are all exactly one step wide.

No converter’s are. A converter’s thresholds are set by resistor strings, capacitor arrays or comparator offsets, each with its own tolerance, so the codes it produces are of slightly different widths — the departure of each from the average is its differential nonlinearity, and the running sum of those departures, the distance each threshold has wandered from where it should be, is its integral nonlinearity. That essay ended by naming the measurement it had not made: how much of a converter’s unequal steps a few steps of noise average away, and what is left. The answer separates the two nonlinearities cleanly, because noise reaches one of them and not the other.

The mean transfer, in closed form

A converter’s output is the number of thresholds its input lies above. With Gaussian noise of standard deviation σ\sigma added, each threshold tkt_k is passed with probability Φ((x−tk)/σ)\Phi((x - t_k)/\sigma), and the mean output is the sum of those probabilities:

yˉ(x)=∑kΦ ⁣(x−tkσ).\bar y(x) = \sum_k \Phi\!\left(\frac{x - t_k}{\sigma}\right) .

That is exact for any thresholds, and it needs no sampling. The converter here has 256 codes; its 254 inner steps’ widths are seeded with a spread — 20 per cent of a step unless stated — and renormalised so that their mean is exactly one, which puts the thresholds where a real converter’s would be after its gain and offset are trimmed.

Through 0.5 steps of noise an equal-step converter's mean error is 1.6e-3 steps rms; one whose steps differ by 20% keeps 1.754computed by solving, not by drawing: the mean output of an 8-bit converter less its input, over twenty codes, as the expected number of thresholds below the input with Gaussian noise of σ = 0.5 steps added. Equal steps (solid): 1.62e-3 steps rms. Inner steps whose widths are seeded with a 20% spread and renormalised to a mean of one (dashed): 1.754 steps rms, and the same converter with no noise (faint), the bare staircase, 1.779. Noise turns the staircase into a smooth curve; with equal steps the curve is the straight line, and with unequal steps it is a straight line plus the wander the step widths add up to.-2-1012100104108112116120input (steps of an ideal 8-bit converter)mean output less input (steps)equal steps, σ 0.50.002 steps rmsunequal steps, σ 0.51.754 steps rmsunequal steps, no noise1.779 steps rmssolved, then checked — the mean, in closed formsmooth, and still wrong
Fig. 1 The mean output less the input over twenty codes of an 8-bit converter, through Gaussian noise of 0.5 steps. Equal steps: 1.62 × 10⁻³ steps rms. Inner steps whose widths have a 20 per cent spread: 1.754 steps rms, against 1.779 for the same converter’s bare staircase with no noise at all.

With equal steps, half a step of noise does what the earlier essay found: the staircase becomes a straight line through the input, and the mean error over these twenty codes is 1.6 thousandths of a step. With unequal steps the staircase becomes a smooth curve too, but not a straight one. It wanders, and the wander is almost the same size as the bare staircase’s error — 1.754 steps against 1.779. The noise has rounded off every step and done next to nothing about where the steps are.

The slider on the figure at the head of the page sets the noise to half a step, one or two. The equal-step curve is a straight line at all three; the unequal one keeps its wander at all three.

What noise averages: the step widths, over a few codes

The local part of the error is the slope of the mean transfer. An ideal converter’s slope is one; a staircase’s is zero between thresholds and infinite at them; noise smooths it, and the departure of the smoothed slope from one is the differential nonlinearity the noise leaves.

Noise averages the step widths but only over the codes it spans: the residual differential nonlinearity falls as 1/√σ, 0.098 steps at σ = 1 and 0.020 at 16, where equal steps' falls to nothing. computed by solving, not by drawing: the slope of the mean transfer, less one, rms over the interior codes (at least four σ clear of either end), against the noise σ. Steps with a 20% spread (solid): 0.25: 0.4625, 0.5: 0.1530, 1: 0.0983, 2: 0.0620, 4: 0.0404, 8: 0.0259, 16: 0.0204. Equal steps (dashed): 4.1e-1, 1.0e-2, 3.8e-9, 4.8e-12, 1.6e-10, 4.3e-6, 6.1e-6 — the ripple of a Gaussian-smoothed staircase, which vanishes once σ passes half a step. The unequal residue falls with slope -0.54, as 0.44 times the spread over √σ: a Gaussian of σ steps averages a number of independent widths in proportion to σ.
Fig. 2 The residual differential nonlinearity — the mean transfer’s slope, less one, rms over the interior — against the noise. Steps with a 20 per cent spread: 0.463 at σ = 0.25, 0.153 at 0.5, 0.098 at 1, 0.062 at 2, 0.040 at 4, 0.026 at 8 and 0.020 at 16. Equal steps: 0.41 and 0.010 at 0.25 and 0.5, then below 10⁻⁸.

For equal steps the smoothed slope is the ripple of a Gaussian-blurred staircase, and that ripple dies faster than any power once the noise passes half a step — 0.010 at σ = 0.5, below a hundred-millionth at one. For unequal steps it does not die. It falls with a slope of about −0.5 on these axes: 0.098 steps at σ = 1, 0.062 at two, 0.040 at four, 0.020 at sixteen, which is about 0.44 times the step spread over σ\sqrt\sigma.

That is the signature of averaging independent quantities. The smoothed slope at any input is a weighted average of the step widths near it, weighted by the Gaussian, and a Gaussian of σ\sigma steps averages about a number of widths in proportion to σ\sigma. Independent widths averaged over nn of them have a spread falling as 1/n1/\sqrt n. So noise does reduce the differential nonlinearity — by a factor of about two at one step, five at four, ten at sixteen — but at the pace of averaging, not at the pace of the ripple, and it never reaches zero.

What noise cannot reach: the running sum

The integral nonlinearity is a different object. Each threshold sits where the widths below it add up to, so the departure of threshold kk from where it should be is the sum of the first kk width errors: a random walk across the converter’s range, which wanders far from zero over tens of codes and comes back only because the widths were renormalised to end in the right place.

Noise barely reaches the running sum of the step errors: the integral nonlinearity is 0.55 steps rms through one step of noise and 0.39 through sixteen. computed by solving, not by drawing: the mean transfer less a straight line fitted through the interior, across the whole range, for the converter with a 20% step spread, through 1 step of noise (solid) and 16 (dashed). Rms against the noise: σ 0, 0.634; σ 0.5, 0.559; σ 1, 0.550; σ 2, 0.534; σ 4, 0.511; σ 8, 0.479; σ 16, 0.391 steps. Each threshold sits where the widths below it add up to, a random walk of 254 steps of spread 0.2, and noise of a few steps smooths that walk only on the scale of a few codes, leaving its long excursions — tens of codes wide — where they were; sixteen steps of noise begin to take the shorter ones off.
Fig. 3 The mean transfer less a straight line fitted through the interior, across the whole range, through 1 and 16 steps of noise, for a 20 per cent step spread. Rms: 0.634 steps bare, 0.559 through 0.5 steps of noise, 0.550 through 1, 0.534 through 2, 0.511 through 4, 0.47 through 8 and 0.39 through 16.

The walk’s excursions are tens of codes wide, and noise of a few steps smooths only on the scale of a few codes. Through one step of noise the integral nonlinearity is 0.550 steps rms, against 0.634 for the bare staircase — the small difference being the staircase’s own half-step ripple, which the noise removes. From there it barely moves: 0.534 through two steps, 0.511 through four. Only at sixteen steps of noise, when the Gaussian is wide enough to span the walk’s shorter excursions, does it fall appreciably, to 0.39, and by then the noise itself is sixteen steps — nearly four bits of a converter’s resolution spent on noise to remove a third of an error of half a step.

So the two nonlinearities are separated by scale. The differential is about individual steps, and noise of a few steps averages it as it would average any independent errors. The integral is about where many steps add up to, and noise averages only what it spans. A dither, which the earlier essays treated as the remedy for a quantiser’s error, is a remedy for the first and not the second. When a floor stops being a floor found quantisation error ceasing to behave as noise at small amplitudes; an integral nonlinearity never behaved as noise at any amplitude.

What averaging a reading buys

The practical consequence is for a converter used the way a measurement uses one: a static input, read many times, the readings averaged. With equal steps and a step of noise the average converges on the input as 1/N1/\sqrt N, which is the reason to add noise at all.

Averaging through one step of noise: equal steps fall as 1/√N to 0.016 steps at 4096 readings; unequal ones stop at 0.55, which they reach by about 4. computed by solving, not by drawing: a static input read N times through 1 step of Gaussian noise and the readings averaged; the average's error, root-mean-square over inputs across the interior, as √(variance/N + mean error²), the output's variance computed from its exact distribution over codes and the mean error measured from the fitted line. Equal steps: variance 1.0833 steps², mean error 4.5e-10; 1: 1.041, 4: 0.520, 16: 0.260, 64: 0.130, 256: 0.065, 1024: 0.033, 4096: 0.016. A 20% step spread: variance 1.0944, mean error 0.550; 1: 1.182, 4: 0.759, 16: 0.609, 64: 0.565, 256: 0.554, 1024: 0.551, 4096: 0.550. Averaging beyond about 4 readings buys the unequal converter nothing: the error left is the converter's, not the noise's.
Fig. 4 A static input read N times through one step of noise and averaged; the error of the average, rms over inputs across the interior. Equal steps: variance 1.0833 steps², which is the noise plus a twelfth; 1.041, 0.520, 0.260, 0.130, 0.065, 0.033 and 0.016 steps at 1 to 4,096 readings. A 20 per cent step spread: variance 1.0944, mean error 0.550; 1.182, 0.759, 0.609, 0.565, 0.554, 0.551 and 0.550 steps.

The equal-step converter’s averaged error falls without limit: 0.52 steps at four readings, 0.13 at sixty-four, 0.016 at 4,096 — resolution well below a step, bought with time. The unequal one falls for a few readings and stops. At four readings it is 0.76 steps, at sixty-four 0.565, and from there it does not move, because the error left is the mean transfer’s departure from a straight line, which no number of readings averages away. The variance is the converter’s noise plus a twelfth of a step in both cases — the steps’ unevenness hardly changes the scatter — so the crossover comes when the scatter over NN falls below the mean error, at about four readings.

A designer who expects averaging to buy resolution below a step is buying it only from the converter’s differential nonlinearity, and the integral nonlinearity sets a floor under the average that is half a step here. Six decibels a bit, and the half step blamed on it found a converter’s measured noise short of its ideal and the shortfall blamed on the half step; the floor here is the same kind of quantity, and it belongs to the thresholds, not to quantisation. The floor a converter sets found a converter’s useful resolution set by the circuit in front of it; the integral nonlinearity is a second limit set by the converter’s own thresholds, and averaging reaches neither.

Both residues follow the spread

The figures so far are one seeded converter. Over forty — eight seeds at each of five spreads — the two residues are both in proportion to the spread, and the constants are worth having.

Through one step of noise, over eight seeded converters each: residual differential nonlinearity 0.552 times the step spread, integral 3.4 times it. computed by solving, not by drawing: for step spreads of 5%, 10%, 20%, 30%, 50%, the mean over eight seeded converters of the residual differential and integral nonlinearity through σ = 1 step of noise. 5%: 0.0276 and 0.172 steps rms; 10%: 0.0552 and 0.345 steps rms; 20%: 0.1101 and 0.690 steps rms; 30%: 0.1648 and 1.035 steps rms; 50%: 0.2659 and 1.699 steps rms. Both are in proportion to the spread: noise divides the step errors by about 1.8 locally and leaves their running sum, which over 254 codes grows as the square root of the codes it spans.
Fig. 5 Through one step of noise, the mean over eight seeded converters of the residual differential and integral nonlinearity for step spreads of 5, 10, 20, 30 and 50 per cent: 0.0276 and 0.172 steps rms; 0.0552 and 0.345; 0.110 and 0.690; 0.165 and 1.035; 0.266 and 1.699.

The residual differential nonlinearity through one step of noise is 0.55 times the spread, so a converter whose steps differ by five per cent shows 2.8 hundredths of a step of it, and the noise has divided its step errors by about 1.8. The integral nonlinearity is 3.4 times the spread, and it is the larger by a factor of six at every spread. That ratio is a property of the random walk and of the converter’s length. A walk of 254 steps pinned at both ends wanders, rms over its range, by about 254/6\sqrt{254/6} — six and a half — times its step spread, and fitting a straight line through it, as a gain and offset trim does, removes its largest and slowest component and leaves about half, the 3.4 measured. A converter with more codes and the same spread has a larger integral nonlinearity in steps, by the square root of its length, and the same differential one.

What the floor is worth in bits

The averaging figure’s two curves can be read as resolution. An ideal 8-bit converter’s quantisation error, with no noise, is a step over 12\sqrt{12} — 0.289 steps rms — and that is the yardstick against which a converter’s bits are counted. With equal steps and a step of noise, averaging 4,096 readings brings the error to 0.016 steps, eighteen times smaller than the yardstick, which is about four bits more than the converter has: the familiar trade of oversampling and averaging for resolution, at a cost of a bit for every factor of four in readings.

With a 20 per cent step spread the floor is 0.55 steps, nearly twice the yardstick. Averaging does not merely fail to add bits; it cannot reach the eight the converter is labelled with, because the error it converges on is the integral nonlinearity, and that is larger than an ideal converter’s quantisation error. The converter’s resolution and its accuracy have come apart. Its codes are separated by one step, and a reading of a static input can be repeated to a sixtieth of a step by averaging; what that repeatable reading means, in terms of the input, is uncertain by half a step.

That distinction is the one a measurement has to keep straight. Averaging buys repeatability, which is a property of the noise, and the integral nonlinearity limits accuracy, which is a property of the thresholds. A spread of 20 per cent is not extreme: the largest of 254 independent step errors drawn with that spread sits near three spreads, about six tenths of a step, which is inside the half-step-to-one-step differential nonlinearity a modest converter’s datasheet promises. The integral nonlinearity it implies, about half a step rms and more at its worst, is what that datasheet’s other line is for.

Why this is the right split of a converter’s specification

Converter datasheets quote differential and integral nonlinearity separately, and the measurement here says why the separation is not bookkeeping. They respond differently to everything a system does around the converter. Noise and dither reduce the first and leave the second. Averaging reduces the first and leaves the second. A calibration against a known reference at a few points reduces the second — it straightens the long excursions — and leaves the first, which varies code by code faster than any few-point calibration can follow.

The dither that is a decision found that a dither’s amplitude is a choice that trades noise against the linearity of the mean, on a converter whose steps were equal. On a real converter the choice has a ceiling: past a step or two of dither the residual differential nonlinearity falls only as 1/σ1/\sqrt\sigma while the noise rises as σ\sigma, and the integral nonlinearity does not fall at all. The amount of dither worth adding is set by the converter’s own step spread rather than by the quantisation the earlier essays analysed.

Two routes to the mean

The closed form for the mean output is a sum of normal probabilities, and it is worth checking against what a converter actually reports. Its variance is checked in the averaging figure: computed from the exact distribution of output codes, it is 1.0833 steps² for equal steps through one step of noise — the noise’s one plus quantisation’s twelfth, exactly as the additive model predicts once the noise exceeds half a step. The same distribution, summed for its mean, is the closed form. And the equal-step mean error, 1.6 thousandths of a step at half a step of noise and below a hundred-millionth at one, is the earlier essays’ result reproduced by a different route: they measured it by drawing samples, and the sum of probabilities reaches it without drawing anything.

Why the widths were made to add up

Every converter here has its step widths renormalised so that they average exactly one step, and its integral nonlinearity is read from a straight line fitted through its interior. Both choices remove the errors a converter’s gain and offset trims would remove, and they are made so that what is left is the part no trim reaches. Without the renormalisation the thresholds’ random walk would end wherever it happened to, and the converter would show a gain error proportional to the walk’s end — a single number, which a two-point calibration corrects exactly and which says nothing about noise. With it, the walk is pinned at both ends, and the integral nonlinearity is the walk’s wandering between them.

That makes the measured integral nonlinearity a lower bound for a real converter’s. A converter that is not trimmed carries its gain error on top, and one whose step errors are correlated carries larger excursions than an independent walk. Neither changes the separation this essay draws, since both are long-range errors and both sit with the integral nonlinearity on the side noise cannot reach.

What the model leaves out

The step widths are independent. A real converter’s are not: a resistor string’s widths share the string’s gradient, which is a smooth integral nonlinearity on top of the random walk, and a binary-weighted array has its worst steps at the major carries — the transition from 0111 1111 to 1000 0000, where every bit changes at once. Both put structure into the step errors that the seeded spread here does not have, and a gradient is precisely the long excursion noise cannot reach.

The noise is white Gaussian and independent of the input. Front-end noise is filtered, so successive readings’ noise is correlated, and the averaging figure’s 1/N1/\sqrt N holds only for readings far enough apart in time to be independent; for flicker noise that may be a long time.

And the input is static or slowly varying. A fast input crosses many codes during one reading and averages the step widths itself, which is a dither of its own; a sine wave’s distortion from an integral nonlinearity is a question about harmonics, which this essay does not ask.

The numbers to keep

Through half a step of noise an equal-step converter’s mean transfer is straight to 1.6 thousandths of a step, and one whose steps have a 20 per cent spread keeps 1.75 steps of wander over twenty codes. Noise averages step widths over the codes it spans: the residual differential nonlinearity is about 0.44 times the spread over σ\sqrt\sigma — 0.098 steps at σ = 1 for a 20 per cent spread. The integral nonlinearity barely moves: 0.55 steps rms at σ = 1, 0.39 at sixteen. So an averaged static reading improves for about four readings and stops at 0.55 steps, where an equal-step converter keeps falling as 1/N1/\sqrt N. Over forty converters the residues are 0.55 and 3.4 times the step spread.

Still open: a string’s gradient, the major carry, and noise that is not white

Step errors with a shape. A resistor string’s thresholds carry its gradient, a smooth bow under the random walk. The moments a layout has to match measured what a gradient and a bow do to a divider built from one array, and a converter’s threshold string is that divider repeated at every tap; the small leg of a large ratio found the random part of such a string’s ratios growing with the ratio. A gradient is a pure integral nonlinearity, invisible to noise, and a two-point calibration removes its linear part. How much of a real string’s nonlinearity a calibration at two, three or five points removes, against the random walk that no calibration of that kind reaches, decides how many calibration points a converter is worth.

The major carry. A binary-weighted converter’s worst differential nonlinearity is at the codes where many bits change together, and it repeats at every power of two. Noise of a few steps averages it as it averages any step, but the error is no longer independent from code to code, and whether a periodic step error is averaged as fast as a random one is a measurement on the same closed form.

Correlated noise as a dither. Filtered front-end noise changes slowly, so consecutive readings see nearly the same noise and average less than independent ones would. Whether a reading rate fast against the noise’s correlation time still averages the step widths as this essay’s white noise does, or sees each step’s own error for many readings in a row, is the question the noise’s spectrum answers.

Part 7 on quantisation

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

The objects named here

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

AveragingDitherModel rangeNonlinearityQuantisation