Where a signal becomes a number

The rounding a section keeps

A fixed-point biquad that remembers its last two rounding errors and adds them back with weights −2 and +1 before it rounds again sends its error to the output through (1 − z⁻¹)²/A(z) instead of 1/A(z). For a low-pass clocked far above its corner that double zero lands exactly on the recursion's largest gain. Fed nothing, an eighth-order 12-bit cascade at 48 times its corner sat 88 least significant bits from zero; with the error kept, a constant state needs (1 + a₁ + a₂)·y = 0, its only solution is zero, and the output never strays more than one bit at any clock rate from 8× to 128×. The round-off floor at 128× falls 89 times, 6.5 bits, for two additions and a shift per section — and the white-noise model, which the plain cascade broke by a factor of ten at eight bits, holds to 2.3% from six bits to twenty.

Assumes: The corner that moved · One bit, and where the noise went

Zero in, and not zero out found the uncomfortable property of a fixed-point recursion clocked well above its corner: it does not settle to zero when its input does. An eighth-order Butterworth cascade at a twelve-bit word length, with its corner at a kilohertz and its clock at 48 kHz, sits 88 least significant bits from zero forever — the cascade being the bilinear-transformed Butterworth of the corner that moved, pre-warped at its corner — and the offset does not shrink with the word length — it grows as the square of how far the corner sits below the sample rate. Oversampling, which improves almost every other quantity in a sampled system, makes this one worse, because each section’s dead band is the quantiser’s step divided by twice the recursion’s own direct-current denominator, 1+a1+a21 + a_1 + a_2, and that denominator vanishes as the poles crowd towards z=1z = 1.

The next two essays measured what can be bought by arranging the same arithmetic differently — the order of the sections in which section goes first, the word length in the word length that is not a threshold. Neither touched the rounding itself. Each section still took its accumulator, rounded it, and threw away what it had rounded off.

A section does not have to throw it away. The error a quantiser makes is known exactly at the moment it is made — it is the difference between the accumulator and the stored word — and it costs one register to keep. Adding the last two errors back into the next accumulator, with weights −2 and +1, is the cheapest change to a biquad that exists, and it removes the dead band outright, lowers the round-off floor by a factor that grows with the oversampling, and makes the noise model that the plain cascade broke true again.

Fed nothing, a 12-bit eighth-order cascade sits 88 least significant bits from zero; with its rounding error fed back, never more than 1computed by solving, not by drawing. The same cascade with its corner at 1 kHz and its clock 48 times higher, each section's state seeded at eight least significant bits and every product rounded to 12 bits, marched with no input. Plainly rounded, the sections settle at 27, 50, 70, 88 least significant bits — a constant state survives whenever rounding returns it to itself, and each section's offset is the next one's input. With each section's last two rounding errors added back with weights −2 and +1, the error reaches the output through (1 − z⁻¹)²/A(z), a constant state y needs (1 + a₁ + a₂)·y = 0, and the only one is zero: the largest excursion over the last two thousand samples is 1, 1, 1, 1 least significant bit, single isolated steps rather than a settled offset.0255075100along the cascade, section by sectionwhere the output sits with no input (least significant bits)123427507088plain rounding (left bars)88 LSB at the outputerror fed back (right bars)at most 1 LSBword length12 bits, clock 48× the cornersolved, then checked — zero in, and nearly zero out(1 + a₁ + a₂)·y = 0 has one root
Fig. 1 An eighth-order Butterworth cascade, corner at 1 kHz, clock at 48 kHz, every product rounded to 12 bits, each section seeded at eight least significant bits and marched with no input. Plainly rounded (left bars) the sections settle at 27, 50, 70 and 88 least significant bits. With each section’s last two rounding errors added back (right bars) none strays more than one bit from zero.

Keeping the error instead of discarding it

A biquad in the form these essays use computes an accumulator from its inputs and its last two outputs, rounds the accumulator to the word length, and stores the rounded value as its output. Write the rounding error as e[n]=y[n]−v[n]e[n] = y[n] - v[n], the stored value less the accumulator. The plain section then obeys

A(z) Y(z)=B(z) X(z)+E(z),A(z)\,Y(z) = B(z)\,X(z) + E(z),

