Filters, measured not tabulated

Flat delay, bought with more delay

An all-pass section has a magnitude of one at every frequency — measured here on a solved network as 1 to within 9 × 10⁻¹⁶ over six decades — which makes it the only thing that can change a filter's delay without touching its magnitude response. It flattens by adding. A fifth-order Chebyshev's 891 microseconds of delay variation comes down to 498, and everything leaves 722 microseconds later than it did.

Assumes: Flat magnitude, unflat delay · Three families, one corner · Where the behaviour is written down

The delay essay in this field ends with a problem it does not solve. A filter’s group delay varies across its passband, the variation is worst exactly where the magnitude response is doing its useful work, and the only remedy offered was to choose a different family — which means accepting a gentler skirt, because in this field steepness and delay flatness are the same axis read from opposite ends.

There is another remedy and it is completely different in kind. Instead of changing the filter, put something in front of it that changes the delay and nothing else.

That something has to have a magnitude response of exactly one at every frequency, or it is not leaving the filter’s magnitude alone; and it has to have a phase that varies, or it is doing nothing at all. Those two requirements sound contradictory and are not. A network whose zeros are the mirror image of its poles in the imaginary axis has exactly that property, because sp|s - p| and s+pˉ|s + \bar{p}| are equal for every ss on the imaginary axis. It is called an all-pass, and it is the only tool in this subject for the job.

An all-pass of Q = 2: no magnitude anywhere, and a delay with a peak. computed by solving, not by drawing across six decades. The magnitude is 1 to within 9e-16 at every frequency tested, so this section cannot change any filter's magnitude response. Its phase falls through 360° — twice what its pole pair alone would give, because its zeros are the mirror image of its poles — and its group delay peaks at 1290.5 µs at 981 Hz. That peak is the only tool available for flattening somebody else's delay curve, and it is made of delay.
Fig. 1 A second-order all-pass built as a network — a series resonator, two equal resistors and an ideal amplifier — solved across six decades. The magnitude is one to within 9 × 10⁻¹⁶, which is the arithmetic’s floor rather than a tolerance. The phase falls through a full 360°, twice what its pole pair alone would give, and the group delay that phase implies has a peak.

The circuit, which is not a lattice

The classical passive all-pass is a bridged-T lattice, which is symmetric, floating, and awkward to draw. There is a much more direct construction once an amplifier is allowed, and every part of it is in the netlist:

An inductor, a capacitor and a resistor in series from the input to ground form a bandpass — the voltage across the resistor is (ω0/Q)ss2+(ω0/Q)s+ω02\dfrac{(\omega_0/Q)s}{s^2 + (\omega_0/Q)s + \omega_0^2}, which is unity at resonance and falls away on both sides. Take that node into the non-inverting input of an ideal amplifier, and put two equal resistors from the input to the output with their junction at the inverting input. The amplifier forces its two inputs equal; the junction sits at the mean of the input and output voltages because the resistors are equal and the input draws no current. So

vout=2vbandpassvinv_\text{out} = 2 v_\text{bandpass} - v_\text{in}

and twice a bandpass minus one is, after a line of algebra, exactly the all-pass:

2(ω0/Q)ss2+(ω0/Q)s+ω021=s2(ω0/Q)s+ω02s2+(ω0/Q)s+ω02\frac{2(\omega_0/Q)s}{s^2 + (\omega_0/Q)s + \omega_0^2} - 1 = -\frac{s^2 - (\omega_0/Q)s + \omega_0^2}{s^2 + (\omega_0/Q)s + \omega_0^2}

The overall minus sign is a constant 180° that no group delay can see, since delay is the derivative of phase and not the phase.

The reason to build it rather than write it down is the same reason everything on this site is built: the claim “the magnitude is one everywhere” is then a measurement of a solved network across six decades rather than an identity restated. It comes out one to sixteen digits, which is a stronger statement than any tolerance would have been, and it would not survive a sign error in the feedback resistors.

What flattening means, and what it cannot mean

