Filters, measured not tabulated

The filter that samples

The rung below built a resistor out of a clock and measured two ways it is not one: a settling time, and a corner that is a capacitor ratio rather than an R–C product. Both are errors in a value and both get smaller as the design gets better. This is an error of a different kind — the arrangement is not a continuous system at all, and nothing below half the clock shows it. An input at 992 kilohertz arrives at 7.8 kilohertz with the passband's own gain, where the continuous model the rung below fitted says it is 56 decibels down.

Assumes: A resistor made of a clock · The frequency a sample rate invents

The rung below this one built a resistor out of a clock and a capacitor, and measured the two ways it is not one: a settling time, and a corner frequency that is a capacitor ratio rather than an R–C product. Both of those are errors in a value. Both get smaller as the design gets better — a faster clock fixes the first, a better ratio the second — and both are the kind of defect a specification can absorb.

This is an error of a different kind. The arrangement is not a filter with a wrong corner. It is not a continuous system at all, and nothing anywhere below half the clock shows it.

A switched capacitor is a resistor below a ratio, not below a frequency. computed by solving, not by drawing. The exact response of a capacitor shuttled between the input and a holding capacitor at 1.00 MHz — a difference equation with one pole, evaluated on the unit circle — against the continuous R–C its equivalent resistance is supposed to make. The corner is 794 Hz against the model's 796 Hz, 0.25% out, and the discrepancy is set by the capacitor ratio alone: one per cent needs a ratio under 0.0201, which is a clock 315 times the corner. The second difference has no counterpart at all — the sampled response repeats at the clock, so the image rising on the right of this plot is signal at 999 kHz arriving as though it were at the corner. The third is settling: 1 pF charged through 1 kΩ gets 500.0 time constants a half period at this clock, and being short of full charge raises the equivalent resistance by 0.000%, which puts a ceiling on the clock at 108 MHz.
Fig. 1 The design freedom the arrangement exists for, at a capacitor ratio four times smaller: a corner that is a ratio and a clock, and moves with the clock exactly. It is the same clock this essay is about.

Marched, not evaluated

The exact discrete transfer function of this arrangement is already available, and it is periodic in the clock by construction — so evaluating it would state the folding rather than demonstrate it. A discrete transfer function is a claim about a sequence of samples, and the input here is a continuous voltage.

So each clock cycle is two netlists: the sampling capacitor across the source through a switch, then across the holding capacitor through a switch, with the charge handed between them. That is the same treatment a switch gets everywhere else in this collection — not an element with a law, but a different circuit with the same charge in it — and nothing in the march knows the input is above half the clock.

A switched-capacitor low-pass driven past half its own clock. computed by solving, not by drawing. The clock is 1.00 MHz and the corner the rung below fitted is 1.59 kHz. The falling dashed curve is that continuous model, which knows nothing about a clock and goes on falling. The circles are the marched circuit, read at the frequency the output actually appears at. They part company past half the clock and by 992 kHz the model is 42.1 decibels wrong — an input just below the clock arrives just above direct current, in the middle of the passband, with the passband's own gain. The third curve is the exact discrete transfer function evaluated at the folded frequency, and it agrees with the march to 0.26 decibels, which is what says the march is measuring the folding rather than an artefact of itself.
Fig. 2 A switched-capacitor low-pass with a one-megahertz clock and a 1.59 kilohertz corner, driven from below the corner to twice the clock. The circles are the marched circuit, read at the frequency its output actually appears at.

Below half the clock, all three curves agree and there is nothing to see. The marched circuit, the exact discrete function and the continuous R–C the rung below fitted are within a quarter of a decibel of each other over the whole of the useful band, which is why the rung below could measure a corner frequency at all and why nobody discovers this by testing a passband.

A switched capacitor is a resistor below a ratio, not below a frequency. computed by solving, not by drawing. The exact response of a capacitor shuttled between the input and a holding capacitor at 1.00 MHz — a difference equation with one pole, evaluated on the unit circle — against the continuous R–C its equivalent resistance is supposed to make. The corner is 3.15 kHz against the model's 3.18 kHz, 0.99% out, and the discrepancy is set by the capacitor ratio alone: one per cent needs a ratio under 0.0201, which is a clock 315 times the corner. The second difference has no counterpart at all — the sampled response repeats at the clock, so the image rising on the right of this plot is signal at 997 kHz arriving as though it were at the corner. The third is settling: 1 pF charged through 1 kΩ gets 500.0 time constants a half period at this clock, and being short of full charge raises the equivalent resistance by 0.000%, which puts a ceiling on the clock at 108 MHz.
Fig. 3 The rung below’s own measurement: the corner a capacitor ratio and a clock produce, and the error the R–C model makes about it — a defect in a value, which gets smaller as the design gets better.

