Analog Filter Prototypes
Contents
Butterworth
Design a normalized fourth-order Butterworth lowpass filter
% zb = zeros, pb = poles, kb = gain % Butterworth analog prototype filter function [zb pb kb] = buttap(4); % zp2tf forms transfer function polynomials from the zeros, poles, and gains of a system in factored form. [b a] = zp2tf(zb,pb,kb); w = logspace(-1,1,201); hh = freqs(b,a,w); hb = abs(hh); semilogx(w,hb,'LineWidth',2); xlabel('frequency (rad/sec)'); ylabel('magnitude response');
Chebyshev I with 0.5dB ripple in passband
[zc1 pc1 kc1] = cheb1ap(4,0.5); [b a] = zp2tf(zc1,pc1,kc1); hh = freqs(b,a,w); hc1 = abs(hh); semilogx(w,hb,w,hc1,'LineWidth',2); xlabel('frequency (rad/sec)'); ylabel('magnitude response'); legend('Butterworth','Chebyshev I');
Chebyshev II with 20dB ripple in stopband
[zc2 pc2 kc2] = cheb2ap(4,20); [b a] = zp2tf(zc2,pc2,kc2); hh = freqs(b,a,w); hc2 = abs(hh); semilogx(w,hc2,'LineWidth',2); xlabel('frequency (rad/sec)'); ylabel('magnitude response');
Elliptic with 0.5dB ripple in passband 20dB in stopband
[ze pe ke] = ellipap(4,0.5,20); [b a] = zp2tf(ze,pe,ke); hh = freqs(b,a,w); he = abs(hh); semilogx(w,he,'LineWidth',2); xlabel('frequency (rad/sec)'); ylabel('magnitude response');
semilogx(w,hb,w,hc1,w,hc2,w,he,'LineWidth',2); xlabel('frequency (rad/sec)'); ylabel('magnitude response'); legend('Butterworth','Chebyshev I','Chebyshev II','Elliptic');