Group delay is dϕ/dω-\mathrm{d}\phi/\mathrm{d}\omega, and an all-pass has a positive one at every frequency — always positive, because a physical network cannot advance a signal. So every all-pass section put in front of a filter adds delay at every frequency without exception.

Flattening a delay curve therefore cannot mean pulling the peaks down. It can only mean pushing the valleys up, by adding more delay where the filter has least and less where the filter has most. That is what an all-pass section’s own delay peak is for: place it where the filter’s delay is lowest — which, for a low-pass, is somewhere well below the corner — and the sum of the two curves is flatter than either.

A fifth-order chebyshev delay, and 1 all-pass section in front of itcomputed by solving, not by drawing at 60 frequencies across the passband. The delay varies by 891 µs from end to end; 1 all-pass section, with pole pair found by search rather than taken from a table, brings that to 498 µs — a factor of 1.79. The price is that everything is later: 722 µs more at direct current, which is more than the 392 µs of variation removed.00.50011.5020200400600800frequency (hertz)group delay (milliseconds)the filter alonewith the equalisersolved, then checked — flattened by adding, never by removing1.79× flatter, 722 µs later
Fig. 2 A fifth-order Chebyshev’s group delay across its passband, and the same filter with one all-pass section in front of it. The section’s pole pair was found by searching for the flattest result rather than taken from a table, because what is being minimised is a property of the combination. The variation falls from 891 microseconds to 498. The whole curve has also moved up. The slider is the number of sections.

The figure draws both halves because a figure that drew one would be an advertisement. The variation removed is 392 microseconds. The delay added at direct current is 722 microseconds. The price is larger than the thing bought, and that is not an artefact of a poor design — it is structural. An all-pass can only add, and to add a lot in one place it must add something everywhere.

Why the pole pair is searched for

There is no closed form for the best equaliser, and the reason is worth being precise about. What is being minimised is the peak-to-peak variation of the sum of two delay curves over a stated band, and that objective is not a smooth function of anything convenient: the maximum and the minimum can each jump from one part of the band to another as the parameters move. Standard approaches are minimax fits with the usual machinery.

Here it is a coarse grid over ω0\omega_0 and QQ followed by coordinate descent, with the objective evaluated by solving the combined network at sixty frequencies. That is slower than a formula and it has one property a formula does not: the objective is the actual measured delay of the actual network, so a section that would have been fine in theory and useless in the circuit cannot win the search.

Each section’s ω0\omega_0 and QQ move independently in the refinement, and that matters more than it sounds. An earlier version seeded both from one number and refined them together, which makes a two-section equaliser into a one-section equaliser with extra delay in it — the second section contributes nothing but its own contribution to the total.

A fifth-order chebyshev delay, and 2 all-pass sections in front of it. computed by solving, not by drawing at 60 frequencies across the passband. The delay varies by 891 µs from end to end; 2 all-pass sections, with pole pairs found by search rather than taken from a table, bring that to 394 µs — a factor of 2.26. The price is that everything is later: 1312 µs more at direct current, which is more than the 496 µs of variation removed.
Fig. 3 The same filter with two sections rather than one. The variation comes down further — 891 microseconds to 398, a factor of 2.2 against 1.8 — and the delay added at direct current rises from 722 microseconds to 1,292. Both sections are working: their pole pairs came out at different frequencies and different quality factors, which is what the independent refinement is for.

Which filters are worth equalising

The trade is not equally good for every family, and the ordering is the reverse of the one that makes a family attractive in the first place.

A Butterworth’s delay variation is smaller to begin with and its shape is easier for one all-pass bump to complement, so one section takes it a long way. A Chebyshev’s delay peaks hard and narrowly at the band edge — that peak is the same fact as its steep skirt, its high pole Q and its ringing — and one all-pass section is not shaped like the inverse of a narrow peak. It helps, and it does not help nearly as much.

