Where a signal becomes a number

The integrator that leaks the zero away

A noise-shaping loop puts its error's zero at zero frequency because its integrators never forget. An integrator built round an amplifier of gain A forgets a part in A every sample, and the zero moves off zero frequency to a floor. The cost is a function of one number, the oversampling ratio over π times the gain: for two leaky integrators it is 10 log(1 + (10/3)x² + 5x⁴), which the marched loops follow to within two decibels from gains of 10 to 300, and keeping it under a decibel needs a gain of 1.2 times the oversampling ratio. A first-order loop pays a second way: inputs within exactly 1/(2A − 1) of zero leave its output where it was.

Assumes: One bit, and where the noise went · The ideal amplifier, and where it stops being one

Every noise-shaping loop marched so far has had perfect integrators. The loop that is worse at full scale closed by naming the integrator as the part that would make its march a circuit, and the levels the loop cannot shape found the other analogue part of a loop — the levels it feeds back — passing its errors straight through. That leaves the integrator itself.

An integrator in a switched-capacitor loop is an amplifier with a capacitor round it, and the amplifier has a finite gain — the quantity the ideal amplifier, and where it stops being one measured as the first departure from the ideal. Each sample, the charge on the capacitor is not quite held: a part in roughly the amplifier’s gain drains away, so the integrator’s pole sits at 1−1/A1 - 1/A rather than at one. The average an integrator can hold measured what that leak does to an integrator used to average noise. In a shaping loop it does something more specific. The integrator’s pole at one is what puts the loop’s noise-transfer zero at zero frequency, and a pole at 1−1/A1 - 1/A moves the zero off it. The error that the loop was supposed to drive to nothing at direct current is left with a floor.

A second-order four-bit loop whose integrators are built round amplifiers of finite gain: the ratio in the band against oversampling. computed by solving, not by drawing: each integrator's pole at 1 − 1/A, half-scale input, half a step of shaped dither, three seeds averaged, squared Hann window. With perfect integrators the ratio rises 15.1 dB an octave, to 138.9 dB at 512. With A = 1000: 138.5 dB at 512, 0.4 below; with A = 100: 122.3 dB at 512, 16.6 below; with A = 30: 102.9 dB at 512, 35.9 below; with A = 10: 85.0 dB at 512, 53.9 below. Each curve leaves the ideal one near a ratio of about πA; for A = 10 the last octave gains 2.7 dB against the ideal's 15.1 — toward the three an octave a floor that is not shaped improves at.
Fig. 1 A second-order four-bit loop whose integrators are built round amplifiers of finite gain: the signal-to-noise ratio in the band against the oversampling ratio. With perfect integrators it rises 15.1 dB an octave to 138.9 dB at a ratio of 512. With gains of 1000, 100, 30 and 10 it reaches 138.5, 122.3, 102.9 and 85.0 dB at 512. Each curve leaves the ideal near a ratio of about π times the gain; for a gain of ten the last octave gains 2.7 dB against the ideal’s 15.1.

The loop, and the leak put into it

The loop is the one the previous essay used: two integrators in a chain with the quantiser fed back into both with weights one and two, so that with perfect integrators its noise transfer is exactly (1−z−1)2(1 - z^{-1})^2. The quantiser has four bits, sixteen levels, and half a step of dither added at its input — inside the loop, so the dither is shaped with everything else. Both choices are there to make the error white. Undithered, a four-bit loop at half scale settles into patterns that move one record’s measured noise by several decibels from one setting to the next, and a leak’s cost of a decibel or two would be lost in them. Three seeds are averaged for each point, and the error is measured through a squared Hann window, for the reason the previous essay gave.

The leak is put in the simplest way it can be: each integrator’s state is multiplied by p=1−1/Ap = 1 - 1/A before the new sample is added. That is the first-order effect of an amplifier of gain AA in a switched-capacitor integrator whose two capacitors are equal; with unequal capacitors the pole moves by a multiple of 1/A1/A set by their ratio, and AA in every figure here should be read as that effective gain.

Leaving the line near π times the gain

