Filters, measured not tabulated

The selectivity that is not free

The filter trade is normally drawn with two quantities in it. It has three, and an order fixes a relation between all of them: at order five and half a decibel of ripple, a stopband asked to begin at twice the corner is worth 66.1 decibels and one asked to begin at 1.25 times is worth 38.7. The exchange is exact addition in decibels — relaxing the ripple from a half to three buys 9.12 dB wherever it is spent — and there is a fourth price nobody writes down: settling to a tenth of a per cent goes from 9.04 milliseconds to 23.23 while the overshoot does not move.

Assumes: What a steep skirt costs · Three families, one corner · What actually fills a null

What a steep skirt costs replaced the adjectives in the filter table with measurements, and the currency it found was delay: the steepest of the three all-pole families distorts delay eight hundred times more than the gentlest. The zeros that buy an order then added a fourth family that does not fall because its denominator grows, and found the price of that in the same picture — a stopband that stops falling.

Both essays priced a trade with two quantities in it: how steep, and what it costs. The elliptic family does not have a trade with two quantities in it. It has three, and the third is not chosen by anybody.

A designer holds a passband ripple, a transition band — where the stopband is required to begin — and a stopband attenuation. An order fixes a relation between the three. Choose any two and the third is returned by the degree equation, which is a statement about elliptic integrals and not a design decision. The machinery for it has been in this collection since the elliptic family arrived, returning that third number on every call, and only one value of the second has ever been drawn.

What is being solved