so its error reaches the output through 1/A(z)1/A(z) — the section’s own recursion — and then through every section after it. That first factor is the one the same filter, rounded twice found decisive: an all-pole section with its poles near the unit circle has an impulse response whose energy is hundreds of times the impulse it was given.

Now let the section keep its last two errors and add c1e[n−1]+c2e[n−2]c_1 e[n-1] + c_2 e[n-2] to the accumulator before rounding. The same algebra gives

A(z) Y(z)=B(z) X(z)+(1+c1z−1+c2z−2)E(z).A(z)\,Y(z) = B(z)\,X(z) + \left(1 + c_1z^{-1} + c_2z^{-2}\right)E(z).

The signal path has not changed at all. Only the error’s path has, and it can be given any second-order numerator the designer likes. The choice made here is c1=−2c_1 = -2 and c2=+1c_2 = +1, which makes the numerator (1−z−1)2(1 - z^{-1})^2: a double zero at z=1z = 1, which is zero frequency. For a low-pass section clocked far above its corner that is exactly where 1/A(z)1/A(z) is largest, so the zero sits on top of the pole pair’s gain and cancels most of it. The weights are a doubling and a unit, a shift and an add in any fixed-point machine, which is why the arrangement is worth having rather than merely possible.

The rounding errors still exist and are still the same size, a uniform step of a least significant bit. What has changed is where they go, and the move is the same one one bit, and where the noise went described for a modulator: a quantiser inside a loop whose error is fed back can have its noise pushed out of the band that matters. There the loop was the whole converter and the band was the signal’s. Here the loop is two registers inside one section and the band is near zero frequency, where a low-pass recursion’s gain is large.

Why no constant state survives

The dead band’s disappearance is not statistical, and it follows from the same identity in one line. A dead-band state is a constant output yy held by a constant rounding error ee with no input. Substituting into the section’s update with zero input,

y=−(a1+a2) y+(c1+c2) e+e,y = -(a_1 + a_2)\,y + (c_1 + c_2)\,e + e,

and with c1+c2=−1c_1 + c_2 = -1 the two error terms cancel, leaving (1+a1+a2) y=0(1 + a_1 + a_2)\,y = 0. The direct-current denominator is small — it is 0.0167 for the first section at 48 times — but it is not zero for any stable section, so the only constant state is y=0y = 0. The rounding still has to land somewhere, and it does, but no non-zero constant can hold itself up the way the plain section’s offset does.

The hero figure measures it. Each section was seeded eight least significant bits from zero and marched for nine thousand samples with nothing in. Plainly rounded the sections settled at 27, 50, 70 and 88 bits — each section’s dead band plus the offset the section before it passed on, as the earlier essay found. With the errors fed back, the largest excursion of any section’s output over the last two thousand samples is one least significant bit, and it is not a settled offset: the trace is zero almost everywhere, with isolated single-step departures that the next sample removes.

The identity says nothing about oscillating limit cycles, only about constant ones, and the residual one-bit steps are what is left of the oscillating kind. They do not grow with anything in this essay’s range. A full proof that no larger oscillation can sustain itself would need the section’s own state-space argument, and nothing here supplies it; the measurement is that none appeared from any of the seeds tried at any clock rate.

What oversampling no longer sells

The offset’s growth with the clock rate was the uncomfortable part of the earlier finding, and it is the part that error feedback removes most completely.

Plainly rounded, the idle offset grows as the clock rate to the power 2.27; fed back through (1 − z⁻¹)², it stays at one least significant bit from 8× to 128×. computed by solving, not by drawing. The largest output over the last two thousand samples of a zero-input march from a seeded state, against how far the clock sits above the 1 kHz corner, at 12 bits. Plain rounding: 0 at 8×, 3 at 12×, 2 at 16×, 17 at 24×, 34 at 32×, 88 at 48×, 173 at 64×, 411 at 96×, 754 at 128× — under a bit at the lowest rate, where each section's dead band is under the resolution, and then growing with fitted exponent 2.27, because the dead band is q over twice each recursion's direct-current denominator and that falls as the square of the rate. With the error fed back: 1, 1, 1, 1, 1, 1, 1, 1, 1.
Fig. 2 The largest output with no input, from a seeded state, against how far the clock sits above the 1 kHz corner, at 12 bits. Plainly rounded: under a bit at 8×, then 17 at 24×, 88 at 48× and 754 at 128×, a fitted exponent of 2.27. With the error fed back: one least significant bit at every rate.

