---
title: Filter specifications and order
heading: From a requirement to the number of poles it takes
eyebrow: C4 · Lesson 8 · Filter specifications
xp: 40
---

::: hook
"Make a low-pass filter" isn't a specification. A real one says: frequencies up to 1 kHz must pass with at most 1 dB of loss, and anything above 5 kHz must be at least 40 dB down. Between those edges lies the transition band, and how narrow it is decides how many poles the filter needs, and so how many capacitors, inductors and amplifiers. Choosing the order from the specification is the first step of every filter design, before any component values.
:::

::: play
- Butterworth low-pass responses of order $n$, against frequency relative to the corner (log scales). The marker is the stopband edge.
- Each extra order adds 20 dB per decade of roll-off. The readout gives the attenuation at the marker.
- Find the smallest order that's 40 dB down at five times the corner.
:::
:::

```sim plot
view: graph
x: r = 0.1..100 log
y: A = -120..5 dB
slider: n = 1..8 step 1 = 3
slider: rs = 1.5..20 step 0.1 = 5
plot: -10*log(1 + r^(2*n)) | label: Butterworth, order n | samples: 500
marker: x = rs | label: stopband edge
readout: attenuation at the stopband edge, dB = 10*log(1 + rs^(2*n)) | digits: 3
readout: roll-off far above the corner, dB/decade = 20*n | digits: 3
```

::: predict
## A Butterworth low-pass with a 1 kHz corner must be 40 dB down at 5 kHz. What is the lowest order that works?

- [ ] 2
- [x] 3
- [ ] 4
- [ ] 8

::: reveal
3. Order $n$ gives $10\log_{10}(1 + 5^{2n})$ dB at five times the corner: 28 dB for $n = 2$ and 42 dB for $n = 3$. The formula says $n \ge 2.86$, rounded up to the next whole order.
:::
:::

::: nameit
## The specification

A low-pass specification has four numbers:

- **passband edge** $f_p$, with at most $A_p$ dB of loss below it;
- **stopband edge** $f_s$, with at least $A_s$ dB of loss above it.

The region between is the **transition band**; the ratio $f_s/f_p$ measures how sharp the filter must be.

## Butterworth order

A Butterworth response has $|H|^2 = \frac{1}{1 + \varepsilon^2(f/f_p)^{2n}}$, where $\varepsilon^2 = 10^{A_p/10} - 1$ sets the loss at $f_p$ ($A_p$ = 3 dB gives ε = 1, the usual corner). Meeting both edges needs

$$n \ge \frac{\log_{10}\dfrac{10^{A_s/10} - 1}{10^{A_p/10} - 1}}{2\log_{10}(f_s/f_p)}$$

rounded up. Far above the corner it falls at $20n$ dB per decade, $6n$ dB per octave.

## Chebyshev order

A Chebyshev response (lesson 9) allows ripple in the passband and rolls off faster, needing

$$n \ge \frac{\cosh^{-1}\sqrt{\dfrac{10^{A_s/10} - 1}{10^{A_p/10} - 1}}}{\cosh^{-1}(f_s/f_p)}$$

with $\cosh^{-1}x = \ln(x + \sqrt{x^2 - 1})$. For the same specification it often needs one or two fewer poles.

## Other filter types

High-pass, band-pass and band-stop specifications are turned into an equivalent low-pass one (lesson 12), designed, and transformed back.
:::

::: example
## A low-pass must lose at most 1 dB below 1 kHz and at least 40 dB above 5 kHz. What Butterworth order does it need?

::: solution
1. **Ripple factor.**
   $$\begin{aligned} \varepsilon^2 &= 10^{0.1} - 1 \\ &= 0.259 \end{aligned}$$
2. **Order.**
   $$\begin{aligned} n &\ge \frac{\log_{10}(9999/0.259)}{2\log_{10}5} \\ &= \frac{4.587}{1.398} \\ &= 3.28 \end{aligned}$$
   so order 4.
3. **With a 3 dB edge.** With a 3 dB passband edge instead, n ≥ 2.86: order 3.

**Answer:** order 4 (order 3 if the passband edge were the 3 dB point).
:::
:::

::: example
## The same 1 dB, 40 dB specification with a Chebyshev response: what order?

::: solution
1. **Numerator.**
   $$\begin{aligned} \sqrt{9999/0.259} &= 196.5 \\ \cosh^{-1}196.5 &= 5.97 \end{aligned}$$
2. **Denominator.**
   $$\cosh^{-1}5 = 2.29$$
3. **Order.**
   $$\begin{aligned} n &\ge \frac{5.97}{2.29} \\ &= 2.61 \end{aligned}$$
   so order 3, one fewer than Butterworth.

**Answer:** order 3, one fewer than the Butterworth's order 4.
:::
:::

::: example
## A Chebyshev filter is allowed 0.5 dB of passband ripple. What's its ripple factor ε?

::: solution
1. **The dip.** The passband dips to
   $$\frac{1}{\sqrt{1 + \varepsilon^2}}$$
2. **Set the dip to 0.5 dB.**
   $$10\log(1 + \varepsilon^2) = 0.5$$
3. **Solve for ε.**
   $$\begin{aligned} \varepsilon &= \sqrt{10^{0.05} - 1} \\ &= 0.349 \end{aligned}$$
4. **What ε sets.** ε then sets the stopband: beyond the edge the attenuation is
   $$\begin{aligned} A &= 10\log(1 + \varepsilon^2T_n^2(x)) \\ T_n(x) &= \cosh(n\,\text{arccosh}\,x) \end{aligned}$$