The hero figure’s ideal curve rises fifteen decibels an octave, the second-order law that one bit, and where the noise went first measured on a one-bit loop. The leaky curves follow it at low ratios and leave it at higher ones, and where each leaves is set by its gain. A gain of a thousand costs four tenths of a decibel at a ratio of 512. A gain of a hundred costs 16.6 decibels there; thirty costs 35.9 and ten costs 53.9. A gain of ten, at the highest ratios, gains only 2.7 decibels an octave, close to the three an octave that an unshaped floor improves at as it is spread over a wider band.

The departure is not gradual in the way a fixed loss would be. It is a change of slope: the leaky loop stops gaining the fifteen decibels an octave that shaping provides and starts gaining only what averaging provides. That is what a floor in the error’s spectrum does. Once the band reaches down past the floor, a wider sample rate spreads the floor over more bandwidth and keeps a smaller share of it in the band — three decibels an octave — while the shaped part above the floor keeps falling. The two meet where the floor’s corner frequency passes the band edge, and that is where each curve bends.

One variable

The corner can be located exactly. A leaky integrator’s noise-transfer zero sits at p=1−1/Ap = 1 - 1/A, and near zero frequency ∣1−p e−jω∣2|1 - p\,e^{-j\omega}|^2 is very nearly a2+ω2a^2 + \omega^2 with a=1/Aa = 1/A: flat at a2a^2 below ω=a\omega = a and rising as ω2\omega^2 above it. The band reaches to ωB=π/OSR\omega_B = \pi/\mathrm{OSR}. So the whole effect of the leak depends on one number, the ratio of the corner to the band edge,

x=aωB=OSRπA,x = \frac{a}{\omega_B} = \frac{\mathrm{OSR}}{\pi A},

and integrating the shaped error over the band with and without the leak gives the loss in closed form. With one leaky integrator the band’s error is ∫(a2+ω2) dω\int (a^2 + \omega^2)\,d\omega against ∫ω2 dω\int \omega^2\,d\omega, a ratio of 1+3x21 + 3x^2. With two it is ∫(a2+ω2)2 dω\int (a^2 + \omega^2)^2\,d\omega against ∫ω4 dω\int \omega^4\,d\omega, a ratio of 1+103x2+5x41 + \tfrac{10}{3}x^2 + 5x^4. If only the first of two integrators leaks, ∫(a2+ω2) ω2 dω\int (a^2 + \omega^2)\,\omega^2\,d\omega against the same, 1+53x21 + \tfrac{5}{3}x^2.

The decibels a leaky integrator costs, against one number: the oversampling ratio over π times the amplifier's gain. computed by solving, not by drawing: four-bit loops with half a step of shaped dither, three seeds a point, at gains from 10 to 300 and ratios from 16 to 512, each against the same loop with perfect integrators. Every point falls on a curve of x = OSR/(πA) alone, the closed forms 1 + 3x² for one integrator, 1 + (10/3)x² + 5x⁴ for two and 1 + (5/3)x² when only the first of two leaks, to within 1.96 dB up to x = 2 — the closed form overstating a little, most at A = 10, where the leak is no longer small beside one. At x = 1, where the leak's pole sits at the band edge, the costs are 6.0, 9.7 and 4.3 dB; for less than a decibel the second-order loop needs x below 0.265.
Fig. 2 The decibels a leaky integrator costs, against the oversampling ratio over π times the amplifier’s gain, for four-bit loops at gains from 10 to 300 and ratios from 16 to 512. Every marched point lies within 1.96 dB of the closed forms up to x of two — one plus three x squared for one integrator, one plus ten thirds x squared plus five x to the fourth for two, one plus five thirds x squared when only the first of two leaks. At x of one the costs are 6.0, 9.7 and 4.3 dB; for less than a decibel the second-order loop needs x below 0.265.

Gains from ten to three hundred and ratios from sixteen to 512 collapse onto three curves of xx alone. That is the strong form of the claim: the leak’s cost is not a function of the gain and the ratio separately but of their quotient, so a loop running at a ratio of 64 with integrators of gain 30 pays what one at 256 with gain 120 pays. The marched points lie within two decibels of the closed forms everywhere up to x=2x = 2, and the closed forms overstate the cost a little, most at a gain of ten, where p=0.9p = 0.9 is no longer close enough to one for ∣1−p e−jω∣2|1 - p\,e^{-j\omega}|^2 to be a2+ω2a^2 + \omega^2.

