---
title: Active filters
heading: Second-order filters with op amps
eyebrow: C6 · Lesson 26 · Active filters
xp: 50
---

::: hook
C4.13 built active filters around an ideal buffer. With real op amps, two circuits cover most needs. The Sallen-Key uses the op amp as a buffer and shapes low-pass and high-pass responses. The multiple-feedback (MFB) circuit puts the op amp's inverting input to work, and makes a good band-pass. Both are cheap and accurate, provided the op amp is fast enough for the job.

::: play
- An MFB band-pass centered near 1 kHz, with Q = 10 and a gain of 1 at the center. The op amp has a 10 MHz gain-bandwidth.
- Change $R_2$. The center frequency moves; what happens to the peak's height and width?
- Change $R_3$. Now what changes?
:::
:::

```sim circuit
V1 in 0 sine 1 V 1k Hz      @ 0,0 down 2
R1 in a 159k                @ 0,0 right
R2 a 0 800                  @ 2,0 down 2
C1 a m 10n                  @ 2,0 right 2
C2 a out 10n                @ 2,-2 right 5
R3 m out 318k               @ 4,-1 right 3
U1 0 m out GBW=10M          @ 4,1
slider: R2 200..3.3k log
slider: R3 100k..1M log
bode: v(out)/v(in) | f = 100..10k Hz
```

::: predict
## In the MFB band-pass above, you lower $R_2$ alone. What happens?

- [ ] The gain at the peak changes
- [x] The center frequency rises, while the gain and bandwidth stay about the same
- [ ] The Q doubles
- [ ] Nothing

::: reveal
The center frequency rises. In this circuit $R_2$ appears only in the formula for $f_0$; the bandwidth, $1/(\pi R_3C)$, and the center gain, $-R_3/2R_1$, don't involve it. That makes the MFB band-pass easy to tune: one resistor slides it along the frequency axis.
:::
:::

::: nameit
## Two topologies

**Multiple-feedback band-pass.** $R_1$ from the input to node a, $R_2$ from a to ground, $C_1$ from a to the inverting input, $C_2$ from a to the output, and $R_3$ from the output back to the inverting input. With $C_1 = C_2 = C$:

$$f_0 = \frac{1}{2\pi C}\sqrt{\frac{R_1 + R_2}{R_1R_2R_3}} \qquad Q = \pi f_0R_3C \qquad H(f_0) = -\frac{R_3}{2R_1}$$

Bandwidth $f_0/Q = 1/(\pi R_3C)$.

**Sallen-Key low-pass with gain.** With equal resistors and equal capacitors and the op amp set for gain K:

$$f_0 = \frac{1}{2\pi RC} \qquad Q = \frac{1}{3 - K}$$

A Butterworth (Q = 0.707) needs $K = 3 - \sqrt2 = 1.586$. As K approaches 3, Q grows without limit and the filter becomes an oscillator: positive feedback at work.

**Choosing the op amp.** The filter's math assumes the op amp has huge gain at $f_0$. Its gain-bandwidth must be far above $f_0$ multiplied by the filter's own gain and Q; otherwise the center frequency shifts and the Q creeps up. Simulating with a realistic op amp, as in this sim, shows the error directly.

**Sensitivity.** Real resistors and capacitors have tolerances of 1 to 10%. A high-Q filter is more sensitive to them, so high-Q designs use precise parts or a tunable resistor.
:::

```sim circuit
V1 in 0 sine 1 V 1k Hz      @ 0,2 down 2
R1 in a 10k                 @ 0,2 right
R2 a b 10k                  @ 2,2 right
C2 b 0 10n                  @ 4,2 down 2
C1 a out 10n                @ 2,0 right 6
U1 b m out GBW=10M          @ 5,3 flip
RF m out 5.86k              @ 5,5 right 3
RG m 0 10k                  @ 4,5 down 2
slider: RF 1k..19k log
bode: v(out)/v(in) | f = 100..100k Hz
```