The elliptic approximation places its poles and its transmission zeros through the Jacobi function cd\mathrm{cd}, evaluated by descending Landen transformation. The quantity that decides everything is the ratio of the complete elliptic integral to its complement, and the degree equation says that the order multiplies it. Written through the nome q=eπK/Kq = e^{-\pi K'/K} it is one line, q1=qnq_1 = q^{\,n}, and the modulus k1k_1 recovered from q1q_1 then gives the stopband ripple factor εs=εp/k1\varepsilon_s = \varepsilon_p/k_1.

So the specification a reader would write down —

As=10log10 ⁣(1+εs2)A_s = 10\log_{10}\!\left(1 + \varepsilon_s^2\right)

— has the passband ripple in it through εp\varepsilon_p, the order and the transition width through k1k_1, and nothing else at all. There is no term for the topology, no term for the components and no term a designer can lean on.

An order buys 38.7 dB at 1.25× the corner and 56.6 at 1.67×computed by solving, not by drawing. The degree equation for an order-5 elliptic filter, swept over the two quantities a designer sets. The horizontal axis is where the stopband is required to begin; the five curves are passband ripples from 0.01 to 3 decibels. Nothing on this page is a choice: pick a ripple and a transition width and the attenuation is decided. At a half decibel of ripple, order 5 gives 38.68 dB with the stopband beginning at 1.25 times the corner and 66.09 dB with it beginning at twice — a factor of two in transition width for 27.4 decibels. The vertical spacing between the curves is the ripple's own term and is the same at every transition width: relaxing from a half decibel to three buys 9.12 dB wherever it is spent.0204060801.201.401.601.802where the stopband is required to begin, in units of the cornerstopband attenuation the degree equation returns, decibels0.01 dB ripple0.1 dB ripple0.5 dB ripple1 dB ripple3 dB ripplesolved, then checked — one order, two axesadditive above 25 dB, not below 10
Fig. 1 The degree equation for a fifth-order elliptic filter, swept over both quantities that are chosen. The horizontal axis is where the stopband is required to begin; the five curves are passband ripples from a hundredth of a decibel to three. At half a decibel the order gives 38.7 dB with the stopband beginning at 1.25 times the corner, 56.6 dB at 1.67 times and 66.1 dB at twice — 27.3 decibels for a factor of two in transition width. Drag the order: at three the same three points are 14.9, 25.5 and 31.2, and at seven they are 62.6, 87.7 and 101.0.

The shape of that figure is the whole argument in one picture, and the part worth staring at is the right-hand end. A stopband asked to begin at 1.05 times the corner — a transition band five per cent wide — is worth 21.3 decibels at order five and half a decibel of ripple. That is not a filter anybody would ship, and it is exactly the specification a person writes when the trade is presented as two quantities and the third is assumed to be free.

The trade is not a trade, it is an addition

The five curves in that figure look parallel. They are parallel, exactly, and that is a stronger statement than it appears.

Five ripples, one curve: the trade is addition in decibels. computed by solving, not by drawing. The same five designs as the figure above with the ripple's own term subtracted — ten times the logarithm of one less than the ripple factor — leaving what the order and the transition width supply. The five lie on top of each other to 0.013 of a decibel wherever the shallowest of them is more than 25 dB down. So the three quantities are not merely traded, they are added: a ripple relaxation is worth the same number of decibels at any transition width, and a transition width is worth the same number at any ripple. The collapse fails at the right-hand end, where the stopband has fallen far enough that the decibels a specification is written in are no longer twenty times the logarithm of the stopband ripple factor — the difference between the quantity a specification names and the quantity the mathematics uses.
Fig. 2 The same five designs with the ripple’s own term subtracted — ten times the logarithm of one less than the ripple factor — leaving what the order and the transition width supply. The five lie on one another to 0.012 of a decibel wherever the shallowest of them is more than 25 dB down. The collapse fails at the right-hand end, where the stopband has fallen far enough that the decibels a specification is written in are no longer twenty times the logarithm of the stopband ripple factor.

Because εs=εp/k1\varepsilon_s = \varepsilon_p/k_1 and k1k_1 depends only on the order and the transition width, the stopband in decibels is the ripple’s contribution plus the geometry’s, and the two do not interact. Relaxing the passband ripple from a half decibel to three buys 9.12 decibels of stopband, and it buys the same 9.12 whether the transition band is five per cent wide or a hundred. Relaxing from a tenth of a decibel to a whole one buys 10.46, everywhere.

That is a designer’s exchange rate and it is a number rather than a direction. A specification that is two decibels short of its stopband can be met by relaxing the ripple by an amount that is calculable in one line, without re-running anything — provided the stopband is deep enough for the identity to hold, and the figure says where that is. Below about ten decibels of stopband the two ways of writing the same quantity part company, because 10log10(1+εs2)10\log_{10}(1+\varepsilon_s^2) is only 20log10εs20\log_{10}\varepsilon_s when εs\varepsilon_s is large. The collection’s own machinery has that distinction written into its docstring — the two differ by 0.14 dB at fifteen decibels of stopband and by nothing at forty — and this figure is the first thing that makes the difference visible rather than merely recorded.

The order is the only integer in it

The three quantities are continuous and the fourth thing in the relation is not, and that turns out to be where most of the slack in a real design is hiding.

In decibels the stopband is very nearly linear in the order. Differencing the degree equation’s own output across orders gives 11.9714 decibels per order with the stopband beginning at 1.25 times the corner, 15.5496 at 1.67 times and 17.4539 at twice. Those slopes are not fitted and they are not a rule of thumb; they are the ratio of the complete elliptic integral to its complement, because k1k_1 falls as qn/2q^{\,n/2} and so its logarithm is linear in nn with slope 10πK/(Kln10)10\pi K'/(K\ln 10). Evaluated directly that expression gives 11.9716, 15.5496 and 17.4539 — five figures against a numerical difference of a machinery that computes k1k_1 through a nome, twenty terms of a theta series and a bisection, sharing only the elliptic integral itself.

So the order a specification needs is a real number, and it is almost never one. Half a decibel of ripple, a stopband beginning at 1.25 times the corner and forty decibels of rejection needs order 5.1101. Nobody builds a filter of order 5.1101. Rounded up to six, the same design returns 50.652 decibels — 10.65 decibels more than was asked for, which is not a margin anybody chose and is not free either, since it is a whole extra section.

That windfall is worth spending rather than banking, and the exchange rates above say exactly what it buys. Kept at order six and held to forty decibels, the stopband may instead be required to begin at 1.127 times the corner rather than 1.25 — bisected on the degree equation, and a fifth of the transition band given back. Or, keeping the transition band, the passband ripple may be tightened from half a decibel to 0.0454, which is an order of magnitude of flatness for nothing. Or the difference may be taken in settling time, which the last two figures of this essay price.

None of those three is visible from a design flow that computes an order, rounds it up and stops. What makes them visible is that the relation has three continuous quantities in it and one integer, so rounding the integer up always leaves something on the table, and which of the three it is returned in is a decision. The habit is the one the same filter a thousand times larger applies to impedance: a quantity that looks like a consequence is usually a free parameter that nobody noticed had been set.

The reproduction, which is also a warning

Before the selectivity is swept it has to be established that a design at a selectivity nobody has drawn is still the filter it claims to be. The comparison the family arrived with is the instrument.

Four families at order 5, and the 2 zeros in the stopband. computed by solving, not by drawing. The elliptic design is drawn at a selectivity of 0.6, so its stopband is asked to begin at 1.667 times the corner, and the degree equation returns 56.57 dB for it at 0.5 dB of ripple. From the stopband edge outward the elliptic response never rises above -56.6 dB; the steepest all-pole family of the same order is only -35.6 dB down there and does not reach -56.6 dB until 2.55 times the corner. That is what 2 transmission zeros buy. The price is in the same picture: the elliptic stopband has a floor and an all-pole one does not, so beyond 2.9×fc the all-pole response is the lower of the two and keeps going.
Fig. 3 The four families at order five with the elliptic design asked for a stopband beginning at 1.67 times the corner rather than the 1.25 the collection has always drawn. The degree equation returns 56.57 dB for it; the built network holds −56.6 dB from the stopband edge outward. The steepest all-pole family of the same order is 35.6 dB down there and does not reach −56.6 dB until 2.55 times the corner — and overtakes the elliptic response at 2.9 times, where the floor stops being a detail.

The design and the network agree to a tenth of a decibel, which is what makes every number after this attributable to the sweep rather than to the synthesis. And the crossover has moved: at the collection’s usual selectivity the all-pole family overtakes at about two corners, and asking for the steeper skirt has pushed it out to 2.9 while making the elliptic response eighteen decibels deeper in between. Both halves moved, in the same direction, for one change of one parameter.

The stopband is not a slope

The word “attenuation” hides what the elliptic stopband actually is, and the third quantity is meaningless without it.

Three transition widths, and the floor rises 28 dB across them. computed by solving, not by drawing. Order-5 elliptic filters at selectivities 0.6, 0.8, 0.9 — stopbands required to begin at 1.67, 1.25, 1.11 times the corner — each built as a network and measured on it. The stopband is not a slope: it is 2 nulls with a floor between them, and the floor is what the filter guarantees. Narrowing the transition band from 1.67× to 1.11× moves the first null in by a factor of 1.49 and raises the floor from -56.6 to -28.3 decibels. What was bought is the frequency at which rejection starts; what was sold is how much of it there is.
Fig. 4 Order-five elliptic filters at three transition widths, each built as a network and measured on it. The stopband is two nulls with a level between them, and that level is what the filter guarantees. Narrowing the transition band from 1.67 times the corner to 1.11 moves the first null in by a factor of 1.49 and raises the floor from −56.6 decibels to −28.3.

Twenty-eight decibels of stopband is bought and sold in that one picture, and neither the nulls nor the floor is where a reader of the specification would look. The nulls are extremely deep — they are genuine transmission zeros and what actually fills a null measured what it takes to fill one, which is loss in the arm and not component tolerance — and they are also narrow, so a signal three per cent away from one gets nothing from it. What a stopband requirement is actually about is the level between them, and that level is the number the degree equation returns.

There is a second reason the level and not the nulls is the right thing to specify, and it is about what a stopband is for. A null rejects one frequency; a stopband rejects a band, and what gets through a band is set by its worst point. So an elliptic design’s rejection of a broadband interferer is its floor, not its nulls, and the two differ here by more than sixty decibels. The only case in which the nulls are the answer is a single interfering tone whose frequency is known and stable — a mains harmonic, a local oscillator — and that is a notch problem rather than a filter problem, priced separately by what actually fills a null and by the inductor that is a capacitor, which is what decides whether a real arm can hold a null where it was put.

Where the floor is in the circuit

The floor is not a property of the approximation that then has to be realised. It is a capacitance ratio, and it is visible in the netlist.

Each section that carries a transmission zero splits its capacitance in two. The part across the inductor makes the series arm an open circuit at ωz=1/LCp\omega_z = 1/\sqrt{LC_p}, which is the zero; the total sets the pole pair at ω0=1/L(Cp+C2)\omega_0 = 1/\sqrt{L(C_p+C_2)}, which is therefore always below it. Far above both, the inductor is out of the picture and the section is a capacitive divider passing Cp/(Cp+C2)C_p/(C_p+C_2) — which is the same ratio, and is exactly (ω0/ωz)2(\omega_0/\omega_z)^2.

The stopband floor is 50.2 dB and it is a ratio of capacitances. computed by solving, not by drawing. An order-6 elliptic filter at 0.5 dB of ripple and a selectivity of 0.8, realised as sections whose transmission zero sits above their pole pair. Each such section splits its capacitance in two: the part across the inductor sets the zero, the total sets the pole, and the fraction that goes to the first is exactly the level the section's own stopband comes back up to — 4.09 and 10.66 and 35.41 decibels here. Their product is 50.15 dB. The built cascade measures 50.15 dB a thousand corners out and 50.65 in its stopband, and the degree equation returns 50.65 dB above the top of the ripple band, which is 50.15 above direct current.
Fig. 5 The three notch sections of a sixth-order design, their individual floors, and the two independent routes to the whole. The sections hold 4.09, 10.66 and 35.41 decibels; their product is 50.15. The built cascade measures 50.15 dB a thousand corners out and 50.65 in its stopband, and the degree equation returns 50.65 above the top of the ripple band. Drag the order to five and the arithmetic comes apart, for a reason that is not an error.

Two routes to one number, sharing the netlist and nothing else: a product of capacitance ratios read out of six element values, and a magnitude response solved at a frequency. They agree to 0.02 of a decibel. The half-decibel offset against the degree equation is the normalisation the family’s own machinery warns about — the equation refers its stopband to the top of the ripple band, and at an even order direct current is the bottom of it — and it is exactly the ripple, at every order and every selectivity checked.

The odd orders are the more interesting frame. At order five the two notch sections hold 18.42 decibels between them and the stopband measures 38.68, which is not a discrepancy: an odd-order design has an unpaired real pole, its section is still falling where the notch sections have flattened, and the stopband level is the two together. A thousand corners out that response is 85 decibels down and going, because there is nothing to hold it up. So an elliptic filter of odd order does not have a floor at all, and the sentence “the elliptic stopband comes back up” is true of the even orders and true only near the band edge of the odd ones. That is the sort of distinction the a ladder is not a cascade rung is about arriving from the other side: what a realisation does is not always what the approximation says.

The fourth quantity, which the degree equation does not mention

Three quantities are in the specification. There is a fourth in the part, and no line of the degree equation contains it.

The overshoot does not move and the tail nearly triples. computed by solving, not by drawing. The step response of the same order-5 elliptic design at selectivities 0.5, 0.8, 0.95, from the design poles with the transmission zeros carried in the numerator — dropping them would give the step response of a different and better-behaved filter. The first peak is 14.50 per cent above final at 2.00× and 13.58 at 1.05×, which is no change worth reporting. What changes is behind it: settling to a tenth of a per cent takes 9.04 milliseconds at the wide transition and 23.23 at the narrow one, against a corner period of one millisecond. A narrow transition band is not bought with a worse edge; it is bought with a longer tail.
Fig. 6 The step response of the same fifth-order design at three transition widths, computed from the design poles with the transmission zeros carried in the numerator — dropping them would give the step response of a different and better-behaved filter. The first peak is 14.50 per cent above final with the stopband beginning at twice the corner and 13.58 per cent with it beginning at 1.05 times. What changes is behind it.

The overshoot does not move. Across a transition band narrowed by a factor of nineteen it stays between 13.6 and 15.2 per cent, and it is not even monotone. Anybody pricing the time-domain cost of selectivity by looking at the first peak — which is what an overshoot figure is — would conclude that selectivity is free in the time domain.

It is not. It is paid in the tail, where nobody photographs it.

A transition band 19 times narrower costs 2.57× the settling time. computed by solving, not by drawing. Settling to one per cent, a tenth and a hundredth, for order-5 elliptic designs whose stopband is required to begin anywhere from 2.00 to 1.053 times the corner. The dashed line is not a fit: it is τ·ln(A/tol) for the single pole nearest the imaginary axis, whose time constant grows from 1.737 to 5.768 milliseconds and whose residue falls from 0.2027 to 0.0569 while it does. The settling grows by 2.57 where the time constant grows by 3.32, and the difference between those two numbers is the residue. The quality factor of that pole runs from 5.28 to 18.03, which is the third price the degree equation does not mention.
Fig. 7 Settling to one per cent, a tenth and a hundredth, against where the stopband is required to begin. Against a corner period of one millisecond, settling to a tenth of a per cent takes 9.04 milliseconds with the stopband at twice the corner and 23.23 with it at 1.053 times. The dashed line is not a fit: it is τ·ln(A/tol) for the single pole nearest the imaginary axis.

A transition band nineteen times narrower costs 2.57 times the settling time to a tenth of a per cent, and 2.76 times to a hundredth. The one per cent figure moves less — 4.91 milliseconds to 9.68 — which is the same lesson as the overshoot: the tighter the tolerance the measurement is taken at, the more of the price is visible, because the price is entirely in how long the last small error takes to go away. This is the quantity the cliff before the fastest settling is about, met from the frequency domain rather than from the damping ratio.

The tail is one pole, and its residue is why the growth is not larger

The mechanism is worth separating from the measurement, because the two numbers involved pull in opposite directions.

Narrowing the transition band moves the band-edge pole nearer the imaginary axis. Its quality factor goes from 5.28 to 18.03 across the sweep and its time constant from 1.737 milliseconds to 5.768 — a factor of 3.32. If that were the whole story the settling would grow by 3.32 as well. It grows by 2.57, and the missing factor is the pole’s own residue, which falls from 0.2027 to 0.0569 as the pole approaches the axis. A slow mode that starts smaller takes less time to become negligible, and the settling time is τ·ln(A/tol) with both terms moving.

That prediction uses one pole out of five and is checked against a full residue expansion over all of them. The worst disagreement across the six designs is 0.78 per cent at a hundredth of a per cent of settling, 3.32 per cent at a tenth, and 6.44 per cent at one — better the further into the tail the measurement is taken, which is the direction that says the approximation is the right one rather than a fit that happens to work. Early in the transient the other four modes have not died and one envelope is not the answer; late in it, there is nothing else left. That is the same discipline one step computed twice applies to a transient and where the behaviour is written down applies to a pole set — a second route that must agree, and a stated region where it does not.

For scale: an all-pole Chebyshev of the same order and the same ripple settles to a tenth of a per cent in 8.08 milliseconds and a Butterworth in 3.30. The widest elliptic design here is 9.04, close to the Chebyshev it is built on top of; the narrowest is 23.23, which is seven times the Butterworth. The time-domain price of the zeros themselves is small and the time-domain price of the selectivity is not. Anybody who has decided that a ripple is acceptable has already paid most of the first; what the second costs is set afterwards, by a parameter usually left at its default.

What it does not say

It does not say the elliptic family is a poor trade. Order five at a transition band of 1.67 times holds 56.6 decibels, and the steepest all-pole family of that order needs to go out to 2.55 times to be that far down at all. The zeros do exactly what the zeros that buy an order measured them doing.

It does not say the transition width should be generous. Where the anti-alias filter in front of a converter sits, the transition band is decided by the sample rate and the signal band and there is nothing to negotiate — what the filter in front costs is the case where all three quantities are handed over at once. What this rung says is what the third one then is, and what the settling then is, both of which were previously found out by building the thing.

And it does not say the floor is what a real filter has. Everything above is an ideal realisation with ideal followers between the sections. A real notch has an arm with loss in it, and what actually fills a null measured that at twenty decibels per decade of arm resistance; a real cascade has amplifiers with finite gain-bandwidth, which the Q the amplifier decides prices at the designed Q over the ratio — and the band-edge section here has a Q of 18 at the narrowest design, so that section is where a real part would be found out first. The numbers above are the best case, and they are the right numbers for deciding whether the specification is worth writing.

The number worth carrying

Three quantities, an order, and one line: at order five and half a decibel of ripple, 66.1 decibels at twice the corner, 38.7 at 1.25 times and 21.3 at 1.05. Relaxing the ripple to three decibels adds 9.12 wherever it is spent. Settling to a tenth of a per cent runs from 9.04 milliseconds to 23.23 across the same range, at a corner period of one.

The habit that goes with it is about what a free parameter is. The selectivity in this design sat at a default for as long as the family has been in this collection, and everything written about the family was written at that default — which made a two-quantity trade out of a three-quantity one and hid the fourth quantity entirely. A parameter with a default is a decision somebody made once, and the way to find out whether it was the right one is to sweep it and read what the other three do.

Part 4 on filter tradeoff

One argument about Filter tradeoff, and one of 3 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.

Design tradeoffElliptic filterFilter orderPassband rippleRingingSelectivitySettling timeStopband attenuationTransmission zero