An input at 992 kilohertz comes out at 7.8

Past half the clock the two models separate, and by the top of the range the continuous one is 42 decibels wrong.

An input at 992 kilohertz — eight kilohertz below the clock — is sampled a million times a second, so what lands in the output sequence is at 7.8 kilohertz. Not attenuated: the sampler does not know the difference between an eight-kilohertz beat against the clock and an eight-kilohertz signal, and the filter that follows treats it as the latter. It arrives in the middle of the passband with the passband’s own gain, and no filtering after the sampler can remove it, because after the sampler it is the signal.

The continuous model says that input is 56 decibels down.

That is the same statement the sampling essay makes about a converter — a frequency the sample rate invents, indistinguishable afterwards from one that was always there — and the reason it is worth a second essay is that nobody expects a filter to do it. A converter has an anti-alias filter in front of it because it is a sampler and everybody knows it is a sampler. A switched-capacitor low-pass is sold as a filter, drawn as a filter, specified with a corner frequency and a stopband attenuation, and is a sampler.

The two routes are the check on this. The marched circuit and the exact discrete transfer function evaluated at the folded frequency agree to 0.26 decibels at every input frequency drawn, above and below the clock, which is what says the march is measuring the folding rather than an artefact of its own time step.

A switched-capacitor low-pass driven past half its own clock. computed by solving, not by drawing. The clock is 1.00 MHz and the corner the rung below fitted is 796 Hz. The falling dashed curve is that continuous model, which knows nothing about a clock and goes on falling. The circles are the marched circuit, read at the frequency the output actually appears at. They part company past half the clock and by 992 kHz the model is 42.1 decibels wrong — an input just below the clock arrives just above direct current, in the middle of the passband, with the passband's own gain. The third curve is the exact discrete transfer function evaluated at the folded frequency, and it agrees with the march to 0.13 decibels, which is what says the march is measuring the folding rather than an artefact of itself.
Fig. 4 Half a picofarad of sampling capacitor: the corner is at 796 Hz, and the continuous model is 42 dB wrong near the clock. An input at 992 kilohertz comes out at 7.8 — the sampled response repeats at the clock, so a signal just below it lands just above zero, and no continuous model of this filter contains that at all.

What the fold does to a specification

Take the arrangement’s own specification and ask what it promises.

A switched-capacitor low-pass at 1.59 kilohertz with sixty decibels of stopband attenuation is promising that a component at ten kilohertz comes out sixty decibels down. It does. It is also promising, by the ordinary reading of what a low-pass is, that nothing above ten kilohertz comes out larger than that — and it is not, because the promise was never about frequencies near the clock and the specification does not say so.

The gap between the two readings is where a design goes wrong quietly. An anti-aliasing filter in front of a converter is a component somebody put on the schematic on purpose; a prefilter in front of a switched-capacitor filter is a component that has to be reasoned into existence, because the part it protects is itself a filter and looks as though it should not need one. The instinct that a filter cannot need a filter is exactly the instinct the fold defeats.

A second reading is worth checking too. The stopband attenuation quoted for one of these parts is measured with a swept sinusoid and a spectrum analyser — and if the sweep stops at half the clock, as most do, the measurement never enters the region this essay is about and the number is a true statement about a range that was not stated.

A switched-capacitor low-pass driven past half its own clock. computed by solving, not by drawing. The clock is 1.00 MHz and the corner the rung below fitted is 398 Hz. The falling dashed curve is that continuous model, which knows nothing about a clock and goes on falling. The circles are the marched circuit, read at the frequency the output actually appears at. They part company past half the clock and by 992 kHz the model is 42.1 decibels wrong — an input just below the clock arrives just above direct current, in the middle of the passband, with the passband's own gain. The third curve is the exact discrete transfer function evaluated at the folded frequency, and it agrees with the march to 0.05 decibels, which is what says the march is measuring the folding rather than an artefact of itself.
Fig. 5 A quarter of the sampling capacitor, which lowers the corner by four and leaves the clock alone: the fold is in exactly the same place and the continuous model is wrong by more.

