Tool 02
Active Filter Design
Low-pass, high-pass, band-pass and band-stop. Enter a passband/stopband spec, pick a response and a topology, and get the order, the transfer function, real component values and a simulated Bode plot.
Specification
k = 0.2857For a low-pass, fp is the passband edge below which the filter passes, and fs the stopband edge above it (fs > fp).
Order
n = 4Show where this formula comes from
The order n is the smallest number of poles that satisfies both ends of the spec at once. The whole design is built on one magnitude formula (derived from scratch at the top of the Stages panel); for a low-pass:
At fp it loses exactly Amax dB by construction (that is how ε is defined). The only condition left is the stopband: at fs it must lose at least Amin dB, and that condition contains n. There the fraction ωs/ωp equals 1/k:
Undo the log, move ε^2 across, then take the log again to bring n down from the exponent; each step is reversible because everything is positive:
Dividing by 2log(1/k) and writing ε^2 out in terms of Amax gives the order formula, with this design's numbers:
Rounding up is what buys the margin: with n a whole number the filter usually loses a bit more than Amin at fs, never less. The Bode plot panel checks both edges again with the rounded components.
2 second-order stages, cascaded. Each stage is built as its own unity-DC-gain block, so the product of the stages meets the spec with no extra gain stage needed.
Stages
ωc = 62.9k rad/sDenormalized with s → s/ωc (low-pass; ωc = 2π·fp·ε^(-1/n) for Butterworth, 2π·fp for Chebyshev, derived below). Each row is one realizable second-order block:
Show where the response formula and the poles come from
Every filter here starts from the same question: what does "a low-pass of order n" look like as a formula? The ideal is a brick wall, gain 1 up to fp and 0 above it. No circuit made of n capacitors and inductors (or op-amp stages) can do that, so the design has to pick the best approximation with n poles. The spec only talks about |H| in dB, so it is the magnitude that gets designed, not the phase.
A circuit with n energy-storing parts has a transfer function H(s) whose denominator is a polynomial of degree n. Its magnitude squared on the frequency axis is H(jω) times its mirror image H(-jω), and in that product every odd power of ω cancels, so |H|^2 is always a ratio of polynomials in ω^2. For a low-pass with no zeros (all poles, no numerator terms) and a gain of exactly 1 at DC, the most general form has n unknown positive coefficients:
The a coefficients are the only freedom left, and the two classic responses are two different ways of spending it.
Butterworth (1930) spends it on flatness at DC: make the passband as flat as possible near ω = 0. Flat means that the derivatives of |H|^2 at ω = 0 are zero. Each coefficient set to zero kills two more derivatives, so choosing a_1 = a_2 = ... = a_(n-1) = 0 makes the first 2n-1 derivatives vanish, the most an n-th degree polynomial allows. That is the "maximally flat" response, and only the last coefficient survives:
a_n only sets the frequency scale, and the spec sets it: the passband edge fp is by definition the frequency where the loss reaches Amax, i.e. where |H|^2 = 1/(1+ε^2). Writing a_n = ε^2/ωp^(2n) makes that true by construction, and gives the formula in its final form:
ε (epsilon) is the one number the passband spec turns into. At ω = ωp the bracket is 1, so the loss there is 10log(1+ε^2), and requiring that to equal Amax gives:
Two sanity checks: at DC the bracket is 0 and the gain is exactly 1; far above ωp the ω^(2n) term dominates and the loss grows by 20n dB per decade, which is why a higher order gives a steeper wall.
A magnitude formula is not a circuit yet: a circuit is built from poles. Replacing ω by s/j turns |H(jω)|^2 back into H(s) times its mirror H(-s), and the j^(2n) becomes (-1)^n:
Its 2n poles are the solutions of (s/ωp)^(2n) = (-1)^(n+1)/ε^2. Taking the 2n-th root of a number of size 1/ε^2 gives 2n solutions that all have the same size and angles spaced π/n apart: they sit on a circle of radius ω0, mirrored about both axes. Half of them have a negative real part (stable): those belong to H(s), the other half to H(-s). Measuring the angle θ from the imaginary axis, the stable ones are:
The radius ω0 is also the frequency where exactly 3 dB is lost (put ω = ω0 in the response: the bracket becomes ε^2 ε^(-2) = 1, so |H|^2 = 1/2). Only when Amax = 3.0103 dB is ε = 1 and ω0 = ωp; here ε = 0.9976, so the pole circle sits at 1.0006 times past fp. The stages below work in the normalized prototype, ω0 = 1, which is the "unit circle" they refer to; the real frequency scale is put back in by the denormalization step of each stage. Each pair of poles at ± θ_i becomes one second-order stage; for odd n the pole at θ = 90° (s = -1) has no partner and becomes the first-order stage.
| Stage | f0 = ωn/2π | Q |
|---|---|---|
| 1 | 10.0 kHz | 1.3066 |
| 2 | 10.0 kHz | 0.5412 |
Show the math for every stage
Stage 1
Every second-order stage realizes one pair of poles from the pole formula at the top of this panel, in the normalized prototype (frequencies in units of the cutoff rather than Hz). A pair of poles is the same thing as a second-degree denominator, so the stage has the form:
a and b are the two numbers this step has to find. Stage 1 takes the pole pair at the 1st angle of the formula:
σ (sigma) and ω (omega) are the pole's real and imaginary parts, the point σ + jω in the s-plane. Its distance from the imaginary axis, σ, is what damps the stage; ω is roughly where its resonance sits. On the Butterworth unit circle:
A pole never comes alone: σ + jω always pairs with its mirror image σ - jω (a real circuit cannot have just one), and multiplying out (s - pole)(s - mirror) gives exactly the s^2 + as + b this stage is trying to build:
b is the squared distance of the pole from the origin, and every Butterworth pole sits on the unit circle, so b is exactly 1 for every stage of every order; only a changes from stage to stage.
Denormalizing puts the real frequency scale back in: replacing s by s/ωc stretches the prototype so that its cutoff of 1 rad/s lands at ωc. Multiplying top and bottom by ωc^2 gives a denominator in the standard second-order form, from which the two numbers a circuit stage is built around, the corner frequency ωn and the quality factor Q, are read off by matching coefficients. (The constant on top is dropped: every stage here is built with unity gain in its passband, so only the denominator matters.)
For a Butterworth response the pole circle derived at the top of this panel has radius ω0 = ωp ε^(-1/n), not ωp itself (they only coincide for Amax = 3.0103 dB). That radius is what the normalized prototype gets scaled by, so this is the step where Amax reaches the component values; for a smaller Amax the poles move outward:
Stage 2
Every second-order stage realizes one pair of poles from the pole formula at the top of this panel, in the normalized prototype (frequencies in units of the cutoff rather than Hz). A pair of poles is the same thing as a second-degree denominator, so the stage has the form:
a and b are the two numbers this step has to find. Stage 2 takes the pole pair at the 2nd angle of the formula:
σ (sigma) and ω (omega) are the pole's real and imaginary parts, the point σ + jω in the s-plane. Its distance from the imaginary axis, σ, is what damps the stage; ω is roughly where its resonance sits. On the Butterworth unit circle:
A pole never comes alone: σ + jω always pairs with its mirror image σ - jω (a real circuit cannot have just one), and multiplying out (s - pole)(s - mirror) gives exactly the s^2 + as + b this stage is trying to build:
b is the squared distance of the pole from the origin, and every Butterworth pole sits on the unit circle, so b is exactly 1 for every stage of every order; only a changes from stage to stage.
Denormalizing puts the real frequency scale back in: replacing s by s/ωc stretches the prototype so that its cutoff of 1 rad/s lands at ωc. Multiplying top and bottom by ωc^2 gives a denominator in the standard second-order form, from which the two numbers a circuit stage is built around, the corner frequency ωn and the quality factor Q, are read off by matching coefficients. (The constant on top is dropped: every stage here is built with unity gain in its passband, so only the denominator matters.)
For a Butterworth response the pole circle derived at the top of this panel has radius ω0 = ωp ε^(-1/n), not ωp itself (they only coincide for Amax = 3.0103 dB). That radius is what the normalized prototype gets scaled by, so this is the step where Amax reaches the component values; for a smaller Amax the poles move outward:
Components
multiple feedbackStage 1
| Component | Value |
|---|---|
| R1 | 10.0 kΩ |
| R2 | 8.20 kΩ |
| R3 | 10.0 kΩ |
| C1 | 6.80 nF |
| C2 | 470 pF |
| f0 actual | 9.83 kHz (-1.75%) |
|---|---|
| Q actual | 1.3047 (-0.14%) |
1% error on any one component moves Q by roughly 0.80% (root-sum-square across all of them).
Pick different C1 and C2 values if the ones above do not match what is in stock; the resistors above are recalculated to fit.
Show the math for this stage's components
The MFB (multiple-feedback) low-pass has one internal node, call it S: R1 from the input to S, C1 from S to ground, R2 from S to the op-amp's inverting input, R3 from the output back to S, and C2 from the inverting input to the output. The non-inverting input is grounded, so with negative feedback the inverting input is a virtual ground (0 V, no current into it). Two current balances (KCL) describe the whole circuit, one at S and one at the inverting input:
The second equation gives V_S in terms of V_out; substituting it into the first and collecting powers of s gives the transfer function, already in the s^2 + as + b shape of the Stages panel:
So a and b play the same role as the a and b already found for this stage, just written in terms of R1, R2, R3, C1 and C2 instead of pole positions. This stage's target is f0 = 10.0 kHz (ωn = 62869.16 rad/s), Q = 1.3066; matching a and b to that target is what picks the component values:
Five parts, two equations: three choices are free. Choosing R1 = R3 forces the DC gain c/b to exactly -1 (the stage inverts, which does not matter for a low-pass magnitude), and picking C1 and C2 leaves two equations in two unknowns, R1 and R2. Writing x = 1/R1 = 1/R3 and y = 1/R2, the a equation says 2x + y = aC1 and the b equation says xy = bC1C2; eliminating y gives one quadratic in x:
A quadratic only has a real solution when its discriminant is positive, which here means C1/C2 >= 8Q^2. This tool searches a preferred capacitor series for a pair that clears that bar and lands both resistors in a sane 200 ohm to 2 megohm range:
Real resistors only come in standard values, so R1 and R2 get rounded to the nearest E24 value: 10.0 kΩ and 8.20 kΩ. Plugging those rounded values back into a and b (not the target ones) gives what this stage will actually do, which is what the "actual" row above and the Bode plot further down are built from:
Stage 2
| Component | Value |
|---|---|
| R1 | 6.80 kΩ |
| R2 | 11.0 kΩ |
| R3 | 6.80 kΩ |
| C1 | 3.30 nF |
| C2 | 1.00 nF |
| f0 actual | 10.1 kHz (+1.24%) |
|---|---|
| Q actual | 0.5455 (+0.80%) |
1% error on any one component moves Q by roughly 0.85% (root-sum-square across all of them).
Pick different C1 and C2 values if the ones above do not match what is in stock; the resistors above are recalculated to fit.
Show the math for this stage's components
The MFB (multiple-feedback) low-pass has one internal node, call it S: R1 from the input to S, C1 from S to ground, R2 from S to the op-amp's inverting input, R3 from the output back to S, and C2 from the inverting input to the output. The non-inverting input is grounded, so with negative feedback the inverting input is a virtual ground (0 V, no current into it). Two current balances (KCL) describe the whole circuit, one at S and one at the inverting input:
The second equation gives V_S in terms of V_out; substituting it into the first and collecting powers of s gives the transfer function, already in the s^2 + as + b shape of the Stages panel:
So a and b play the same role as the a and b already found for this stage, just written in terms of R1, R2, R3, C1 and C2 instead of pole positions. This stage's target is f0 = 10.0 kHz (ωn = 62869.16 rad/s), Q = 0.5412; matching a and b to that target is what picks the component values:
Five parts, two equations: three choices are free. Choosing R1 = R3 forces the DC gain c/b to exactly -1 (the stage inverts, which does not matter for a low-pass magnitude), and picking C1 and C2 leaves two equations in two unknowns, R1 and R2. Writing x = 1/R1 = 1/R3 and y = 1/R2, the a equation says 2x + y = aC1 and the b equation says xy = bC1C2; eliminating y gives one quadratic in x:
A quadratic only has a real solution when its discriminant is positive, which here means C1/C2 >= 8Q^2. This tool searches a preferred capacitor series for a pair that clears that bar and lands both resistors in a sane 200 ohm to 2 megohm range:
Real resistors only come in standard values, so R1 and R2 get rounded to the nearest E24 value: 6.80 kΩ and 11.0 kΩ. Plugging those rounded values back into a and b (not the target ones) gives what this stage will actually do, which is what the "actual" row above and the Bode plot further down are built from:
Bode plot
43.6 dB at fsMeets the spec: 43.6 dB of attenuation at fs, at least 40 dB required.
Passband edge: 3.00 dB at fp, at most 3 dB allowed.
Download
A standalone JavaScript file with this exact design: the same order, pole-placement,
denormalization and component-search code as this page, parameterized at the top so it
can be edited and rerun with node filter-design.js. It also prints the same
report shown above, plus notes on simulating, building and testing the result.
Every formula this design used, on its own reference page with what each one is and how to use it: Formula sheet.
Next steps
This tool only gets to a paper design. Before trusting it on a bench:
- Simulate before you build. Every number above comes from an ideal op-amp: infinite gain-bandwidth, no slew rate limit. Drop the design into LTSpice (or any SPICE simulator) with the real op-amp model you plan to use (e.g. a TL082 .subckt) and rerun an AC sweep. Check that the model's gain-bandwidth is at least 10-20x your highest stage's f0 times that stage's gain - below that, the real op-amp starts rolling off before your filter does, and the passband/stopband numbers stop being accurate.
- Build and test one stage at a time. Confirm each stage's measured f0 and Q against this design's actual values before wiring the next stage on, instead of assembling the whole cascade and hoping.
- Match impedances between stages. The output impedance of one stage should stay well below the input impedance of the next (Zout << Zin), otherwise the second stage loads the first and both f0 and Q drift from what was computed. This matters most between the last filter stage and whatever it feeds.
- Measure a real Bode plot. Compare it to the simulated response above: a handful of points swept from fp/10 to fs*10 with a function generator and a scope (or an audio analyzer) is enough to catch a wiring mistake or a component that is the wrong value.
- If the measured response drifts, check sensitivity first. The sensitivity numbers above say how much a single component being off by 1% moves Q - that is usually the first place to look before assuming the design itself is wrong.