---
title: Active filters
heading: Resistors, capacitors and an amplifier in place of inductors
eyebrow: C4 · Lesson 13 · Active filters
xp: 40
---

::: hook
A sharp audio filter built only from R, L and C would need inductors of hundreds of millihenries: heavy, expensive coils that pick up hum. Add an amplifier, and resistors and capacitors alone can produce the same second-order responses. The amplifier also isolates each stage from the next, so stages can be cascaded without loading each other. Op-amps (C6) are the usual amplifier; here an ideal buffer (a controlled source with a gain of 1, from C1.21) stands in for one.

::: play
- A Sallen-Key low-pass: two resistors, two capacitors, and a buffer whose output feeds back through $C_1$. The Bode plot shows its response.
- With $C_1 = 2C_2$ and equal resistors, it's a Butterworth: flat, then falling 40 dB per decade. Raise $C_1$. What happens near the corner?
- Lower $C_1$ below $C_2$. What does the response look like now?
:::
:::

```sim circuit
V1 in 0 sine 1 V 1k Hz      @ 0,0 down
R1 in a 10k                 @ 0,0 right
R2 a b 10k                  @ 2,0 right
C2 b 0 10n                  @ 4,0 down
C1 a out 20n                @ 2,-2 right 4
E1 out 0 b 0 1              @ 6,-2 down 4
slider: C1 2n..200n log
slider: C2 2n..100n log
bode: v(out)/v(in) | f = 10..100k Hz
```

::: predict
## In the Sallen-Key filter, what does the feedback capacitor $C_1$ do near the corner frequency?

- [ ] Nothing: it's only there for stability
- [x] It feeds the output back into the middle node, boosting the response near the corner and setting Q
- [ ] It blocks DC from the output
- [ ] It doubles the order of the filter

::: reveal
It sets Q. Near the corner, the buffered output swings in step with node b and pushes current back into node a through $C_1$, partly cancelling the loss through $R_1$. The bigger $C_1$ is relative to $C_2$, the stronger that boost and the higher the Q. With equal resistors, $Q = \tfrac12\sqrt{C_1/C_2}$: $C_1 = 2C_2$ gives the Butterworth Q of 0.707.
:::
:::

::: nameit
## Active filters

**Why not inductors?** At audio frequencies, inductors big enough for useful filters are bulky, lossy and pick up magnetic hum. Capacitors and resistors are small, cheap and precise.

**The unity-gain Sallen-Key low-pass** (as above, with an ideal buffer):

$$H(s) = \frac{1}{s^2R_1R_2C_1C_2 + sC_2(R_1 + R_2) + 1}$$

so

$$f_0 = \frac{1}{2\pi\sqrt{R_1R_2C_1C_2}} \qquad Q = \frac{\sqrt{R_1R_2C_1C_2}}{C_2(R_1 + R_2)}$$

With $R_1 = R_2 = R$: $f_0 = 1/(2\pi R\sqrt{C_1C_2})$ and $Q = \tfrac12\sqrt{C_1/C_2}$.

**Higher orders by cascading.** Each buffered stage has a low output impedance, so the next stage doesn't load it, and transfer functions simply multiply. A fourth-order Butterworth is two second-order stages with Qs of 0.54 and 1.31; a sixth-order one, three stages.

**Other topologies** (C6.26): multiple-feedback filters (inverting, good for band-pass), state-variable filters (low-, high- and band-pass outputs at once), and switched-capacitor filters inside chips.

**The catch.** Active filters need power, add the amplifier's noise, and only work up to frequencies where the amplifier still has plenty of gain. Above a few megahertz, LC filters take over again.
:::


::: example
## A unity-gain Sallen-Key low-pass has $R_1 = R_2$ = 10 kΩ, $C_1$ = 22 nF and $C_2$ = 10 nF. Find $f_0$ and Q.

::: solution
1. **Natural frequency.** Here $\sqrt{C_1C_2}$ = 14.8 nF:
   $$\begin{aligned} f_0 &= \frac{1}{2\pi R\sqrt{C_1C_2}} \\ &= \frac{1}{2\pi \times 10^4 \times 14.8 \times 10^{-9}} \\ &= 1.07\ \text{kHz} \end{aligned}$$