What has to come first

The consequence is a continuous filter in front, and the interesting part is where it has to work.

The continuous filter that has to come first, and where it has to work. computed by solving, not by drawing. The requirement is not stated at half the clock, which is where a converter's is. It is stated at the clock minus the passband edge — 998 kHz for a passband at the corner — because that is the lowest frequency whose fold lands inside the passband, and the prefilter has to be down by the whole dynamic range there. One pole at the filter's own corner is worth 55.9 decibels at that frequency, so sixty decibels needs 1.07 of them — and 1.20 if the passband is opened to twice the corner, while a quarter of it needs only 0.88. That is the arithmetic that decides whether a switched-capacitor filter has saved any parts at all: it removed the passband's precision components and put back a continuous filter whose only job is to be down a long way, a long way up.
Fig. 6 The order a single-cornered prefilter needs to give sixty decibels of dynamic range, against how wide the passband is relative to the switched-capacitor filter’s own corner.

The requirement is not stated at half the clock, which is where a converter’s is. It is stated at the clock minus the passband edge, because that is the lowest frequency whose fold lands inside the passband, and the prefilter has to be down by the whole dynamic range there.

For a passband at the corner and a clock at a megahertz, that frequency is 998 kilohertz — 628 times the corner. One pole at the passband edge is worth 55.9 decibels there, so sixty decibels needs 1.07 of them, and a passband opened to twice the corner needs 1.20.

That is a comfortable answer and it is comfortable because the clock is 628 times the corner. The arithmetic that decides whether a switched-capacitor filter has saved any parts at all is exactly this ratio: the filter removed the passband’s precision components and put back a continuous filter whose only job is to be down a long way, a long way up. A single pole made of a resistor and a capacitor with no accuracy requirement at all does it, which is the trade the technology is built on — and it is the same trade the anti-alias essay prices for a converter, arriving one component earlier in the chain.

Push the clock ratio down and the trade closes. A clock at fifty times the corner puts the first fold band at forty-nine times, a single pole is 34 decibels down there, and sixty decibels needs nearly two poles with a corner that now has to be placed accurately relative to the passband — at which point the prefilter is a filter and the arrangement has saved nothing.

A switched-capacitor low-pass driven past half its own clock. computed by solving, not by drawing. The clock is 1.00 MHz and the corner the rung below fitted is 3.18 kHz. The falling dashed curve is that continuous model, which knows nothing about a clock and goes on falling. The circles are the marched circuit, read at the frequency the output actually appears at. They part company past half the clock and by 992 kHz the model is 41.7 decibels wrong — an input just below the clock arrives just above direct current, in the middle of the passband, with the passband's own gain. The third curve is the exact discrete transfer function evaluated at the folded frequency, and it agrees with the march to 0.33 decibels, which is what says the march is measuring the folding rather than an artefact of itself.
Fig. 7 Two picofarads, four times the capacitor: the corner moves to 3.18 kHz and the continuous model is still 42 dB wrong near the clock. The error is not a property of the corner — it is the same 42 dB at every capacitor ratio drawn — which is what has to come first: a continuous filter in front, sized against the clock rather than against this filter’s corner.

Why the clock ratio is the design variable

That gives the anchor its second design number, and it sits directly against the rung below’s first.

The rung below found that the corner is set by the capacitor ratio and the clock: fc=fclkCs/2πChf_c = f_{\text{clk}}C_s/2\pi C_h. A large ratio Ch/CsC_h/C_s makes the corner accurate — it survives every process variation that moves both capacitors together — and it also makes the clock ratio large, which is what buys the cheap prefilter. Those pull the same way, which is unusual in this collection and worth saying.

What pulls the other way is area and settling. A holding capacitor 628 times the sampling one is silicon, and the rung below’s other finding — the settling time — says the sampling capacitor must charge fully through the switch resistance in half a clock, so a faster clock needs a smaller sampling capacitor or a wider switch. The design is bounded above by area and below by the fold requirement, and the two boundaries are in different units.