5. **More ripple.** More ripple means a larger ε and a steeper fall for the same order.

**Answer:** ε = 0.349.
:::
:::

::: check
given: n = 2 | 4 | 6; r = 2 | 5 | 10
answer: 10*log(1 + r^(2*n))
unit: dB
tolerance: 0.5%

## A Butterworth low-pass of order {n} (3 dB corner) is driven at {r} times its corner. How much does it attenuate?

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

::: misses
- [any] Not yet. $10\log_{10}(1 + r^{2n})$.
:::
:::

::: check
given: As = 30 | 50 | 70; r = 2 | 4 | 8
answer: ceil(log(10^(As/10) - 1)/(2*log(r)))
tolerance: 0.1%

## A Butterworth low-pass (3 dB corner) must be {As} dB down at {r} times its corner. What is the lowest order that works?

::: right
Right. Round $\frac{\log_{10}(10^{A_s/10} - 1)}{2\log_{10}r}$ up: {answer}.
:::

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

::: check
given: Ap = 0.1 | 0.5 | 1 | 3
answer: sqrt(10^(Ap/10) - 1)
tolerance: 0.5%

## What ε goes with {Ap} dB of loss at the passband edge?

::: right
Right. $\sqrt{10^{A_p/10} - 1}$ = {answer}.
:::

::: misses
- [10^(Ap/20) - 1] It's $\varepsilon^2 = 10^{A_p/10} - 1$.
- [any] Not yet. $\varepsilon^2 = 10^{A_p/10} - 1$.
:::
:::

::: check
given: As = 40 | 60; Ap = 0.5 | 1; r = 2 | 5
answer: ceil(ln(sqrt((10^(As/10) - 1)/(10^(Ap/10) - 1)) + sqrt((10^(As/10) - 1)/(10^(Ap/10) - 1) - 1))/ln(r + sqrt(r^2 - 1)))
tolerance: 0.1%

## A Chebyshev low-pass with {Ap} dB of passband ripple must be {As} dB down at {r} times the passband edge. What order does it need?

::: right
Right. {answer}.
:::

::: misses
- [any] Not yet. Use the Chebyshev order formula with $\cosh^{-1}x = \ln(x + \sqrt{x^2 - 1})$.
:::
:::

::: check
given: n = 2 | 5 | 8
answer: 6.02*n
unit: dB
tolerance: 1%

## By how many dB per octave does an order-{n} low-pass roll off far above its corner?

::: right
Right. About $6n$ = {answer} dB per octave.
:::

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

::: check
given: n = 3 | 5; As = 40 | 60
answer: (10^(As/10) - 1)^(1/(2*n))
tolerance: 0.5%

## How far above its 3 dB corner, as a ratio, is an order-{n} Butterworth filter {As} dB down?

::: right
Right. $(10^{A_s/10} - 1)^{1/2n}$ = {answer}.
:::

::: misses
- [any] Not yet. Solve $10\log_{10}(1 + r^{2n}) = A_s$ for $r$.
:::
:::

::: check
kind: parts
given: r = 0.1 | 0.5 | 1; n = 3 | 5; x = 1.5 | 2

## A Chebyshev filter has {r} dB of ripple and order {n}.

::: part
answer: sqrt(10^(r/10) - 1)
tolerance: 0.5%

### What's its ripple factor ε?

::: misses
- [any] $\sqrt{10^{r/10} - 1}$.
:::
:::

::: part
answer: 10*log(1 + (10^(r/10) - 1)*cosh(n*ln(x + sqrt(x^2 - 1)))^2)
unit: dB
tolerance: 0.5%

### How far down is it at {x} times the ripple edge?

::: misses
- [any] $10\log(1 + \varepsilon^2\cosh^2(n\,\text{arccosh}\,x))$.
:::
:::
:::

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

## A Chebyshev filter with r dB of ripple and order n, at x = f/f_p beyond its edge.

::: step
answer: sqrt(10^(r/10) - 1)

### What's ε?
:::

::: step
answer: cosh(n*ln(x + sqrt(x^2 - 1)))

### What's $T_n(x)$, using arccosh x = ln(x + √(x² − 1))?
:::

::: step
answer: 10*log(1 + (10^(r/10) - 1)*cosh(n*ln(x + sqrt(x^2 - 1)))^2)

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

::: right
Right. $T_n$ grows like $(2x)^n$, which is why Chebyshev filters fall faster than Butterworth ones near the edge.
:::
:::

::: explain
## Why does a filter's order grow so quickly as the transition band narrows?

::: model
Each pole adds 20 dB per decade of roll-off, so the attenuation reached at the stopband edge grows with the order times the logarithm of the edge ratio $f_s/f_p$. When that ratio is large, a few poles cover a lot of decades and reach the target easily. As the ratio approaches 1, its logarithm shrinks toward zero, so the order needed to gain the same attenuation over that short span grows in inverse proportion. Halving the gap on a log scale roughly doubles the order, and with it the parts count and sensitivity of the filter.
:::
:::

::: practice

::: check
given: f1 = 1 | 10; f2 = 100 | 1000
answer: log(f2/f1)
tolerance: 0.5%

## How many decades lie between {f1} kHz and {f2} kHz?

::: misses
- [any] $\log_{10}(f_2/f_1)$.
:::
:::

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

## An order-{n} low-pass rolls off how much over {d} decade(s), far above its corner?

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

::: check
given: A = 3 | 20 | 40
answer: 10^(-A/20)
tolerance: 0.5%

## What voltage ratio is {A} dB of attenuation?

::: misses
- [any] $10^{-A/20}$.
:::
:::
:::
