Filter Design Principles

Filter Types

TypePassbandStopbandTransition
ButterworthFlatMonotonicModerate
Chebyshev IRippleMonotonicSharp
Chebyshev IIFlatRippleSharp
EllipticRippleRippleSharpest

Design Workflow

  1. Specify requirements: Passband, stopband, ripple, attenuation
  2. Choose filter type: FIR vs IIR, Butterworth vs Chebyshev, etc.
  3. Determine order: Trade-off between performance and computation
  4. Verify: Check frequency response, phase, stability

Python Example

 1from scipy import signal
 2import matplotlib.pyplot as plt
 3
 4# Design specifications
 5fs = 1000  # Sampling frequency
 6fp = 100   # Passband edge
 7fs_edge = 150  # Stopband edge
 8
 9# Normalize
10wp = fp / (fs/2)
11ws = fs_edge / (fs/2)
12
13# Determine order
14order, wn = signal.buttord(wp, ws, gpass=3, gstop=40)
15b, a = signal.butter(order, wn)
16
17# Plot frequency response
18w, h = signal.freqz(b, a)
19plt.plot(w * fs/(2*np.pi), 20*np.log10(abs(h)))
20plt.xlabel('Frequency (Hz)')
21plt.ylabel('Magnitude (dB)')
22plt.grid()
23plt.show()

Related Snippets