This is the same shape as the impedance-scaling anchor’s band: two constraints from different physics, closing on a design window, with the window’s width rather than either edge being the useful quantity.

The continuous filter that has to come first, and where it has to work. computed by solving, not by drawing. The requirement is not stated at half the clock, which is where a converter's is. It is stated at the clock minus the passband edge — 99.8 kHz for a passband at the corner — because that is the lowest frequency whose fold lands inside the passband, and the prefilter has to be down by the whole dynamic range there. One pole at the filter's own corner is worth 55.9 decibels at that frequency, so sixty decibels needs 1.07 of them — and 1.20 if the passband is opened to twice the corner, while a quarter of it needs only 0.88. That is the arithmetic that decides whether a switched-capacitor filter has saved any parts at all: it removed the passband's precision components and put back a continuous filter whose only job is to be down a long way, a long way up.
Fig. 8 A tenth of the clock, where the first fold band is ten times closer to the passband and the prefilter that was one pole is nearly two.

The three things the fold does that a converter’s does not

A switched-capacitor filter’s aliasing differs from a converter’s in three ways, and all three make it harder to reason about.

There is no output sample rate. A converter produces numbers and the aliasing is visible in them. This produces a continuous voltage — a held one, with the staircase the reconstruction essay measures — so the folded component comes out looking exactly like a signal, on an oscilloscope and in a subsequent analogue stage.

The fold bands are everywhere, not just above Nyquist. Every multiple of the clock has a band either side of it that lands in the passband, so the interference does not have to be near the clock: 2 MHz ± 8 kHz folds to 8 kHz just as well, and so does 10 MHz ± 8 kHz. A prefilter has to hold its attenuation over every decade above the passband, which is a different requirement from being down by sixty decibels at one frequency.

And the clock is in the circuit. The most likely source of an interfering signal at exactly the clock frequency is the clock, coupling through the substrate, the supply or the layout. That component folds to direct current, so it appears as an offset — and an offset that moves with the clock frequency, which is a symptom nobody attributes to aliasing. A component slightly off the clock folds to a slow beat instead, which is worse: an output that drifts at a rate nothing in the schematic has, and which changes when the clock is retrimmed by a part in a thousand. Both are the same mechanism seen at two offsets, and both are aliasing of a signal the designer supplied.

What is not modelled

The switches are resistors. They have no charge injection, no clock feedthrough and no signal-dependent on-resistance. Charge injection is the dominant offset mechanism in a real switched-capacitor circuit and it is signal-dependent, which makes it a distortion as well; the essay that subtracts a reset level measures the related mechanism in a sampled amplifier and this one has none of it.

There is no amplifier. A real switched-capacitor filter is built round an integrator with an operational amplifier in it, whose finite gain-bandwidth is the thing that actually limits the clock rate and whose noise folds with everything else. Both are absent here: this is the passive arrangement, which is the right object for showing what sampling does and is not a circuit anybody builds.

The tracking during the acquisition phase is the only continuous filtering in the model, and it is worth noting how little it is worth. The sampling capacitor charges through the switch resistance with a time constant of a nanosecond, so it is a continuous low-pass at 160 megahertz — two decades above the clock, and it attenuates the first fold band by nothing at all. Real switched-capacitor filters do sometimes rely on this and it works only when the switch is deliberately made slow, which trades directly against the rung below’s settling requirement.

And the noise is not here. Every one of those switches contributes kT/C at every clock edge, and that noise folds too — which is an anchor of its own in the noise field, where the folding is the whole subject and the number of folds is exactly the number of settling time constants.

What the gate checks

The march and the exact discrete transfer function are asserted to agree at every input frequency on the sweep, above the clock as well as below it, to one and a half decibels. That is the assertion that makes the marched result evidence rather than a plot: the two share the netlist and share no arithmetic beyond it.

The continuous model is asserted to be wrong by more than twenty-five decibels somewhere in the range, which is the finding stated as a refusal — a version of this figure whose axis stopped at Nyquist would pass every other check and fail this one.

An input just under the clock is asserted to land below a twentieth of the clock, which is the claim that the fold arrives in the passband rather than merely somewhere unexpected.