The design number comes straight out. For the second-order loop to lose less than a decibel, 1+103x2+5x41 + \tfrac{10}{3}x^2 + 5x^4 must stay under 100.110^{0.1}, which needs xx below 0.265 — an amplifier gain of at least OSR/(0.265π)\mathrm{OSR}/(0.265\pi), which is 1.2 times the oversampling ratio. A loop at a ratio of 128 needs integrators of gain 154 for a decibel and 490 for a tenth. That rule, “a gain about equal to the oversampling ratio”, is quoted widely and here it has a derivation and a coefficient.

The third curve answers a question designers argue about: which integrator’s gain matters? For the error the loop shapes, the two leaks contribute symmetrically to second order in xx — each zero’s displacement adds 53x2\tfrac{5}{3}x^2 — so the first integrator is no more important than the second. Leaking one of the two costs 4.3 decibels at x=1x = 1, both 9.7; the extra is the 5x45x^4 term, which is the two floors multiplying each other. The first integrator matters more for its own noise and its own nonlinearity, which reach the output unshaped, and those are different questions from the leak. They are the integrator’s version of what two loops, and the mismatch between them found in a cascade: an analogue error placed before the shaping is passed, and one placed after it is shaped.

The floor in the spectrum

The closed form is an integral of a shape, and the shape can be seen directly.

The error in the band at a ratio of 256, with perfect integrators and with integrators of gain 300. computed by solving, not by drawing: one record each with half a step of shaped dither, the error's lines averaged eight at a time. With perfect integrators the error rises forty decibels a decade across the whole band, from -208 dB at its bottom to -151 at its edge. With A = 300 it is flat at -170 dB below line 70, where the leaks' poles sit — the record length over 2πA — and joins the ideal curve above it. The dashed curves are |1 − p·z⁻¹|⁴ on the unit circle for p = 1 and p = 1 − 1/300, scaled once to the ideal loop's level in the middle of the band.
Fig. 3 The error in the band at a ratio of 256, one record each with half a step of shaped dither, its lines averaged eight at a time. With perfect integrators it rises forty decibels a decade across the whole band, from minus 208 dB at its bottom to minus 151 at its edge. With integrators of gain 300 it is flat at minus 170 dB below line 70, where the leaks’ poles sit, and joins the ideal curve above it. The dashed curves are the predicted shapes, scaled once to the ideal loop’s level in the middle of the band.

The ideal loop’s error falls without limit toward zero frequency, which is the zero doing its work. The leaky loop’s error falls with it down to line 70 and then stops, flat at minus 170 decibels. Line 70 is the record’s length divided by 2πA2\pi A, the frequency at which ω=1/A\omega = 1/A, and the flat part is a2a^2 squared — the two displaced zeros together. Above the corner the two curves are one curve, because there the leak is negligible beside the frequency, and that is why the loss depends only on how much of the band lies below the corner: at a ratio of 256 and a gain of 300 it is about a quarter of the band, x=0.27x = 0.27, and the loss is a decibel.

The dashed curves are ∣1−p e−jω∣4|1 - p\,e^{-j\omega}|^4 for pp of one and of 1−1/3001 - 1/300, scaled once to the ideal loop’s measured level in the middle of the band and otherwise not fitted. Both marched spectra follow them from the bottom of the band to the top. That is the second route to the same number: the hero figure’s loss was read off a ratio, and here the same loss is visible as an area under a curve whose shape was written down before the march.

Where to stop oversampling

The closed form also says when a faster clock stops being worth having. Each doubling of the ratio buys the ideal second-order loop fifteen decibels, two and a half bits. Past the corner, where xx is above one, the same doubling buys three decibels — half a bit — and costs the same power and the same settling time in every integrator. So the gain of the amplifiers sets a ratio beyond which oversampling is the expensive way to buy resolution.

In numbers: with integrators of gain a hundred the loss is a decibel at a ratio of 83, 7.3 decibels at 256 and 16.6 at 512. The step from 256 to 512 buys the ideal loop 15.1 decibels and the leaky loop 5.8. A designer at that point who wants more resolution gets more of it from a third integrator, whose zero also leaks but adds a power of ω\omega above the corner, or from a better amplifier, whose gain moves the corner down — not from the clock.