Plainly rounded, the cascade has no dead band worth the name at 8 times its corner — each section’s band is under one step and the filter settles to zero — and from there the offset climbs: 17 least significant bits at 24 times, 88 at 48, 411 at 96 and 754 at 128, with a fitted exponent of 2.27 against the square law the dead-band bound gives. At 128 times its corner a twelve-bit filter sits at eighteen per cent of full scale with nothing in it.

With the errors fed back the same cascade sits at one least significant bit at every one of the nine clock rates. The quantity that grew as the square of the oversampling is not reduced; it is removed, because the mechanism that sized it — a constant state that rounding returns to itself — no longer exists. An eighth-order low-pass clocked 128 times above its corner is a perfectly usable fixed-point filter once each section keeps its two errors, and without them it is not.

The floor, and the two models of it

The dead band is the zero-input symptom. With a signal present the same rounding is the round-off floor, and the noise transfer function predicts that too: inject a white sequence of variance q2/12q^2/12 at each section, pass it through that section’s noise transfer function and every section after it, and add the energies.

At 16 bits the plain cascade's round-off floor rises from 0.66 to 22.2 least significant bits as the clock goes from 8× to 128×; fed back, it falls from 0.47 to 0.30. computed by solving, not by drawing. The output error a rounded cascade adds over the same cascade in double precision (dots), and the prediction from q²/12 injected at each section and carried through its noise transfer function (lines): 1/Aₖ(z) times every later section when plainly rounded, (1 − z⁻¹)²/Aₖ(z) times them with the error fed back. Plain: predicted 0.66, 1.02, 1.45, 2.46, 3.63, 6.41, 9.67, 17.42, 26.55 LSB. Fed back: 0.468, 0.401, 0.371, 0.342, 0.329, 0.315, 0.308, 0.302, 0.298, measured within 1.0% of it. The improvement is 1.40 times at 8× and 89 times at 128× — 6.5 bits, bought with two additions and a shift per section.
Fig. 3 The output error a rounded cascade adds over the same cascade in double precision, at 16 bits, against the clock rate (dots), with each arrangement’s prediction (lines): 1/Ak(z)1/A_k(z) for plain rounding, (1−z−1)2/Ak(z)(1 - z^{-1})^2/A_k(z) with the error fed back. Plain: 0.66 least significant bits at 8× rising to 26.6 at 128×. Fed back: 0.47 falling to 0.30, measured within 1% of the prediction. The improvement at 128× is 89 times, 6.5 bits.

For the plain cascade at sixteen bits the prediction runs from 0.66 least significant bits at 8 times to 26.6 at 128 times — the same growth as the dead band, for the same reason, since both are the gain of 1/A(z)1/A(z) near z=1z = 1. With the error fed back the prediction falls with the oversampling, from 0.47 to 0.30. The double zero’s attenuation near zero frequency grows as the poles crowd closer to z=1z = 1, so the faster the clock, the more of the recursion’s gain the zero cancels; the floor approaches the level of the last section’s own quantiser, which nothing after it filters.

The ratio between the two predictions is the improvement: 1.40 at 8 times, where the poles are not near enough to z=1z = 1 for the zero to matter much, and 89 at 128 times — 6.5 bits of floor, recovered by two additions and a shift per section. That is a better exchange than any word length the earlier essays could offer: the same 6.5 bits bought by widening the arithmetic would cost a seven-bit-wider multiplier and accumulator in every section.

A noise model that holds again

The more surprising result is in the measured dots rather than in the lines. The same filter, rounded twice’s companion measurement in zero in, and not zero out found that the white-noise model of rounding — each quantiser producing an independent uniform error of variance q2/12q^2/12 — fails below about fourteen bits for this filter, and in the direction that makes a filter worse than its budget.