A fifth-order butterworth delay, and 1 all-pass section in front of it. computed by solving, not by drawing at 60 frequencies across the passband. The delay varies by 304 µs from end to end; 1 all-pass section, with pole pair found by search rather than taken from a table, brings that to 76 µs — a factor of 4.01. The price is that everything is later: 662 µs more at direct current, which is more than the 228 µs of variation removed.
Fig. 4 A fifth-order Butterworth, equalised with one section. It starts with a third of the Chebyshev’s variation and the same single section flattens it by a much larger factor, because a gentle bump is easier to complement than a sharp one. The delay added is comparable. Steepness costs delay variation, and then it costs more all-pass to remove that variation, and then the all-pass costs delay.

And a Bessel filter is close to unimprovable by this method, which is a good sanity check on the method rather than a disappointment: its delay is already maximally flat by construction, so there is very little for an all-pass to complement and a great deal of delay to add in trying.

A fifth-order butterworth delay, and 2 all-pass sections in front of it. computed by solving, not by drawing at 60 frequencies across the passband. The delay varies by 304 µs from end to end; 2 all-pass sections, with pole pairs found by search rather than taken from a table, bring that to 63 µs — a factor of 4.84. The price is that everything is later: 958 µs more at direct current, which is more than the 241 µs of variation removed.
Fig. 5 A Butterworth with two sections rather than one. The variation comes down to a few tens of microseconds — nearly flat by any standard this field has used — and the delay added is close to two milliseconds. Past a point the equaliser is no longer removing variation worth removing, and the only thing still growing is the latency.
A fifth-order chebyshev delay, and 3 all-pass sections in front of it. computed by solving, not by drawing at 60 frequencies across the passband. The delay varies by 891 µs from end to end; 3 all-pass sections, with pole pairs found by search rather than taken from a table, bring that to 291 µs — a factor of 3.06. The price is that everything is later: 2043 µs more at direct current, which is more than the 599 µs of variation removed.
Fig. 6 The Chebyshev with three all-pass sections, the end of the slider. The variation falls from 891 µs to 291 — a factor of 3.06, against 1.79 for one section and 2.26 for two — and the delay added at direct current is 2043 µs, against 722 and 1312. Set the two columns against each other and the trade is arithmetic rather than rhetorical: one section removes 393 µs of variation for 722 µs of delay, two remove 497 for 1312, three remove 600 for 2043. The exchange rate is 1.8, then 2.6, then 3.4, and it is getting worse.

What is really being traded

Three quantities are now in play and it is worth writing the relation between them plainly, because each essay in this field has had two of the three.

Steepness costs delay variation — that is the earlier essay, measured across four families at every order. Delay variation can be traded for absolute delay — that is this essay, measured on the same networks. So a steep filter with flat delay is available, and what it costs is latency: a fifth-order Chebyshev equalised to a fifth of its variation is a filter that delays everything by about two milliseconds at a kilohertz corner.

Whether that matters is not a question this site can answer, and it is exactly the sort of question that gets answered badly when the number is unknown. In a measurement chain, two milliseconds is nothing. Inside a feedback loop it is a phase lag that will cost stability margin, which is the subject of another field entirely, and the number to put into that calculation is the one on the figure above.

There is a fourth quantity that belongs in the same relation and this field has now measured it too. Order buys steepness, and the previous two essays are about how much: transmission zeros buy several poles’ worth of it, and the realisation decides whether the resulting design survives its own component tolerances. So the chain runs order → steepness → delay variation → absolute delay, with a branch at the second step into sensitivity, and every arrow in it is a measured number on this site rather than a direction.

What that means for a designer is less obvious than it looks, because the chain is not a warning against steep filters. It is a statement that the costs are payable. Delay variation can be equalised, at a stated price in latency. Sensitivity can be halved twice over by choosing the ladder. What cannot be bought at all is the one thing the chain starts with: a response steeper than its order allows. Everything downstream of that is engineering with a price list.