Expressed in bits, a loss of 9.7 decibels at x=1x = 1 is 1.6 bits, which is the price of running the ratio up to π times the amplifier’s gain; a loss of one decibel, at x=0.265x = 0.265, is a sixth of a bit. The second figure is the one worth designing to. The word length that is not a threshold went looking for a digital filter’s required coefficient resolution and found no threshold, only a law with a slope; the integrator’s gain is the same kind of quantity, and the closed form is its law — there is no gain at which the loop starts working, only a cost that falls as the square of the gain.

A first-order loop pays twice

A loop of first order with one bit is where leaks were first studied, and there the floor is not the main cost. A first-order one-bit loop driven by a constant input settles into a repeating pattern of plus and minus ones whose mean is the input; with a perfect integrator any input, however small, eventually tips the pattern. With a leak, small enough inputs never do.

A first-order one-bit loop with an integrator of gain 30: the error in its mean output against a constant input. computed by solving, not by drawing: the loop marched for thirty-six thousand samples — a whole number of every short pattern — at each input from 0 to 0.5 in steps of a thousandth. With a perfect integrator the mean is the input to two parts in ten thousand. With A = 30 it is held at zero for inputs up to 0.0169 — exactly 1/(2A − 1) — at a third for inputs from 0.3336 to 0.3558, and at a half from 0.5088 to 0.5251, while elsewhere the mean runs below the input by a gain error of the leak's size. Each flat run is a pattern of outputs the leak lets the loop keep: the input moves and the output does not.
Fig. 4 A first-order one-bit loop with an integrator of gain 30: the mean output minus a constant input, for inputs from 0 to 0.5 in steps of a thousandth, each marched for thirty-six thousand samples. With a perfect integrator the mean is the input to two parts in ten thousand. With gain 30 the output is held at zero for inputs up to 0.0169, exactly 1/(2A − 1); at a third for inputs from 0.3336 to 0.3558; and at a half from 0.5088 to 0.5251. Elsewhere the mean runs below the input by a gain error of the leak’s size.

The figure is a staircase with long treads. Near zero the output’s mean is zero for every input up to 0.0169, a dead zone. Near a third the output is held at exactly a third for inputs from 0.3336 to 0.3558, near a half at exactly a half from 0.5088 to 0.5251, and there are smaller treads at every other simple fraction. On each tread the input moves and the output does not: the loop has found a pattern it can repeat, and the leak drains the integrator by just enough each cycle to cancel what the input’s small excess adds.

The zone at zero can be solved by hand, which is what makes the figure trustworthy. With the pattern +1,−1+1, -1 the integrator’s state alternates between two values, and the pattern survives as long as the state goes on changing sign each sample. Writing the two states out and asking when they keep their signs gives a dead zone of half-width exactly (1−p)/(1+p)(1 - p)/(1 + p), which with p=1−1/Ap = 1 - 1/A is 1/(2A−1)1/(2A - 1). The bisected edge agrees to every digit printed: 0.01695 at a gain of 30.

These zones are the analogue relatives of the dead band zero in, and not zero out found in a rounded digital filter — a state the arithmetic will not leave because the correction it needs is smaller than what the loop can resolve — and they are the constant-input form of the tones a floor, or five tones measured in the band. A loop held on a tread produces a pure pattern, all of its error in a few lines.

Every zone narrows as the gain, and none closes

The width of a leaky first-order loop's dead zones at zero, a half and a third, against the integrator's gain. computed by solving, not by drawing: each zone's edge bisected on the mean of a marched output. About zero the half-width is 5.263e-2, 1.695e-2, 5.025e-3, 1.669e-3, 5.003e-4, 1.667e-4 for A = 10, 30, 100, 300, 1000, 3000 — 1/(2A − 1) to five significant figures, the idle pattern +1, −1 staying a pattern while the leak drains less than the input adds. About a third it is 0.334/A and about a half 0.254/A at the largest gain. Zero is held by the pattern +1, −1, a third by +1, +1, −1 and a half by +1, +1, +1, −1: the half-width is close to one over the pattern's length times A. Every zone narrows as the inverse of the gain; none closes.
Fig. 5 The half-width of a leaky first-order loop’s dead zones at zero, a third and a half, against the integrator’s gain, each edge bisected on the marched mean. About zero it is 1/(2A − 1) to five significant figures at every gain from 10 to 3000. About a third it is 0.334 over A and about a half 0.254 over A at the largest gain. The half-width is close to one over the pattern’s length times the gain: two for zero, three for a third, four for a half.

