610 likes | 1.4k Views
Analog Filters: The Approximation. Franco Maloberti. Introduction. The first step of the normalized filter design is to find a magnitude characteristics, |H(j w )| , that fulfills the specifications Handling |H(j w )| it is difficult. It is better to deal with |H(j w )| 2 .
E N D
Analog Filters: The Approximation Franco Maloberti
Introduction • The first step of the normalized filter design is to find a magnitude characteristics, |H(jw)|, that fulfills the specifications • Handling |H(jw)| it is difficult. It is better to deal with |H(jw)|2. • |H(jw)|2 is a rationale function in w2 Analog Filters: The Approximation
Example • Consider the transfer function Much easier to deal than Analog Filters: The Approximation
Methodology • The approximation phase is based on the following: • Find a real rationale function in w2 capable to met the magnitude specifications (pass-band and stop-band) • Live with the resulting phase response • Correct (if necessary) the phase response (or delay) with a cascaded network • Work on low-pass characteristics (we will se shortly how to achieve high-pass, band-pass, … from a low-pass TF) Analog Filters: The Approximation
Generic Low-Pass TF • A generic form of a low-pass TF is: A0 wp In the pass-band H(w)=A0 Analog Filters: The Approximation
Butterworth Characteristics • A very simple form for F(w2) is • n is the order of the Butterworth filter • Properties: Analog Filters: The Approximation
Maximally Flat • The magnitude response of the Butterworth filter is said to be maximally flat. • If we take the first 2n-1 derivatives of H(jw), they are all zero at w=0 n=8 w=0,…,2 Analog Filters: The Approximation
Butterworth Plots; |H(jw)|2 clear all; omega=linspace(0,2,100); for k=1:6 n=k; for i=1:100 Butter(i,k)=1/(1+omega(i)^(2*n)); end end plot(omega,Butter); All curves cross 0.5 For w=1 Analog Filters: The Approximation
Butterworth Plots • For w>>1 |H(iw)|2 ≈ 1/(w2n) • H(jw)|dB = -20 n log w clear all; omega=linspace(0,100,100); for k=1:4 n=k; for i=1:100 Butter(i,k)=1/(1+omega(i)^(2*n)); ButdB(i,k) = 20* log10(Butter(i,k)); end end semilogx(omega,ButdB); Analog Filters: The Approximation
Design of Butterworth filters • Specifications The values of as, ap and the ratio ws/wp determine the order n of the filter. Analog Filters: The Approximation
Chebyshev Characteristics • The Chebishev filters are based on the Chebishev polynomials • n is the order • It is a polynomial! Analog Filters: The Approximation
Chebyshev Polynomials Analog Filters: The Approximation
Chebyshev Polynomials Analog Filters: The Approximation
Chebyshev Polynomials Features • If w varies in the range -1 +1 • Cn(w)=cos(nq+q) limited to the range -1 +1 • If |w |is larger than 1 • Cn(w)=cosh(n cosh-1w) increases monotonically with wn. clear all; n=7 xmax=1+5/n^2; w=linspace(-xmax,xmax,200); for i=1:200 C(i)=cos(n*acos(w(i))); end plot(w,C); Analog Filters: The Approximation
Chebyshev low-pass • Choose a small number e and let • the low-pass transfer function is • Normalize wp = 1 • Maximum attenuation in the pass-band Analog Filters: The Approximation
Chebyshev low-pass Plots clear all; n = input('what is the order? '); eps = input('what is the value of epsilon? '); xmax=2; w=linspace(0,xmax,200); for i=1:200 C(i)=cos(n*acos(w(i))); H(i)=1/(1+(eps*C(i))^2); end plot(w,H); Order 4 Eps=0.4 Order 7 Eps=0.2 Analog Filters: The Approximation
Chebyshev Filter Design • Start from specifications • Determine e • The order of the filter must be such that • Remember that Analog Filters: The Approximation
Other Chebyshev Responses • Define another function • Use in the Matlab program H(i)=1-1/(1+(eps*C(i))^2); Analog Filters: The Approximation
Inverse Chebyshev High-pass clear all; n = input('what is the order? '); eps = input('what is epsilon? '); xmax=2; w=linspace(0,xmax,200); for i=1:200 C(i)=cos(n*acos((1/w(i)))); H(i)=1/(1+(eps*C(i))^2); end plot(w,H); Analog Filters: The Approximation
Inverse Chebyshev Low-pass Analog Filters: The Approximation
Elliptic-Function • Butterworth and Chebyshev don’t have finite zeros • All-pole functions • Finite zeros help in the pass-band stop-band transition (see inverse Chebyshev) • Elliptic functions are a special category of zero-pole transfer functions Analog Filters: The Approximation
Elliptic-Function (ii) • Define RN(w) or • Poles and zeros are reciprocal of one another • If w1, w2,… are in the range 0 ≤ w ≤1 |R(w)|2 is zero at w1, w2,… and infinite at 1/w1, 1/w2,… Analog Filters: The Approximation
Elliptic-Function (iii) • The elliptic characteristics is Analog Filters: The Approximation
Plot of the Elliptic Function clear all; n=5; eps=8; xmax=0.91; om1sq=0.1; om2sq=0.4; om3sq=0.65; om4sq=0.8; omega=linspace(0,xmax,200); for i=1:200 w=omega(i); Num=w*(om1sq-w*w)*(om2sq-w*w)*(om3sq-w*w)*(om4sq-w*w); Den=(1-om1sq*w*w)*(1-om2sq*w*w)*(1-om3sq*w*w)*(1-om4sq*w*w); R(i)=Num/Den; Ellip(i)=1/(1+(eps*R(i))^2); end plot(omega,Ellip); Stop Pass Analog Filters: The Approximation
Determine the order of a Filter »help buttord BUTTORD Butterworth filter order selection. [N, Wn] = BUTTORD(Wp, Ws, Rp, Rs) returns the order N of the lowest order digital Butterworth filter that loses no more than Rp dB in the passband and has at least Rs dB of attenuation in the stopband. Wp and Ws are the passband and stopband edge frequencies, normalized from 0 to 1 (where 1 corresponds to pi radians). For example, Lowpass: Wp = .1, Ws = .2 Highpass: Wp = .2, Ws = .1 Bandpass: Wp = [.1 .8], Ws = [.2 .7] Bandstop: Wp = [.2 .7], Ws = [.1 .8] BUTTORD also returns Wn, the Butterworth natural frequency (or, the "3 dB frequency") to use with BUTTER to achieve the specifications. [N, Wn] = BUTTORD(Wp, Ws, Rp, Rs, 's') does the computation for an analog filter, in which case Wp and Ws are in radians/second. Analog Filters: The Approximation
Verification Butterorder clear all; omega=linspace(0,1.2,200); n=12; for i=1:200 Butterw(i)=1/(1+omega(i)^(2*n)); end plot(omega,Butterw); Wp=80; Rp=10*log10(Butterw(Wp+1)); Ws=180; Rs=10*log10(Butterw(Ws)); [N, Wn] = buttord(Wp, Ws, Rp, Rs, 's') »Butterorder N = 12 Wn = 166.7598 Analog Filters: The Approximation
Order of Chebishev or Elliptic filters [N, Wn] = CHEB1ORD(Wp, Ws, Rp, Rs, 's') does the computation for an analog filter, in which case Wp and Ws are in radians/second. [N, Wn] = ELLIPORD(Wp, Ws, Rp, Rs, 's') does the computation for an analog filter, in which case Wp and Ws are in radians/second. Comparing the orders »OrderFilter normalized stop frequency 1.2 attenuation passband 0.2 attenuation stopband 25 Nbutter = 25 Wn = 6.7203 NCheb1 = 9 Wn = 6.2832 Nellip = 5 Wn = 6.2832 clear all; Wp=2*pi; k=input('normalized stop frequency ') Ws=k*Wp; Rp=input('attenuation passband ') Rs=input('attenuation stopband ') [Nbutter, Wn] = BUTTORD (Wp, Ws, Rp, Rs, 's') [NCheb1, Wn] = CHEB1ORD(Wp, Ws, Rp, Rs, 's') [Nellip, Wn] = ELLIPORD(Wp, Ws, Rp, Rs, 's') Analog Filters: The Approximation
Butter and Cheb with same specs stop frequency 1.2 attenuation PB 0.2 dB attenuation SB 25 dB Nbutter = 25 Wn = 6.7203 NCheb1 = 9 Wn = 6.2832 Analog Filters: The Approximation
Butter and Cheb with same specs (ii) clear all; point=2000; range=2; omega=linspace(0,range,point)+range/2/point; n=25; m=9; eps=0.186; k=6.7203/6.2832; for i=1:point Butter(i)=1/(1+(omega(i)/k)^(2*n)); C(i)=cos(m*acos(omega(i))); Cheb(i)=1/(1+(eps*C(i))^2); end plot(omega,Butter,omega,Cheb); Butter(1000) Cheb(1000) Butter(1200) Cheb(1200) Analog Filters: The Approximation