At 48× the plain cascade's floor is 10.6 times its noise model at 8 bits; with the error fed back the model holds to 2.3% from six bits to twenty. computed by solving, not by drawing. The measured round-off floor over the floor the white-noise model predicts, against the word length, for the eighth-order cascade with its clock 48 times its corner. Plainly rounded the model fails below fourteen bits — 2.82 at 6, 10.58 at 8, 7.56 at 10, 5.24 at 12, 2.83 at 14, 1.05 at 16, 0.89 at 18, 1.05 at 20 — because a recursion whose dead band is many steps wide holds its error near a constant rather than scattering it. With the error fed back the ratio is 1.008, 1.023, 0.998, 1.006, 1.005, 0.991, 0.989, 1.003: the error the section keeps is subtracted from the next decision, so no constant survives to correlate the rounding with itself.
Fig. 4 The measured round-off floor over the white-noise model’s prediction, against the word length, with the clock at 48 times the corner. Plain rounding breaks the model below fourteen bits — 10.6 times at 8 bits, 5.24 at 12. With the error fed back the ratio stays between 0.989 and 1.023 from six bits to twenty.

At 48 times its corner, the plain cascade’s measured floor is 1.05 times the model’s at sixteen bits and 10.6 times at eight. The reason is the dead band again: a recursion whose band is many steps wide holds its state near a constant, and a quantiser fed a nearly constant input makes nearly the same error every sample, which is the opposite of independent. The error correlates with itself, sits at low frequency where 1/A(z)1/A(z) is largest, and is amplified far more than a white sequence of the same variance would be.

With the error fed back, the measured floor is the model’s to within 2.3 per cent at every word length from six bits to twenty. The section can no longer hold a constant, so its quantiser never sees the same input twice in a row for long, and the errors it makes are scattered. That is the effect one step of dither per moment bought for a converter’s quantiser by adding noise ahead of it, obtained here without adding any: the decorrelating signal is the quantiser’s own previous error, which was going to be thrown away. The model’s own word-length boundary — the thing when a floor stops being a floor found in a converter’s quantiser, a step large against the signal’s own movement — has been moved below six bits for this filter by a change that never touched the word length. A designer can now budget the round-off with the arithmetic in the first two essays and expect the measurement to agree.

Where the error goes instead

A noise transfer function with a double zero at zero frequency cannot reduce the error everywhere: ∣1−e−jω∣2|1 - e^{-j\omega}|^2 is 4 at half the clock, so each section’s error is sixteen times larger in power there than a white error would be. The question is what the rest of the filter does with it.

Where the fed-back error goes: 115 dB lower at low frequency, and above 8.02 kHz higher by up to 12.0 dB, where the filter has already removed the signal. computed by solving, not by drawing. The spectral density of the round-off reaching the output, summed over the eight sections' quantisers and expressed relative to one quantiser's own white density, for the cascade at 48× its 1 kHz corner. Plainly rounded each section's error passes through its own recursion, 1/A(z), whose gain near zero frequency is the reciprocal of its small direct-current denominator: the density is 42.1 dB at 10 Hz. Fed back through (1 − z⁻¹)² it is −73.3 dB there — the double zero cancels the poles' gain where the poles are close to z = 1 — and it crosses above the plain density only at 8.02 kHz, deep in the stopband, ending 12.0 dB above it near half the clock — the last section's own error, which nothing after it filters, multiplied by |1 + 2 + 1|² = 16 — at 1.1 dB, 41 dB below the plain density's low-frequency level.
Fig. 5 The density of the round-off reaching the output, summed over all eight sections’ quantisers, relative to one quantiser’s own white density, for the cascade at 48 times its corner. Plain: 42.1 dB at 10 Hz. Fed back: −73.3 dB there, 115 dB lower. The two cross at 8.02 kHz, deep in the stopband, and near half the clock the fed-back density ends 12 dB above the plain one, at 1.1 dB.

Near zero frequency the difference is enormous. The plain density at 10 Hz is 42.1 dB above a single quantiser’s, which is the recursions’ gain at low frequency stacked eight deep; the fed-back density there is −73.3 dB, 115 dB lower, because each section’s double zero cancels its own pole pair and leaves the remaining low-frequency gain of the sections after it working on an error that has already been shaped away.

The two cross at 8.02 kHz, eight times the corner, and above it the fed-back error is the larger. Near half the clock it is 12 dB above the plain one — exactly the factor of sixteen that ∣1+2+1∣2|1 + 2 + 1|^2 gives the last section’s own error, which nothing after it filters. But the level there is 1.1 dB relative to one quantiser, 41 dB below where the plain error sat near zero frequency, and it is in the stopband of a low-pass whose purpose is to remove that band. A design that cares about its stopband floor — an anti-imaging filter ahead of a converter, say — would want the feedback weights chosen differently, and the next section says how.