Group delay across the passband, at order 5. The Bessel filter's delay varies 0.1% below 0.8 of the corner; the Chebyshev's peaks near the band edge and is several times its low-frequency value. Every family here has the same half-power frequency, so this is a difference in behaviour rather than in scaling.
Fig. 7 The three all-pole families’ group delay at the fifth order, from the earlier essay, which is what the equaliser above is applied to. Everything in this essay adds a positive quantity to one of these curves. Nothing in this essay can lower any part of one.

The check that this is an all-pass and not nearly one

The claim the whole essay rests on is that the magnitude response is untouched. It would be easy to build something that was nearly all-pass — a resistor of the wrong value in the pair, a sign reversed at the amplifier’s inputs — and easy not to notice, because a magnitude error of a tenth of a decibel is invisible against a delay curve.

So the check is made where it is sharp rather than where it is convenient. The section is solved at sixty frequencies over six decades, from a three-hundredth of its pole frequency to three hundred times it, and the magnitude is required to be one at every one of them. The measured worst departure is 9 × 10⁻¹⁶. There is no tolerance in that number: it is the distance between one and the next representable double-precision value, a few times over.

A useful way to see why that is such a strong check is to ask what would break it. Making the two feedback resistors unequal by a part in a thousand turns 2vpvin2v_p - v_\text{in} into 1.999vpvin1.999 v_p - v_\text{in}, and the magnitude then varies by about a part in a thousand across the band — a trillion times the number above, and still only 0.009 dB, which is invisible on any plot anybody would draw. The assertion catches it; a picture would not.

That matters for the equaliser rather than for the section. The whole justification for putting extra circuitry in front of a filter is that the magnitude response is exactly what it was, so anything that quietly is not all-pass has converted a delay equaliser into an unplanned change to the thing the filter was for.

What the search cannot do

Two limitations, stated rather than left to be inferred from the figures.

The objective is the peak-to-peak variation of the delay, which is a minimax criterion, and it says nothing about the shape of what is left. A residual that is flat across most of the band with one sharp excursion scores the same as one that ripples gently everywhere, and for a signal with structure those are not equally good. A weighted objective would be a different design and the machinery would not have to change.

And the equaliser is designed against a band and evaluated on the same band. That is legitimate — it is what a specification is — and it means the numbers quoted here are the best case. Outside the band the all-pass sections carry on doing what all-pass sections do, and the delay there is worse than it was, in exchange for nothing at all.

There is one more thing this method does not need and it is worth ending on. Nowhere above is any approximation made to the filter, any assumption made about its family, or any property of it used except its measured delay at sixty frequencies. The equaliser is designed against a measurement of whatever is in front of it. Point it at a network nobody has an expression for and it works identically, which is the practical reason all-pass equalisation survives in a subject that has mostly moved to solving things in closed form.

A fifth-order bessel delay, and 1 all-pass section in front of it. computed by solving, not by drawing at 60 frequencies across the passband. The delay varies by 1 µs from end to end; 1 all-pass section, with pole pair found by search rather than taken from a table, brings that to 0 µs — a factor of 2.01. The price is that everything is later: 6 µs more at direct current, which is more than the 0 µs of variation removed.
Fig. 8 A Bessel filter with one all-pass section in front of it, which is the case that checks the method rather than showing it off. Bessel’s delay is already maximally flat by construction, so there is very little for an equaliser to complement — and the search, given nothing useful to do, still adds delay. A method that improved this curve substantially would be a method to distrust.

Where the boundary is

Every model on this site is drawn with the frequency, amplitude or size at which it stops being true, and an all-pass has all three.

Its frequency boundary is the amplifier’s. The section above assumes an ideal one — the nullor that this site uses everywhere for exactly this purpose — and a real amplifier has a gain–bandwidth product, so the two feedback resistors stop dividing by exactly two somewhere. That frequency is computed in the feedback field, and it is much lower than most readers expect: an amplifier configured for a gain of two from a 1 MHz part is a per cent wrong before 20 kHz. Past that the magnitude is no longer one, and a delay equaliser that alters the magnitude is worse than none.