The zero zone follows 1/(2A−1)1/(2A - 1) to five figures across two and a half decades of gain, from 0.0526 at ten to 0.000167 at three thousand. The zone about a third is held by the pattern +1,+1,−1+1, +1, -1 and has half-width 0.334/A0.334/A; the zone about a half is held by +1,+1,+1,−1+1, +1, +1, -1 and has 0.254/A0.254/A. Read together the three say that a pattern of length qq holds its value over a half-width close to 1/(qA)1/(qA). A longer pattern is held over a narrower range, which is why the figure’s treads at simple fractions are wide and the ones at complicated fractions are invisible.

Every zone narrows as the inverse of the gain and none closes at any finite gain. That is the practical content. For a measurement converter whose input can sit still — a weighing scale, a thermometer, a slow sensor — a first-order loop with integrators of gain a thousand will not resolve a change of less than a part in two thousand near zero, whatever its oversampling ratio. The second-order loop’s floor and the first-order loop’s dead zone are the same leak; the floor is how it looks to a moving input and the zone is how it looks to a still one.

Why the dither does not hide the zones

The second-order figures use dither and the first-order ones do not, and the difference is deliberate. Dither added inside the loop breaks a pattern by perturbing the state every sample, and enough of it would blur a dead zone into a slope. But the measurement here is of the loop the leak produces, and a one-bit first-order loop with dither is a different circuit with different numbers. What the dead-zone figures say is what a plain loop does; what a dithered one does is a question about how much dither a given leak needs, which this essay leaves open.

What the march leaves out

The leak is one number per integrator, a pole at 1−1/A1 - 1/A. A real amplifier’s gain is not constant: it falls with the size of the signal, so a loop whose integrators swing widely has a leak that varies through the cycle, which bends the transfer as a level error does and makes harmonics. The integrators also settle in finite time, and an incomplete settling is a second gain error per sample of the same order as the leak.

The closed form assumes the leak is small beside one. At a gain of ten it overstates the cost by up to two decibels, which the figure shows rather than hides. And the dead-zone figures assume a constant input; a slowly moving input crosses each zone and spends a time in it proportional to the zone’s width over the input’s rate, which is the next measurement for a sensor converter.

The number to keep

An integrator round an amplifier of gain AA moves the loop’s noise zero to 1−1/A1 - 1/A and puts a floor under the band. Its cost depends only on x=OSR/(πA)x = \mathrm{OSR}/(\pi A): 1+3x21 + 3x^2 for one integrator, 1+103x2+5x41 + \tfrac{10}{3}x^2 + 5x^4 for two, which the marched loops follow within two decibels. Under a decibel needs a gain of 1.2 times the oversampling ratio. A first-order one-bit loop also holds its output still for inputs within exactly 1/(2A−1)1/(2A - 1) of zero, and within close to 1/(qA)1/(qA) of any value its pattern of length qq can repeat.

Still open: the dither a leak needs, the moving input, and the gain that is not constant

The dither that dissolves a dead zone. Dither inside the loop breaks a pattern, and the question is how much: whether dither of the zone’s own width, 1/A1/A of full scale, is enough to turn the staircase into a slope, and what that dither costs in the band at the ratio a sensor converter runs at.

An input that moves through the zones. A slow ramp crosses the zone at zero in a time set by its rate and the zone’s width, and the output stays still for all of it. Marching a ramp through the first-order loop would turn the half-width here into a time and say what resolution a slowly drifting measurement actually gets.

A gain that falls with the signal. An amplifier’s gain is highest near the middle of its range and lower at the ends, so a loop whose integrators swing far has a leak that changes through every cycle. That is a level error made by the integrator rather than by the converter, and whether it shows the same harmonics the previous essay found — and at what swing — is the measurement that would join the two analogue parts of the loop.

Part 6 on Noise-shaping

One argument about Noise-shaping, and one of 6 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 objects named here

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

Dynamic rangeIdle tonesIntegratorNoise-shapingOversamplingSigma deltaSpectral densityVerification