The weights are a choice

The weights (−2,+1)(-2, +1) put the zero at zero frequency because that is where a low-pass section clocked far above its corner has its gain. They are not the only choice, and the general one is instructive. Choosing c1=a1c_1 = a_1 and c2=a2c_2 = a_2 makes the numerator equal to A(z)A(z) itself, so the error reaches the output through exactly one: the section’s own recursion is cancelled completely and its error is white at its output. That costs two genuine multiplies rather than a shift, and it needs the coefficients in the error path rounded too — so it inherits, in a smaller form, the coefficient problem the word length that is not a threshold measured.

A zero placed at the section’s own resonance rather than at zero frequency suits a band-pass, and complex weights are not needed: any real second-order numerator places a conjugate pair of zeros on the circle at an angle of the designer’s choosing. The (1−z−1)2(1 - z^{-1})^2 choice puts both zeros at angle zero, where the multiplies vanish. For this cascade the poles sit at angles of 0.026 to 0.128 radians — the corner itself is 0.131 — so every pole pair is within an eighth of a radian of the zeros, close enough that a zero at z=1z = 1 cancels most of what a zero at the pole’s own angle would, and far enough that the cancellation is not complete, which is why the floor at 8× improves by only 1.40.

What the two extra registers cost, and what they do not fix

Each section gains two error registers and two additions, one of them shifted. The registers must hold the error at full accumulator width — the error is the part of the accumulator below the stored word, so it needs as many bits as the accumulator has beyond the word length. Nothing else in the section changes: the signal coefficients, the scaling of which section goes first, the ordering, and the overflow headroom are exactly what they were, because the signal’s transfer function is untouched.

Three things it does not fix. Coefficient quantisation is unaffected, since the coefficients are in the signal path; the direct form of the same filter, rounded twice is still unstable at sixteen bits with or without error feedback. Overflow is unaffected, and an overflow limit cycle — the large oscillation a two’s-complement wraparound can sustain — is a different mechanism from the dead band and needs saturation arithmetic, not error feedback. And the input’s own quantisation is not a section’s error at all; a converter’s step arrives already in the signal, as the floor a converter sets measured, and the filter passes it as signal.

The arithmetic, in one place

An eighth-order Butterworth cascade with its corner at 1 kHz: plainly rounded at 12 bits and clocked at 48 kHz, it settles 88 least significant bits from zero with no input, an offset that grows with the clock rate as an exponent of 2.27. With each section adding back its last two rounding errors with weights −2 and +1, the error reaches the output through (1−z−1)2/A(z)(1 - z^{-1})^2/A(z), a constant state needs (1+a1+a2) y=0(1 + a_1 + a_2)\,y = 0, and the output never strays more than one bit at any rate from 8× to 128×. At 16 bits the round-off floor goes from 26.6 to 0.30 least significant bits at 128×, 89 times or 6.5 bits, measured within 1% of the shaped prediction; and the white-noise model holds to 2.3% from six bits to twenty, where plain rounding broke it by 10.6 times at eight.

Still open: the stopband floor, the oscillating cycles, and the error register’s own width

A stopband that matters. The shaped error is 12 dB above the plain one near half the clock. For a filter whose stopband specification is close to its round-off floor, the weights that minimise the worst density over the stopband — rather than the total — are a minimax problem over two real numbers per section, and whether they beat the (−2, +1) choice by much is a number nobody has computed here.

Oscillating limit cycles. The identity removes constant states and says nothing about periodic ones. Searching every reachable state of one twelve-bit section for a periodic orbit, with and without the fed-back error, would turn the observed absence of anything larger than one bit into either a proof or a counterexample.

The error register rounded. The two registers here hold the error exactly. If they are themselves truncated to a few bits — the obvious economy — the fed-back error is no longer the error made, and the cancellation in the dead-band identity is no longer exact. How many bits the error register needs before the one-bit idle behaviour and the 6.5-bit floor survive is the implementation question this essay leaves to the next.

Part 6 on digital realisation

One argument about Digital realisation, 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.

Biquad cascadeLimit cycleNoise floorNoise-shapingNumerical errorOversamplingQuantisationRealisation