Its amplitude boundary is the slew rate, and it is the sharper of the two. An all-pass section’s whole function is to produce large phase changes, which means the resonator’s internal node swings considerably more than the input does — at a quality factor of 8 the voltage across the resistor at resonance is the full input while the voltage across the inductor is eight times it. The signal level at which some internal node stops being linear is well below the level at which the output does.

Its size boundary is the one that decides whether any of this is buildable. The section drawn here has a pole at a kilohertz and a quality factor of 2, which at a reasonable capacitance needs an inductor of several henries. Delay equalisers at audio frequencies were built with gyrators for exactly that reason, and this site’s figures are drawn with the inductor because the inductor is the argument; the practical note is here so that the figure is not read as a schematic.

The gyrator’s own boundaries are measured, and two of the three land on this circuit rather than on a generic one. The inductor that is an amplifier presents one henry from four resistors, a capacitor and two amplifiers, good to within one per cent over three and a half decades — and finds its series resistance going negative at 63 hertz, inside the band where the inductance is still excellent. An all-pass section’s magnitude is one because its numerator and denominator have the same magnitude at every frequency, which is a statement about a resonator whose loss appears identically in both; a resonator whose loss has the wrong sign at some frequencies does not have a magnitude of one there, and the section stops being all-pass without its delay curve looking any different.

One inductor, and ten components adds the sensitivity, and it is the number that decides whether a delay equaliser built this way holds its design. A floating gyrator is exactly floating to five figures and reproduces a ladder’s response to a hundredth of a decibel — and each of its ten components moves that response by exactly a half, where the inductor it replaced moved it by 10810^{-8}. This essay’s search finds a section whose magnitude is one to 9×10169\times10^{-16}; ten components each with a sensitivity of a half turn that into a magnitude that is one to whatever the component tolerance is, which for one per cent parts is a passband ripple where there was none.

So the practical form of the trade this essay measures is worse than the delay column suggests. The flattening costs 722 microseconds of added delay, which is the honest price and is stated; realised with synthetic inductors it also costs the flat magnitude, which was the whole reason for choosing an all-pass in the first place.

The alternative realisation has its own version of the same problem, and this field has measured it. An all-pass section built from amplifiers and RC networks has no inductor and therefore none of the above; what it has instead is the Q the amplifier decides, which finds a section built with a part a hundred times its corner coming out with its quality factor 1.97 per cent high and its pole 1.97 per cent low. In a filter that is 2.1 decibels of ripple on a half-decibel design. In an all-pass it is worse in kind rather than in size: the magnitude of an all-pass is one because its numerator and denominator have equal magnitude at every frequency, which requires the pole and the zero to be exact mirror images — and a finite gain–bandwidth moves the pole without moving the zero, so the magnitude stops being one by an amount proportional to the same 1.97 per cent.

That is the sharpest form of what this essay is about. Every other filter in this field is a compromise between quantities that are all imperfect anyway; an all-pass is chosen precisely because one of its properties is exact, and every realisation available makes that property approximate. What survives is the delay, which is what the section was wanted for, and what is spent is the magnitude, which is what made it safe to use.

The three measurements this trade sits on

Every number on this page is a distance from something measured elsewhere. Flat magnitude, unflat delay is the defect being repaired, stated as a percentage of variation across the passband rather than as a caution. Three families, one corner is where the family that needs least repair is identified, and it is not the one that needs least equalisation per section. And What a steep skirt costs is the trade one level up: an all-pass equaliser is what a designer reaches for after choosing a skirt steeper than the delay budget allows, so the first decision on that page is what makes this page necessary.

Where the delay budget is spent instead

An all-pass equaliser is the expensive repair, and the field has two cheaper ones. Three families, one corner is the choice of family, which costs nothing and buys most of the flatness a Bessel design needs. The staircase on the way out is the half-sample delay a converter adds whatever the filter does, which is often larger than the variation being equalised.

Part 4 on group delay

One argument about Group delay, and one of 2 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 12.

The objects named here

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

All-passDelay equalisationFilter familiesGroup delayPhase linearityPole-zero mirror