2. **Q.**
   $$\begin{aligned} Q &= \frac12\sqrt{2.2} \\ &= 0.74 \end{aligned}$$
   just above Butterworth.

**Answer:** $f_0$ = 1.07 kHz and Q = 0.74, just above Butterworth.
:::
:::

::: example
## The same stage built with $R_1$ = 10 kΩ, $R_2$ = 20 kΩ, $C_1$ = 20 nF and $C_2$ = 5 nF: what are $f_0$ and Q?

::: solution
1. **The time constant.**
   $$\begin{aligned} &\sqrt{R_1R_2C_1C_2} \\ &= \sqrt{2 \times 10^8 \times 10^{-16}}\ \text{s} \\ &= 141\ \mu\text{s} \end{aligned}$$
2. **Natural frequency.**
   $$\begin{aligned} f_0 &= \frac{1}{2\pi \times 141\ \mu\text{s}} \\ &= 1.13\ \text{kHz} \end{aligned}$$
3. **Q.**
   $$\begin{aligned} Q &= \frac{141\ \mu\text{s}}{C_2(R_1 + R_2)} \\ &= \frac{141}{150} \\ &= 0.94 \end{aligned}$$

**Answer:** $f_0$ = 1.13 kHz and Q = 0.94.
:::
:::

::: example
## Design a unity-gain Sallen-Key low-pass with equal 10 kΩ resistors for f₀ = 1 kHz and Q = 0.707.

::: solution
1. **Capacitor ratio.** With equal resistors,
   $$Q = \frac12\sqrt{\frac{C_1}{C_2}}$$
   so Q = 0.707 needs $C_1 = 2C_2$.
2. **Write $f_0$ in terms of $C_2$.**
   $$\begin{aligned} f_0 &= \frac{1}{2\pi R\sqrt{C_1C_2}} \\ &= \frac{1}{2\pi R \cdot 2QC_2} \end{aligned}$$
3. **Solve for the capacitors.**
   $$\begin{aligned} C_2 &= \frac{1}{4\pi Qf_0R} \\ &= 11.3\ \text{nF} \\ C_1 &= 22.5\ \text{nF} \end{aligned}$$
4. **Standard values.** Standard values of 11 nF and 22 nF give f₀ = 1.02 kHz and Q = 0.707.
5. **Tolerance.** Q depends only on the capacitor ratio, so matched-tolerance parts keep it right.

**Answer:** $C_1$ = 22.5 nF and $C_2$ = 11.3 nF, or standard values of 22 nF and 11 nF.
:::
:::

::: check
given: R = 4.7 | 10 | 22; C1 = 20 | 47; C2 = 10 | 22
answer: 1/(2*pi*R*1e3*sqrt(C1*1e-9*C2*1e-9))
unit: Hz
tolerance: 0.5%

## A unity-gain Sallen-Key low-pass has $R_1 = R_2$ = {R} kΩ, $C_1$ = {C1} nF and $C_2$ = {C2} nF. What is $f_0$?

::: right
Right. $1/(2\pi R\sqrt{C_1C_2})$ = {answer}.
:::

::: misses
- [1/(R*1e3*sqrt(C1*1e-9*C2*1e-9))] Include 2π.
- [1/(2*pi*R*1e3*(C1 + C2)*1e-9)] Use the geometric mean of the capacitors.
- [any] Not yet. $f_0 = 1/(2\pi R\sqrt{C_1C_2})$.
:::
:::

::: check
given: k = 2 | 4 | 8 | 16
answer: 0.5*sqrt(k)
tolerance: 0.5%

## A unity-gain Sallen-Key low-pass has equal resistors and $C_1$ = {k} × $C_2$. What is its Q?

::: right
Right. $Q = \tfrac12\sqrt{C_1/C_2}$ = {answer}.
:::

::: misses
- [sqrt(k)] Include the ½.
- [0.5*k] Take the square root of the ratio.
- [any] Not yet. $Q = \tfrac12\sqrt{C_1/C_2}$.
:::
:::

::: check
given: Q = 0.707 | 1 | 2 | 3; C2 = 10 | 22
answer: 4*Q^2*C2
unit: nF
tolerance: 1%

## With equal resistors and $C_2$ = {C2} nF, what $C_1$ gives Q = {Q}?