An equal-component Sallen-Key low-pass at 1.59 kHz, with the op amp set for a gain of $1 + R_F/R_G$. At 5.86 kΩ that's 1.586, a Butterworth. Raise $R_F$ toward 20 kΩ (K → 3) and watch the peak grow.


::: example
## Design an equal-component Sallen-Key Butterworth low-pass with R = 10 kΩ and C = 10 nF.

::: solution
1. **Corner frequency.**
   $$\begin{aligned} f_0 &= \frac{1}{2\pi RC} \\ &= 1.59\ \text{kHz} \end{aligned}$$
2. **Gain for Q = 0.707.**
   $$\begin{aligned} K &= 3 - \frac{1}{0.707} \\ &= 1.586 \end{aligned}$$
   so $R_F/R_G$ = 0.586.

**Answer:** $f_0$ = 1.59 kHz, with a gain of 1.586 ($R_F/R_G$ = 0.586).
:::
:::

::: example
## Design a multiple-feedback band-pass for 1 kHz with Q = 5, using 10 nF capacitors and a center gain of −5.

::: solution
1. **Feedback resistor.**
   $$\begin{aligned} R_3 &= \frac{Q}{\pi f_0C} \\ &= 159\ \text{k}\Omega \end{aligned}$$
2. **Input resistor.** The center gain sets it:
   $$-\frac{R_3}{2R_1} = -5$$
   which gives $R_1$ = 15.9 kΩ.
3. **Third resistor.** The $f_0$ formula fixes $R_2$ = 1.77 kΩ.

**Answer:** $R_3$ = 159 kΩ, $R_1$ = 15.9 kΩ and $R_2$ = 1.77 kΩ.
:::
:::

::: example
## An equal-component Sallen-Key low-pass (R = 10 kΩ, C = 10 nF) has its gain K raised to 2, then to 2.9. What Q results, and what's the gain at $f_0$?

::: solution
1. **Q from the gain.**
   $$Q = \frac{1}{3 - K}$$
2. **K = 2.** Q = 1, and the gain at $f_0$ is KQ = 2: the same as at DC, but now with a peak just below $f_0$.
3. **K = 2.9.** Q = 10, and the gain is 29 at $f_0$ = 1.59 kHz.
4. **At K = 3.** The Q is infinite and the circuit oscillates.
5. **Sensitivity.** Equal-component designs are simple, but their Q depends on a gain set by two resistors, so a high-Q design is sensitive to their tolerance.

**Answer:** K = 2 gives Q = 1 and a gain of 2 at $f_0$; K = 2.9 gives Q = 10 and a gain of 29.
:::
:::

::: check
given: R1 = 100 | 159; R2 = 0.8 | 1.5; R3 = 318; C = 10
answer: 1/(2*pi*C*1e-9)*sqrt((R1 + R2)/(R1*1e3*R2*1e3*R3*1e3))
unit: Hz
tolerance: 0.5%

## An MFB band-pass has $R_1$ = {R1} kΩ, $R_2$ = {R2} kΩ, $R_3$ = 318 kΩ and $C_1 = C_2$ = 10 nF. What is its center frequency?

::: right
Right. $\frac{1}{2\pi C}\sqrt{\frac{R_1 + R_2}{R_1R_2R_3}}$ = {answer}.
:::

::: misses
- [1/(2*pi*C*1e-9*sqrt(R1*1e3*R3*1e3))] All three resistors appear: $\sqrt{(R_1 + R_2)/(R_1R_2R_3)}$.
- [any] Not yet. Use the MFB formula with C in farads and R in ohms.
:::
:::

::: check
given: f0 = 500 | 1000 | 2000; R3 = 100 | 318; C = 10 | 22
answer: pi*f0*R3*1e3*C*1e-9
tolerance: 0.5%

## An MFB band-pass is centered at {f0} Hz with $R_3$ = {R3} kΩ and C = {C} nF. What is its Q?

::: right
Right. $Q = \pi f_0R_3C$ = {answer}.
:::

::: misses
- [2*pi*f0*R3*1e3*C*1e-9] It's π, not 2π.
- [any] Not yet. $Q = \pi f_0R_3C$.
:::
:::