And the prefilter requirement is asserted to be enough for a narrow passband and not enough for a wide one, at a fixed sixty decibels — two assertions in one, because a version that returned the same order for every passband would pass a check that only asked whether the number was plausible. That was the first version, and it returned 1.07 poles for all four cases because the prefilter’s corner had been fixed at the switched-capacitor filter’s rather than at the passband edge.

A switched-capacitor low-pass driven past half its own clock. computed by solving, not by drawing. The clock is 1.00 MHz and the corner the rung below fitted is 6.37 kHz. The falling dashed curve is that continuous model, which knows nothing about a clock and goes on falling. The circles are the marched circuit, read at the frequency the output actually appears at. They part company past half the clock and by 992 kHz the model is 40.0 decibels wrong — an input just below the clock arrives just above direct current, in the middle of the passband, with the passband's own gain. The third curve is the exact discrete transfer function evaluated at the folded frequency, and it agrees with the march to 0.22 decibels, which is what says the march is measuring the folding rather than an artefact of itself.
Fig. 9 Four times the sampling capacitor, which moves the corner up by four and leaves the clock where it was. The fold is in exactly the same place: it is a property of the clock and not of the filter.

The measurement that finds it, and the one that does not

A closing practical note, because the failure has a signature.

Sweeping a sinusoid and reading the output amplitude finds the fold immediately, provided the sweep goes past the clock: the output amplitude jumps from the stopband to the passband over a fraction of a decade. What it does not do is say where the output is — the reading is at the fold frequency and the generator is at the input frequency, so an instrument that tracks the source sees nothing at all. A tracking-generator measurement, which is the ordinary way to plot a filter, is blind to the whole effect by construction.

An untracked spectrum measurement finds it and finds it in the right place. A time-domain measurement finds it too, as a beat at the difference frequency, which is the symptom most people actually meet: a filter with a slow, unexplained wobble on its output, whose period changes when the clock is retrimmed and which disappears when the input is disconnected.

That last one is the diagnosis. Aliasing in this arrangement is the only mechanism whose output frequency moves when the clock moves while the input stays where it is, and that is a one-experiment test. It is the same manoeuvre the sample-rate essay uses on a converter: change the sample rate and see which components move, because the real ones do not.

What the rung below was right about

Nothing above contradicts the rung below and it is worth being exact about why.

That essay measured a corner frequency and found the R–C model’s prediction wrong by a computable fraction that depends only on the capacitor ratio, and asserted that the answer is a ratio carrying no capacitance and no clock frequency — which is what makes an integrated filter accurate. All of that holds and is unaffected by anything here, because all of it is a statement about the passband.

What this rung adds is that the passband is the only place the statement is about. The same model extended half a decade past its own corner is still right; extended past half the clock it is not merely inaccurate but describing a different kind of object, and the distance between those two regions is the ratio the design was built around. A model that is excellent over 628 times its own corner and meaningless beyond it is exactly the shape this collection collects, and the number that separates the two is the clock.

The digital field draws the same boundary and says two things about it this essay can borrow. The frequency a sample rate invents establishes that it has no gradient at all: below half the sample rate a set of samples has one sinusoid through it, above half the sample rate it has another, and the two sets of numbers are identical to three parts in ten thousand billion. Nothing is attenuated and nothing is distorted, which is exactly why the 992 kilohertz input measured here arrives with the passband’s own gain rather than with some of it. And what the filter in front costs prices the repair in the currency that matters: against one stated requirement the choice of filter family is not a decibel or two of skirt but a factor in the clock — Bessel 3.53 times Nyquist, Butterworth 2.08, Chebyshev 1.53.

Which is the awkward part of designing with this technique, and it is worth stating plainly. The attraction of a switched-capacitor filter is that its corner is set by a clock and a capacitor ratio rather than by an R–C product, so it tunes and it fits on a chip. The protection it needs against its own images is a continuous filter in front, whose corner is set by an R–C product and which therefore has all the properties the switched design was chosen to avoid. The continuous filter can be crude — it only has to reach the clock rather than the corner — but it cannot be absent, and its presence is what puts an ordinary resistor and capacitor back into a signal path that was supposed not to have one.

Part 2 on switched capacitor

One argument about Switched capacitor, 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.

AliasingAnti-alias filterFilter tradeoffMarchingModel rangeNyquist rateSample rateSwitched capacitor