::: right
Right. $C_1 = 4Q^2C_2$ = {answer}.
:::

::: misses
- [2*Q*C2] Q depends on the square root of the ratio: $C_1 = 4Q^2C_2$.
- [Q^2*C2] Include the factor of 4.
- [any] Not yet. Solve $Q = \tfrac12\sqrt{C_1/C_2}$ for $C_1$.
:::
:::

::: check
given: n = 2 | 3 | 4
answer: 2*n
tolerance: 0.5%

## How many poles does a cascade of {n} second-order Sallen-Key stages have?

::: right
Right. Two per stage: {answer}.
:::

::: misses
- [n] Each stage is second-order.
- [any] Not yet. Count two poles per stage.
:::
:::

::: check
kind: choice

## Why can buffered active filter stages simply be cascaded, with their transfer functions multiplying?

- [ ] The amplifiers cancel each other's phase
- [x] Each stage's output has very low impedance and each input very high, so no stage loads the one before it
- [ ] Active filters have no poles
- [ ] Capacitors don't interact at high frequencies

::: right
Right. Without loading, each stage behaves exactly as it would alone.
:::

::: misses
- [1] Phases add; nothing cancels.
- [3] They have poles: that's what makes them filters.
- [4] Passive stages do interact, at every frequency.
:::
:::

::: check
kind: parts
given: f = 0.1 | 1 | 10; R = 4.7 | 10; Q = 0.577 | 0.707 | 1

## A unity-gain Sallen-Key low-pass with equal {R} kΩ resistors needs f₀ = {f} kHz and Q = {Q}.

::: part
answer: 1/(4*pi*Q*f*1e3*R*1e3)*1e9
unit: nF
tolerance: 0.5%

### What's $C_2$?

::: misses
- [any] $C_2 = \frac{1}{4\pi Qf_0R}$.
:::
:::

::: part
answer: 4*Q^2/(4*pi*Q*f*1e3*R*1e3)*1e9
unit: nF
tolerance: 0.5%

### What's $C_1$?

::: misses
- [any] $C_1 = 4Q^2C_2$.
:::
:::
:::

::: check
kind: derivation
vars: R = 1000..100000, a = 0.000000001..0.000001, b = 0.000000001..0.000001

## An equal-resistor unity-gain Sallen-Key low-pass with R, $C_1$ = a and $C_2$ = b.

::: step
answer: 1/(2*pi*R*sqrt(a*b))

### What's f₀?
:::

::: step
answer: sqrt(a/b)/2

### What's Q?
:::

::: right
Right. Q depends only on the capacitor ratio.
:::
:::

::: explain
## How does an amplifier let a filter made only of resistors and capacitors produce a peaked, high-Q response that would otherwise need an inductor?

::: model
A passive RC network can only lose energy, so its poles always lie on the real axis and its response can never peak. An amplifier supplies energy: in the Sallen-Key circuit, the buffered output is fed back through a capacitor into an earlier node, adding a signal that reinforces the response near the corner frequency. That positive feedback moves the poles off the real axis into a complex pair, exactly as an inductor and capacitor would, and the feedback strength (set by the capacitor ratio) controls how sharp the peak is.
:::
:::

::: practice

::: check
given: Q = 0.707 | 1 | 2
answer: 4*Q^2
tolerance: 1%

## Equal-resistor Sallen-Key: what ratio $C_1/C_2$ gives Q = {Q}?

::: misses
- [2*Q] $C_1/C_2 = 4Q^2$.
- [any] $4Q^2$.
:::
:::

::: check
given: R = 10 | 20; C = 10 | 20
answer: 1/(2*pi*R*1e3*C*1e-9)
unit: Hz
tolerance: 0.5%

## Equal resistors {R} kΩ and equal capacitors {C} nF in a Sallen-Key low-pass. $f_0$?

::: misses
- [any] $1/(2\pi RC)$.
:::
:::

::: check
given: k = 1 | 4 | 9
answer: 0.5*sqrt(k)
tolerance: 0.5%

## $C_1 = \given{k}C_2$, equal resistors. Q?

::: misses
- [any] $\tfrac12\sqrt{C_1/C_2}$.
:::
:::
:::