::: check
given: R1 = 50 | 100 | 159; R3 = 318 | 470
answer: -R3/(2*R1)
tolerance: 0.5%

## An MFB band-pass has $R_1$ = {R1} kΩ and $R_3$ = {R3} kΩ. What is its gain at the center frequency?

::: right
Right. $-R_3/(2R_1)$ = {answer}.
:::

::: misses
- [-R3/R1] There's a factor of ½.
- [R3/(2*R1)] The MFB band-pass inverts.
- [any] Not yet. $H(f_0) = -R_3/(2R_1)$.
:::
:::

::: check
given: K = 1 | 1.586 | 2 | 2.5
answer: 1/(3 - K)
tolerance: 0.5%

## An equal-component Sallen-Key low-pass has gain K = {K}. What's its Q?

::: right
Right. $Q = 1/(3 - K)$ = {answer}.
:::

::: misses
- [1/K] It's $1/(3 - K)$.
- [any] Not yet. $Q = 1/(3 - K)$.
:::
:::

::: check
given: Q = 0.707 | 1 | 2 | 5
answer: 3 - 1/Q
tolerance: 0.5%

## What gain K gives an equal-component Sallen-Key low-pass a Q of {Q}?

::: right
Right. $K = 3 - 1/Q$ = {answer}.
:::

::: misses
- [1/Q] Solve $Q = 1/(3 - K)$ for K.
- [any] Not yet. $K = 3 - 1/Q$.
:::
:::

::: check
kind: parts
given: K = 1.5 | 2.2 | 2.5 | 2.8; R = 4.7 | 10; C = 2.2 | 10

## An equal-component Sallen-Key low-pass has R = {R} kΩ, C = {C} nF and gain K = {K}.

::: part
answer: 1/(3 - K)
tolerance: 0.5%

### What's its Q?

::: misses
- [any] $Q = \frac{1}{3 - K}$.
:::
:::

::: part
answer: K/(3 - K)
tolerance: 0.5%

### What's its gain at $f_0$?

::: misses
- [K] At $f_0$ the gain is KQ.
- [any] KQ.
:::
:::
:::

::: check
kind: derivation
vars: f = 10..100000, Q = 0.5..20, C = 0.000000001..0.000001, G = 0.5..20

## A multiple-feedback band-pass at f with quality factor Q, equal capacitors C, and center gain −G.

::: step
answer: Q/(pi*f*C)

### What's $R_3$?
:::

::: step
answer: Q/(pi*f*C)/(2*G)

### What's $R_1$?
:::

::: right
Right. $R_2$ then follows from the $f_0$ formula.
:::
:::

::: explain
## Why does an equal-component Sallen-Key filter turn into an oscillator as its gain approaches 3?

::: model
In a Sallen-Key filter, part of the output is fed back through a capacitor to an earlier node, adding to the signal near the corner frequency: positive feedback. The gain K controls how strong that feedback is, and Q is $1/(3 - K)$. As K approaches 3, Q grows without limit, which means the poles move toward the imaginary axis and the response rings longer and longer. At K = 3 the poles reach the axis and any disturbance rings forever: the filter has become an oscillator.
:::
:::

::: practice

::: check
given: f0 = 1 | 2; Q = 5 | 10
answer: f0*1000/Q
unit: Hz
tolerance: 0.5%

## Band-pass at {f0} kHz with Q = {Q}. Bandwidth?

::: misses
- [any] $f_0/Q$.
:::
:::

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

## Equal-component Sallen-Key, R = {R} kΩ, C = {C} nF. $f_0$?

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

::: check
given: K = 1.2 | 1.586 | 2.2
answer: (K - 1)*10
unit: kΩ
tolerance: 0.5%

## A non-inverting stage with $R_G$ = 10 kΩ must have gain {K}. $R_F$?

::: misses
- [K*10] Gain is $1 + R_F/R_G$.
- [any] $(K - 1)R_G$.
:::
:::
:::
