Zero in, and not zero out
Assumes: The corner that moved · The floor a converter sets · The matrix that is ill, and the answer that is not
The same filter, rounded twice rounds a filter’s coefficients to a word length and asks where its poles went. It is a complete argument about one thing, and its own list of what it did not do names the other:
Fixed-point arithmetic inside a filter is untouched, and it is the clearest thing left open. Every number in the coefficient essay is about the coefficients; the arithmetic is rounded at every multiply too, which produces a round-off noise floor and — in a fixed-point recursion — limit cycles, an oscillation of a few least significant bits sustaining itself on zero input. That is a boundary bounded from below, of exactly the kind this site is built to measure.
Two rounding operations, then, in the same filter, doing different things. Rounding the coefficients moves the poles: the filter becomes a slightly different filter, exactly, forever. Rounding the arithmetic leaves the filter where it is and adds something to what comes out of it — and what it adds is the subject here.
Where the rounding goes, and where the gain goes
A fixed-point machine multiplies a word by a word and gets back twice as many bits. It has to put the result somewhere, and the standard arrangement — every fixed-point signal processor built since about 1980 — is a double-length accumulator that holds the whole sum of products for one section and rounds once, on the way out. So the model is one quantiser per biquad, not one per multiply.
Before any of that can be measured, one thing has to change that is not a modelling decision but was being got away with. A cascade written straight out of the design has numerator coefficients [1, 2, 1] and an overall gain of 2.4 × 10⁻¹⁰ applied at the very end. That is perfectly correct in double precision and it is not a fixed-point filter at all: every intermediate value overflows a word by ten orders of magnitude. A real implementation puts the gain where the signal is, one section at a time, so that each section’s output is of order one — and that is what decides where the rounding lands relative to the signal, which is the whole quantity.
So each section here is scaled to unity gain at direct current before anything is rounded. The scaling is part of the arithmetic and not a tidying step.
The floor, and the model of it
The standard prediction is not a fit. A quantiser at section k’s output injects a white sequence of variance q²/12; that sequence reaches the filter’s output through section k’s own feedback and then through every section after it; the output variance is q²/12 times the sum, over sections, of the squared two-norm of that impulse response.
Above fourteen bits the measurement and the prediction agree to a few per cent — 1.045, 1.015, 0.973 at fourteen, sixteen and twenty bits — and the floor halves with every bit, which is what a quantiser must give and is therefore a check on the measurement rather than a result.
Below twelve bits they do not. At ten bits the measurement is 3.06 times the prediction and at eight it is 6.40 times. The white-noise model of rounding has a word length of its own, and past it the error is worse than the budget rather than better. The reason is the ordinary one: a quantiser whose step is comparable with how far the signal moves between samples is not producing a sequence independent of the signal, and a model that assumes independence is assuming the thing that fails.
That is a boundary of the usual kind for this collection, and it is worth stating in the form a reader can use: for this filter the white-noise model is good above about twelve bits and pessimistic to believe below it, and the boundary moves with the pole radii rather than being a property of arithmetic in general.
The factor of twenty that was left out first
The first version of the prediction propagated each quantiser’s noise through the sections after it and no further, and came out twenty times too small at every word length. The missing factor is section k’s own denominator: the noise is injected at the output of the recursion, so it goes round that recursion’s own feedback loop before it goes anywhere else, and an all-pole section with a pole at radius 0.975 has an impulse response whose energy is hundreds of times the impulse that started it.
It is recorded because of the shape rather than the size. A prediction that is a constant factor out at every word length looks exactly like a calibration constant, and the temptation is to divide by it and carry on. What made it findable is that the ratio was constant while the physics said the prediction should be exact — so either the model was wrong in a way that scales, or the measurement was. The digits the arithmetic did not have is the essay about the other direction of the same suspicion.
Fed nothing, and not settling to nothing
A linear filter given zero input decays to zero, always, if its poles are inside the unit circle. A rounded one need not, and the reason is one line: a constant state y survives if rounding returns it to itself, which for zero input needs only
so the band of states that survive is q over twice the recursion’s own direct-current denominator.
At twelve bits the four sections settle at −27, −50, −70 and −88 least significant bits. The last of those is 2.15 per cent of full scale, out of a filter that is being fed nothing.
Two things about that number are worth separating.
It accumulates along the cascade. Each section’s dead-band output is the next section’s input, and the next section has unity gain at direct current, so it passes what it is given and adds a band of its own. Four sections give roughly four times one section’s offset, and an eighth-order filter is worse than a fourth-order one for a reason that has nothing to do with its response.
It does not move with the word length, in the units that matter. Add four bits and the offset in volts falls by sixteen; in least significant bits it is 88 either way. That is what makes it a floor bounded from below rather than an error: it is not a fraction of the signal, and no amount of precision makes the filter settle to zero. It only makes zero smaller.
Two thresholds because there is a floor is the same object built on purpose. A comparator is given hysteresis precisely so that a band of inputs produces no change of output, and the band is sized against the noise. Here the band is an accident of the arithmetic, it is sized against nothing, and it is in a filter that was specified as linear.
What oversampling sells
The denominator 1 + a₁ + a₂ is small exactly when the poles are close to z = 1, and the poles are close to z = 1 exactly when the corner is far below the sample rate. So the dead band is a function of the oversampling ratio, and the function is a square.
At eight times the corner the band is under one least significant bit and the filter really does settle to zero — there is no limit cycle, and the linear answer is the answer. At sixteen times it is two least significant bits. At a hundred and twenty-eight times it is 754 least significant bits, which is 18.4 per cent of full scale on a twelve-bit machine. The fitted exponent on the bound is 1.90, heading for two.
This is worth stating carefully because it inverts a habit. Oversampling is the answer to almost everything in a sampled system: it buys anti-alias filter order, it spreads the quantisation floor over a wider band, it makes reconstruction easy, and one bit, and where the noise went is built entirely on the trade. Here it is the thing that hurts, quadratically, and the mechanism is not the sampling at all — it is that a filter with a low corner and a high sample rate has to remember almost everything, so its recursion coefficients nearly cancel, so the smallest representable disturbance is amplified by one over that cancellation.
The same cancellation is what the same filter, rounded twice measures on the coefficients, and the two are the same fact seen from two sides: near z = 1 the poles are crowded together, so a small change in a coefficient moves them a lot, and a small state takes a long time to decay.
Which realisation, and what it costs
Everything above is a cascade of second-order sections, which is the arrangement the rung below found is already much better than a direct form for coefficient rounding: rounding the direct form’s coefficients moves its poles far more, and at eight bits it can move them outside the unit circle.
For the arithmetic the ordering matters too, and in a direction that is not the same. A direct form of order eight has one enormous recursion with one quantiser, and the noise transfer function is the whole filter’s 1/A(z), whose energy is far larger than any single section’s. A cascade splits the same denominator into four small ones and quantises between them, which is worse in count and much better in gain.
What is not measured here is the ordering and scaling within a cascade — which section goes first, and what each is scaled to. Those decide overflow at one end and round-off noise at the other, and they are a genuine optimisation with a literature. The rung below’s list names it as well and it is still open.
The two roundings, side by side
It is worth putting the two mechanisms in the same sentence, because they have the same cause and opposite characters.
Rounding the coefficients produces an error that is deterministic and permanent. The filter is a different filter: its corner has moved, its ripple has changed, and every measurement of it will show the same departure every time. It is an error in the specification and it can be designed around — the corner that moved shows the corner moving for a different reason and the repair is the same, which is to ask the prototype for a different number.
Rounding the arithmetic produces an error that is not in the response at all. The transfer function is exactly the designed one; what is added is a signal, and it is added at the output rather than folded into the gain. No measurement of the frequency response finds it, and a swept measurement finds it least of all, because a sweep always has a signal present and the effect is at its worst when there is none.
What a designer would do about it
Three cures exist and each gives something up, which is the usual shape.
Round differently. Rounding to nearest is what is modelled here and it is the arrangement that produces the largest dead bands. Magnitude truncation — rounding always toward zero — makes the recursion contractive and eliminates zero-input limit cycles entirely, at the price of a bias.
Dither the arithmetic. Adding a least-significant-bit of noise inside the recursion breaks the lock the same way it breaks the lock on a converter’s quantiser, which is what when a floor stops being a floor measures on the converter. It replaces a deterministic offset with a genuine noise floor, which is larger in power and much easier to live with.
Or stop oversampling the filter. The measurement above says the whole effect is a function of corner over sample rate, so decimating before the filter and interpolating after it moves the problem by the square of the decimation. That is the standard answer and this is the number that says by how much.
What is not in this model
No overflow. Every value here stays inside its word, because the scaling was chosen so that it does. A real fixed-point filter can overflow on a transient, and with wrap-around arithmetic that produces a large limit cycle — full scale rather than a few least significant bits — which is a different and much worse failure with the same name.
No coefficient rounding at the same time. The coefficients here are exact and the arithmetic is rounded, which isolates one mechanism; the rung below does the reverse. A real implementation has both, and they are not independent, because rounded coefficients move the poles and the dead band is one over a function of where the poles are.
And only one seed. The dead band is a set of surviving states and the measurement above finds one member of it by starting from a particular state and letting it settle. The largest surviving state is a harder question and the bound above brackets it — the measured 88 least significant bits sits inside the 127 the four sections’ bounds allow, and how much of that gap is real is not answered here.
And one ordering, out of twenty-four. The four sections are cascaded in the order the design produced them, and which section goes first measures what that choice is worth on this exact structure: the round-off floor runs from 24 to 100 least significant bits across the twenty-four arrangements of four biquads, all of which realise the identical transfer function, and the largest value any section reaches runs over eighteen decibels. The two go opposite ways, so eleven of the twenty-four are genuine choices and thirteen are beaten on both counts by another arrangement.
The number that essay reports as a round-off floor is the same quantity this one reports as a dead band, measured a different way, and it says that everything on this page has a factor of four in it that comes from an ordering rather than from a word length. Two bits of word length is the same improvement as one good permutation, and only one of the two costs anything to build. It also says where the scaling assumption above is doing its work: the arrangement with the lowest round-off floor is not the arrangement with the most headroom, so a design that avoids overflow by scaling conservatively has moved itself up that essay’s other axis.
The habit this belongs to
The rung below wrote down what it had not done, in a paragraph, with a reason. What the paragraph could not say was that the omitted half contains a quantity that does not improve with the thing every other quantity in the field improves with — and that the same design decision which makes a sampled system good makes this one bad, quadratically.
A floor bounded from below is the site’s own phrase for it, and this is the fourth place it has turned up: a noise floor that does not fall, a hysteresis band that must not, a dielectric’s memory — a capacitor shorted for ten seconds and then opened climbing back to a fifth of a per cent of where it was, which in a sample-and-hold is a hundred parts per million after a millisecond of hold, thirteen bits, on a part specified at nothing — and now an arithmetic that will not let a filter reach zero. The closest relative is the floor that outlives the arithmetic, where a filter’s realisable band ends five orders of magnitude before its structural one for a reason that is about double precision rather than about the network — the same kind of boundary, one field over, and found the same way.
Part 3 on digital realisation
One argument about Digital realisation, and one of 5 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 cascadeEffective bitsLimit cycleNoise floorNumerical errorOversamplingQuantisationRealisation
- The loop that is worse at full scale effective bits, oversampling, quantisation
- A floor, or five tones oversampling, quantisation
- Every derivative, and the one that is zero numerical error, realisation
- Six decibels a bit, and the half step blamed on it effective bits, quantisation
- The band that closes with the order biquad cascade, realisation
- The ceiling is not at the output noise floor, realisation