Signal processing · filter design
Analog Filter Design: From Specs to Order and Cutoff
Designing an analog filter starts from a specification, not a circuit: how much loss is allowed in the passband, how much attenuation is required in the stopband, and how close together those two bands are. A filter design tool for this job turns the numbers into an order and a cutoff, and from those into a transfer function. This page works the method for a low-pass Butterworth filter, the maximally flat standard choice. Filter design is a core task within signal processing.
The specification
Four numbers describe a low-pass design. The passband edge Ωp is the highest frequency at which the loss may not exceed Ap dB. The stopband edge Ωs is the lowest frequency at which the loss must be at least As dB. The region between them is the transition band. A narrow transition band or a large attenuation drives the order up, and the order sets the number of components in the circuit.
The Butterworth response
The squared magnitude of an order-N Butterworth low-pass is
|H(jΩ)|² = 1 / (1 + (Ω/Ωc)2N)
At Ω = Ωc it is 1/2, which is −3.01 dB. The response is flat at low frequency, with no ripple, and falls at 20·N dB per decade far above the cutoff. Conversions between dB and ratios are covered in the decibels article.
Order from the specification
Requiring the loss to be Ap at Ωp and As at Ωs and eliminating Ωc gives
N ≥ log₁₀( (10As/10 − 1) / (10Ap/10 − 1) ) / (2·log₁₀(Ωs/Ωp))
The order is the next integer above the result. Then the cutoff that meets the passband exactly is Ωc = Ωp · (10Ap/10 − 1)−1/(2N).
A worked example
Specify Ap = 1 dB at Ωp = 1 and As = 40 dB at Ωs = 2, normalized units.
- 100.1 − 1 = 0.2589
- 104 − 1 = 9999
- ratio = 9999 / 0.2589 ≈ 38,620, and log₁₀ of it is 4.587
- denominator: 2·log₁₀(2) = 0.602
- N ≥ 4.587 / 0.602 = 7.62, so N = 8
For N = 8 the cutoff is Ωc = 0.2589−1/16 = 1.088. Check both specs. At Ω = 1: (1/1.088)16 = 0.2589, so the loss is 10·log₁₀(1.2589) = 1.00 dB, right on spec. At Ω = 2: (2/1.088)16 ≈ 1.7 × 10⁴, a loss of about 42 dB, which exceeds the 40 dB required. The round-up of the order is why the stopband is met with margin. With N = 7 the same formula would deliver under 40 dB at Ω = 2.
From order to transfer function
The poles of the normalized prototype lie on the unit circle in the left half-plane, at angles π(2k + N − 1)/(2N) for k = 1 … N. Forming the product of the factors (s − pk) gives the denominator polynomial, studied on the Butterworth polynomial page. Scale s by Ωc to move the cutoff from 1 to its design value. High-pass, band-pass and band-stop filters follow by a frequency substitution applied to this low-pass prototype.
An analog design is an intermediate result. To use it on sampled data, the transfer function is mapped to a digital one by a transformation such as the bilinear transform, which compresses the frequency axis and requires pre-warping of the edges. Other response families trade the flat passband for a steeper roll-off: Chebyshev types allow ripple, elliptic filters allow it in both bands. Pulse-shaping filters with other goals are on the raised cosine filter page.
Pseudocode
function butterworth_order(Ap, As, Wp, Ws):
num = 10^(As/10) - 1
den = 10^(Ap/10) - 1
N = ceil( log10(num/den) / (2 * log10(Ws/Wp)) )
Wc = Wp * den^(-1/(2*N))
return N, Wc