| Parts | Frequency | Q | Gain |
|---|
Tool
One active filter stage, calculated both ways: from frequency, Q and gain to resistors and capacitors, or from the parts to the response. Choose which values are held and which may change, and search for designs built from the parts you actually have.
| Parts | Frequency | Q | Gain |
|---|
A second-order filter stage is described by three numbers: its frequency f0, its quality factor Q, and its gain. Five or six resistors and capacitors set them. There are more parts than numbers, so many part combinations give the same response. Most calculators pick one combination for you. This one lets you decide which parts are fixed and which may change, and works out the rest in either direction.
A filter of order N is usually built as N/2 second-order stages in series, plus one first-order RC stage when N is odd. The filter type decides where the poles sit, and so the frequency and Q of every stage. Pick a type, an order and a cutoff frequency, then the stage you are building, and its frequency and Q become the held targets. Build each stage in turn, and put them in series with the lowest Q first.
For each pole p, normalised to a cutoff of 1, a stage has f0 = |p| · f_cutoff and Q = |p| / (2 |Re p|). A high-pass uses the same Q at f0 = f_cutoff / |p|. A band-pass stage is set with the frequency and Q directly. The chart shows the stage you are building, not the whole filter; the Square-to-Sine Filter Designer shows a complete chain.
When there are more free parts than held targets, the calculation changes the free parts as little as possible (on a log scale) from where they are. When the held targets can’t all be reached, for example a Q of 5 from a unity-gain Sallen-Key with equal capacitors, it lands on the closest possible result and says what is missing. Each target counts in proportion to its allowed deviation. The calculation is a damped least-squares fit (Levenberg–Marquardt) on the logarithms of the part values, which keeps every part positive and treats a 1 % change the same for a 100 Ω and a 1 MΩ resistor.
Every stage has the same form, with a denominator
D(s) = a2·s² + a1·s + 1 f0 = 1 / (2π √a2) Q = √a2 / a1and a numerator that sets the response: G for a low-pass, G·a2·s² for a high-pass and G·a1·s for a band-pass, so G is the gain in the passband, or at f0 for the band-pass. Per circuit, with K = 1 + Rf / Rg the gain of the Sallen-Key amplifier:
Sallen-Key low-pass a2 = R1 R2 C1 C2 a1 = C2 (R1 + R2) + R1 C1 (1 − K) G = K Sallen-Key high-pass a2 = R1 R2 C1 C2 a1 = R1 (C1 + C2) + R2 C2 (1 − K) G = K MFB low-pass a2 = R2 R3 C1 C2 a1 = C2 (R2 + R3 + R2 R3 / R1) G = −R2 / R1 MFB high-pass a2 = R1 R2 C2 C3 a1 = R1 (C1 + C2 + C3) G = −C1 / C2 MFB band-pass a2 = R3 Rp C1 C2 a1 = Rp (C1 + C2), Rp = R1 ∥ R2 G = −R3 C2 / (R1 (C1 + C2))The unity-gain Sallen-Key has K = 1. If a1 drops to zero or below, which happens in a Sallen-Key with too much gain, the stage is unstable and the tool says so. All formulas assume an ideal op-amp. They were checked against a full node-by-node circuit simulation of every topology.
Some useful limits follow from them. A unity-gain Sallen-Key low-pass can’t reach a higher Q than ½·√(C1/C2), so Q = 5 needs C1 at least 100 times C2. A multiple-feedback band-pass needs Q² > G/2 with equal capacitors. The tool finds these limits itself: free a part, hold a target and it either reaches it or tells you the closest possible value.
For the current parts and for every design from the search, the tool calculates how much each part moves f0, Q and gain. That is the sensitivity S, the percentage change in the result for a 1 % change in the part, found by changing every part a little in turn. With the tolerance t of each part:
worst case = Σ |S| · t every part at its limit, all in the unlucky direction typical = √ Σ (S · t)² independent parts, the usual statistical estimateFor a Sallen-Key stage, f0 has a sensitivity of ½ to each of its four R’s and C’s, so 1 % resistors and 5 % capacitors give up to ±6 % on f0 (typically ±3.6 %). Q is usually less sensitive, except in high-Q stages and in Sallen-Key stages with gain. A design that is 0.1 % from its target but spreads ±3 % from tolerance is no better in practice than one that is 1 % off, so the search shows both. The pink band in the chart is the response with every part at either end of its tolerance, in every combination.
The search builds the stage from your resistor and capacitor sets. Held parts stay as they are, and every free part gets a value from its set. With six free parts and a hundred values each, trying everything would take 10¹² circuits, so it goes in three steps:
Combinations make a set much denser. Capacitor combinations are then fine enough to be calculated and rounded, so the search tries every resistor value instead and lets the capacitors follow. Up to 400 values are used for pairs and 40 for groups of three, spread evenly over the set, to keep the search fast. A combination gets the worst-case tolerance of its parts, each weighted by how much it moves the total. Most in total caps the number of resistors or capacitors in the whole stage, combinations and held parts included.
Only designs within the allowed deviation of every held target are listed. The allowed deviation can be changed next to each target and in the list’s column headers. Closest frequency, Closest Q and Closest gain sort by the deviation from that one target, Fewest parts by the number of parts the free positions need, and Least spread by the tolerance spread. The best few hundred are kept, without duplicates, and with quantity limits from your own list respected (10k x2 is never used three times). Very large sets are narrowed to a window around the ideal values so the search stays under a second or two.
Typing a part does not restart the search, as long as held parts, targets and sets stay the same. That way you can click through the designs and use one without the list changing under you.
Low resistances make the source and the op-amp deliver more current. The Currents section works that out: it solves the circuit node by node (the op-amp as an amplifier with a gain of 10⁷) at 181 frequencies from f0/1000 to 1000·f0, at the input level you set, and reports the largest values it finds:
Values take the usual prefixes: 4700, 4.7k, 4k7, 2R2, 1M, 10n, 4n7, 0.1u, 100p, 1e-9. A lowercase m means milli. Gain can also be typed in dB, like 6dB. The resistor list is the same one the Resistor Combination Finder uses, with the same format: one value per line, an optional quantity (10k x4) and an optional tolerance (4k7 0.1%). The capacitor list works the same way. Download list saves a list as a file (the resistor file also loads in the Resistor Combination Finder), Load list reads it back, and Copy link puts the list in a link.