---
title: Filter order and roll-off
heading: How many poles a filter needs
eyebrow: C4 · Lesson 7 · Filter order and roll-off
xp: 40
---

::: hook
A single RC stage rolls off at 20 dB per decade. That's gentle: one decade above the corner, a tenth of the unwanted signal still gets through. To drop sharply from passband to stopband, a filter needs more poles. But piling up identical RC stages also sags the passband well before the corner. Proper filter designs place their poles carefully so the response stays flat as long as possible and then falls fast.

::: play
- Two low-pass filters of order n, both with a 1 kHz corner: n identical RC stages (buffered so they don't load each other), and a Butterworth filter, the flattest possible.
- Raise n from 1 to 6. Compare their attenuation at 2 kHz, and at the 1 kHz corner.
- How many poles would you need to knock a 2 kHz tone down by 60 dB?
:::
:::

```sim plot
view: graph
x: f = 100..100k Hz log
y: gain = -120..5 dB
slider: n = 1..8 step 1 = 2
plot: 20*log10(1/sqrt(1 + (f/1000)^(2*n))) | label: Butterworth, order n
plot: 20*log10(1/(1 + (f/1000)^2)^(n/2)) | color: ch2 | label: n RC stages
marker: x = 1000 | label: corner
readout: Butterworth at 2 kHz = 20*log10(1/sqrt(1 + 2^(2*n))) dB
readout: RC stages at 2 kHz = 20*log10(1/(1 + 4)^(n/2)) dB
readout: RC stages at 1 kHz = 20*log10(1/2^(n/2)) dB
```

::: predict
## Four identical buffered RC low-pass stages, each with a 1 kHz corner, are cascaded. What is the total gain at 1 kHz?

- [ ] −3 dB
- [ ] −6 dB
- [x] −12 dB
- [ ] −80 dB

::: reveal
−12 dB. Each stage is 3 dB down at its own corner, and the stages multiply, so four of them are 12 dB down: the overall −3 dB point has moved well below 1 kHz. A fourth-order Butterworth filter with a 1 kHz corner is exactly 3 dB down at 1 kHz, and flat almost to the corner, because its four poles aren't identical: they're spread around a circle in the s-plane.
:::
:::

::: nameit
## Order

**Order** is the number of poles (for a low-pass, the number of reactive parts that matter). Far above the corner, a filter of order n falls at

$$-20n\text{ dB per decade} = -6n\text{ dB per octave}$$

**Cascading identical stages** multiplies their responses: $|H| = (1 + (f/f_c)^2)^{-n/2}$. At $f_c$ that's $-3n$ dB, so the passband droops early.

**The Butterworth response** is the flattest possible in the passband:

$$|H| = \frac{1}{\sqrt{1 + (f/f_c)^{2n}}}$$

It's exactly −3 dB at $f_c$ for any order, and almost perfectly flat below. Its poles lie evenly spaced on a semicircle of radius $\omega_c$ in the left half of the s-plane; for n = 2 that's a single section with $Q = 0.707$.

**Other designs trade flatness for sharpness or timing:**

- **Chebyshev:** allows ripple in the passband, for a steeper initial fall.
- **Elliptic:** ripple in both bands, the steepest transition for a given order.
- **Bessel:** the most uniform delay, so pulses keep their shape, at the cost of a gentle roll-off.

**How many poles?** To attenuate by A dB at frequency $f$ with a Butterworth:

$$n \geq \frac{\log_{10}\left(10^{A/10} - 1\right)}{2\log_{10}(f/f_c)}$$

rounded up. Roughly: each pole buys 6 dB per octave of separation between corner and stopband.
:::


::: example
## A Butterworth low-pass must be 40 dB down at four times its corner. What order?

::: solution
1. **Order formula.**
   $$\begin{aligned} n &\ge \frac{\log_{10}(10^4 - 1)}{2\log_{10}4} \\ &= \frac{4.00}{1.20} \\ &= 3.32 \end{aligned}$$
2. **Round up.** The order is a whole number, so it's 4.
3. **Check.** At four times the corner a fourth-order filter is
   $$10\log_{10}(1 + 4^8) = 48.2\ \text{dB}$$
   down.

**Answer:** fourth order, which is 48.2 dB down at four times the corner.
:::
:::

::: example
## Compare three identical buffered RC stages with a third-order Butterworth filter, both cornered at $f_c$, at $f_c$ and at $f_c/2$.

::: solution
1. **RC cascade at $f_c$.**
   $$\begin{aligned} G &= -3 \times 3.01 \\ &= -9.0\ \text{dB} \end{aligned}$$
2. **RC cascade at $f_c/2$.**
   $$\begin{aligned} G &= -3 \times 10\log_{10}1.25 \\ &= -2.9\ \text{dB} \end{aligned}$$
3. **Butterworth at $f_c$.** It gives −3.0 dB.
4. **Butterworth at $f_c/2$.**
   $$\begin{aligned} G &= -10\log_{10}(1 + 1/64) \\ &= -0.07\ \text{dB} \end{aligned}$$

**Answer:** the RC cascade gives −9.0 dB at $f_c$ and −2.9 dB at $f_c/2$; the Butterworth gives −3.0 dB and −0.07 dB, a much flatter passband.
:::
:::

::: example
## A Butterworth low-pass must be 60 dB down at ten times its corner. What order does it need?

::: solution
1. **Butterworth attenuation.**
   $$A = 10\log(1 + x^{2n})$$
2. **Solve for n.** Setting it to 60 dB at x = 10:
   $$\begin{aligned} n &= \frac{\log(10^6 - 1)}{2\log10} \\ &= 3.0 \end{aligned}$$
3. **Check.** A third-order filter gives exactly 60.0 dB there.
4. **Far from the corner.** Each order adds 20 dB per decade, so far from the corner the count is easy: 60 dB in one decade needs three poles.
5. **Near the corner.** Close to the corner, or with a ripple allowance, the formula is needed.

**Answer:** third order, which gives exactly 60.0 dB at ten times the corner.
:::
:::

::: check
given: n = 1 | 2 | 3 | 4 | 6
answer: -20*n
unit: dB/dec
tolerance: 0.5%

## An order-{n} low-pass: what is its roll-off rate far above the corner?

::: right
Right. −20 dB per decade per pole: {answer}.
:::

::: misses
- [-6*n] That's per octave.
- [any] Not yet. $-20n$ dB per decade.
:::
:::

::: check
given: n = 2 | 3 | 4; k = 1.2 | 1.5
answer: -10*log10(1 + k^(2*n))
unit: dB
tolerance: 0.5%

## An order-{n} Butterworth low-pass: what is its gain at {k} times its corner frequency?

::: right
Right. $-10\log_{10}(1 + k^{2n})$ = {answer}.
:::

::: misses
- [-20*n*log10(k)] That's the straight-line asymptote. Use the exact formula.
- [-10*log10(1 + k^2)*n] That's n identical RC stages.
- [any] Not yet. $|H|^2 = 1/(1 + (f/f_c)^{2n})$.
:::
:::

::: check
given: A = 40 | 60 | 80; k = 2 | 4 | 10
answer: ceil(log10(10^(A/10) - 1)/(2*log10(k)))
tolerance: 0.5%

## A Butterworth low-pass must attenuate by at least {A} dB at {k} times its corner frequency. What is the lowest order that does it?

::: right
Right. $n \geq \frac{\log_{10}(10^{A/10} - 1)}{2\log_{10}k}$, rounded up: {answer}.
:::

::: misses
- [any] Not yet. Solve $10\log_{10}(1 + k^{2n}) \geq A$ for n and round up.
:::
:::

::: check
given: n = 2 | 3 | 4 | 6
answer: -10*log10(2)*n
unit: dB
tolerance: 0.5%

## {n} identical buffered RC low-pass stages share a corner frequency. What is their combined gain at that frequency?

::: right
Right. Each is 3.01 dB down: {answer} in total.
:::

::: misses
- [-10*log10(2)] That's one stage, or a Butterworth of any order.
- [any] Not yet. Multiply the stages: add their −3 dB.
:::
:::

::: check
kind: match

## Match each filter design to its strength.

- Butterworth :: flattest passband with no ripple
- Chebyshev :: steeper fall-off, with passband ripple
- Bessel :: most uniform delay, so pulses keep their shape
- cascaded identical RC :: simplest to build, with a drooping passband

::: right
Right. Each design places its poles differently to favor one quality.
:::
:::

::: check
kind: parts
given: A = 40 | 60 | 80; x = 3 | 10

## A Butterworth low-pass must be {A} dB down at {x} times its corner.

::: part
answer: log(10^(A/10) - 1)/(2*log(x))
tolerance: 0.5%

### What order does that take, before rounding up?

::: misses
- [A/(20*x)] Attenuation grows with the logarithm of frequency: solve $10\log(1 + x^{2n}) = A$.
- [any] $n = \frac{\log(10^{A/10} - 1)}{2\log x}$.
:::
:::

::: part
answer: 10*log(1 + x^(2*3))
unit: dB
tolerance: 0.5%

### What would a third-order filter give there?

::: misses
- [any] $10\log(1 + x^6)$.
:::
:::
:::

::: check
kind: derivation
vars: x = 0.01..100, n = 1..10, A = 3..100

## An n-th order Butterworth low-pass at x = f/f₀.

::: step
answer: 1/sqrt(1 + x^(2*n))

### What's its gain?
:::

::: step
answer: 10*log(1 + x^(2*n))

### What's its attenuation in dB?
:::

::: step
answer: (10^(A/10) - 1)^(1/(2*n))

### At what x does it reach A dB?
:::

::: right
Right. Higher order brings the attenuation in closer to the corner.
:::
:::

::: check
kind: python

## Write `butter_qs(n)` returning the Q of each pole pair of an order-n Butterworth filter, smallest first. The poles sit on a circle, spaced π/n apart and placed symmetrically about the negative real axis: for even n the pairs are at $\theta_k = \frac{(2k - 1)\pi}{2n}$ from that axis, for odd n at $\theta_k = \frac{k\pi}{n}$ with one real pole left over, which has no Q. A pair at angle θ has $Q = \frac{1}{2\cos\theta}$.

```python starter
def butter_qs(n):
    return [0.7071] * (n // 2)

print(butter_qs(4))
```

```python solution
import math

def butter_qs(n):
    qs = []
    for k in range(1, n // 2 + 1):
        theta = (2 * k - 1) * math.pi / (2 * n) if n % 2 == 0 else k * math.pi / n
        qs.append(1 / (2 * math.cos(theta)))
    return sorted(qs)

print(butter_qs(4))
```

```python tests
q2 = butter_qs(2)
assert len(q2) == 1 and abs(q2[0] - 0.70711) < 1e-4, f"Second order: one pair with Q = 0.707; got {q2}"
q4 = butter_qs(4)
assert len(q4) == 2 and abs(q4[0] - 0.54120) < 1e-4 and abs(q4[1] - 1.30656) < 1e-4, f"Fourth order: 0.541 and 1.307; got {q4}"
q5 = butter_qs(5)
assert len(q5) == 2 and abs(q5[0] - 0.61803) < 1e-4 and abs(q5[1] - 1.61803) < 1e-4, f"Fifth order: 0.618 and 1.618, plus a real pole; got {q5}"
```

::: right
Right. Each Sallen-Key stage of a Butterworth cascade gets one of these Qs, and the highest-Q stage needs the closest-matched capacitors.
:::
:::

::: explain
## Why does a Butterworth filter of a given order stay flatter in its passband than the same number of identical RC stages?

::: model
Identical RC stages each start losing gain gradually well below their shared corner, and because the losses multiply, the droop compounds: n stages are 3n dB down at the corner. A Butterworth filter places its poles at different positions, some close to the imaginary axis with higher Q, so their small peaking offsets the others' droop. The result is a response that stays almost perfectly flat until near the corner, where it is only 3 dB down, and then falls at the same final rate.
:::
:::

::: practice

::: check
given: n = 1 | 2 | 4
answer: -6*n
unit: dB/oct
tolerance: 1%

## Order {n}: roll-off per octave?

::: misses
- [-20*n] That's per decade.
- [any] About $-6n$ dB per octave.
:::
:::

::: check
given: n = 2 | 3 | 5
answer: -10*log10(2)
unit: dB
tolerance: 0.5%

## An order-{n} Butterworth: gain at its corner?

::: misses
- [-10*log10(2)*n] That's n RC stages. A Butterworth is −3 dB at its corner for any order.
- [any] −3 dB.
:::
:::

::: check
given: n = 2 | 3 | 4; d = 1 | 2
answer: -20*n*d
unit: dB
tolerance: 1%

## Far above its corner, by how much does an order-{n} filter's gain fall over {d} decade(s)?

::: misses
- [any] $-20n$ dB per decade.
:::
:::
:::
