EEO 41 Digital Signal Pocessing Pof. Mak Fowle Note Set #31 Linea Phase FIR Design Optimum Equiipple (Paks-McClellan) Reading: Sect. 1.2.4 1.2.6 of Poakis & Manolakis 1/2
Motivation The window method and the fequency sampling method have a majo dawback: Can t pecisely contol ω p & ω s and δ p & δ s Requie iteative tweaking to get desied specs The optimal equiipple method allows easy numeical design that can meet specs on band edges and band ipples with essentially the lowest ode FIR filte! Define H ( ω) H d ( ),{ bn [ ]} ω Amplitude of desied filte fequency esponse Amplitude of designed filte fequency esponse Coefficients of design Weight can emphasize cetain band Define Weighted Eo: E{ bn [ ]}( ω) = W( ω) Hd( ω) H,{ bn [ ]}( ω) Design to satisfy: min max E{ bn [ ]}( ω) ove { bn [ ]} ω PB SB Passbands & Stopbands Minimize Lagest Eo 2/2
min max W( ω) Hd( ω) H,{ b[ n]} ( ω) ove { bn [ ]} ω PB SB δs δp, ω passband W ( ω) = 1, ω stopband Minimize Lagest Eo Hee 3/2
Design Basis This appoach was poposed and solved by Paks & McLellan in 1972 thee cleve math ticks wee used to develop a design algoithm 1. Find a single common fom fo all fou linea phase cases Enables a single algoithm that woks fo all fou cases 2. Exploit a theoem fom Chebyshev appoximation theoy Altenation Theoem : gives an easy to apply necessay and sufficient condition fo optimal Chebyshev appoximation Specifies how many extemal eo fequencies thee must be and that the eo altenates sign ove these fequencies 3. Exploit an iteative algoithm fom Chebyshev appoximation theoy Remez Exchange Algoithm : given the cuent guess of the extemal fequencies it updates to bette ones conveges to solution. We ll discuss tick #1 hee because it povides the FIR designe insight into chaacteistics impotant to the designe. The othe two we do not discuss they ae details only needed if you ae implementing the design algoithm (which is available in MATLAB). 4/2
Common Fom fo Fou Linea Phase FIR Cases Symmety \ Length M Odd M Even Symmetic Case #1 Case #2 Antisymmetic Case #3 Case #4 Case #1: Symmetic Impulse Response & Lengh M Odd hn [ ] = hm [ 1 n] Fo this case the book shows (sect 1.2.1) that ( M 3) 2 ( 2 ) M 1 [ ] ω( ) H( ω) = h( M 1) 2 + 2 hn [ ]cos n Let k = (M 1)/2 n and define n= [ ] = [ ] h ( M 1) 2, k ak [ ] = 2 h ( M 1) 2 k, k = 1, 2,, ( M 1) 2 ( M 1) 2 ( ω ) H( ω) = ak [ ]cos k 5/2
Case #2: Symmetic Impulse Response & Lengh M Even hn [ ] = hm [ 1 n] Fo this case the book shows (sect 1.2.1) that ( M 1) 2 n= M 1 ( ω( 2 )) H( ω) = 2 hn [ ]cos n Let k = M /2 n and define [ ] [] b[1] 1 Define b = 2 M bk [ ] = 2h M 2 k, 1, 2,, ( M 1) 2 2 1 ( ω ) H( ω) = bk [ ]cos ( k 1 2 bk [ ] = 2 bk [ ] bk [ 1], 2, 3,, ( M 2) 2 b [( M 2) 1] = 2 bm [ 2] ( M ) 2 1 ( ) ( ) H( ω) = cos ω 2 bk [ ]cos ωk 6/2
Case #3: Anti-Symmetic Impulse Response & Lengh M Odd hn [ ] = hm [ 1 n] Fo this case the book shows (sect 1.2.1) that ( M 3) 2 n= M 1 ( ω( 2 )) H( ω) = 2 hn [ ]sin n Let k = (M 1)/2 n and define [ ] ck [ ] = 2 h( M 1) 2 k, 1, 2,, ( M 1) 2 ( M 1) 2 1 ( ω ) H( ω) = ck [ ]sin k ( M 3) 2 ( ) ( ) H( ω) = sin ω ck [ ]cos ωk See Eq. (1.2.57) in textbook 7/2
Case #4: Anti-Symmetic Impulse Response & Lengh M Even hn [ ] = hm [ 1 n] Fo this case the book shows (sect 1.2.1) that ( M 2) 1 n= M 1 ( ω( 2 )) H( ω) = 2 hn [ ]sin n Let k = M /2 n and define [ ] M 2 1 dk [ ] = 2hM2 k, 1, 2,, M2 ( ω 1 2 ) H( ω) = dk [ ]sin ( k ) ( M 2) 1 ( ) ( ) H( ω) = sin ω 2 dk [ ]cos ωk See Eq. (1.2.62) in textbook 8/2
Compae all the foms: Case #1 Case #2 Case #3 Case #4 ( M 1) 2 ( M ) 2 1 ( ω ) H( ω) = 1 ak [ ]cos k H( ω) = cos ω 2 bk [ ]cos ωk ( ) ( ) ( M 3) 2 ( ) ( ) H( ω) = sin ω ck [ ]cos ωk ( M 2) 1 H( ω) = sin ω 2 dk [ ]cos ωk ( ) ( ) H ( ω) = Q( ω) P( ω) Common Fom! L P( ω) = α[ k]cos ωk ( ) Q( ω) 1, Case #1 cos( ω 2), Case #2 = sin( ω), Case #3 sin( ω 2), Case #4 9/2
Now evisit the Eo Equation: E{ bn [ ]}( ω) = W( ω) Hd( ω) H,{ bn [ ]}( ω) And plug common fom into the Eo Equation: E{ α[ n]} ( ω) = W( ω) Hd( ω) Q( ω) P{ α[ n]} ( ω) H d( ω) = W( ω) Q( ω) P{ α[ n]} ( ω) Q( ω) Since Q(ω) does not depend on the filte coefficients: E ˆ ˆ { α[ n]} ( ω) = W( ω) Hd( ω) P{ α[ n]} ( ω) Contains Common Q(ω) based Fom! on specific case Common Fom! 1/2
% Lowpass Filte Design Specifications: % Passband cutoff fequency =.3π ad/sample % Stopband cutoff fequency =.31π ad/sample % At least 6 db of stopband attenuation % No moe than 1 db passband ipple p=1; s=6; % specify passband ipple & stopband attenuation in db f_spec=[.3.31]; % specify passband and stopband edges in nomalized DT feq AA=[1 ]; %%% specfies that you want a lowpass filte dev=[(1^(p/2)-1)/(1^(p/2)+1) 1^(-s/2)]; % pam. needed by design outine Fs=2; % Fake value fo Fs so ou design is done in tems of nomalized DT feq [N,fo,ao,w]=fipmod(f_spec,AA,dev,Fs); % estimates filte ode and gives othe pams needed to un fipm b=fipm(n,fo,ao,w); % Computes the designed filte coefficients in vecto b The esulting value fo the ode fo this design is 385!! 11/2
-2 fipm design Ode = 385-4 H(Ω) (db) -6-8 -1-12 fi2 design Ode = 385-14 H(Ω) (db) 5-5 -1-15 -2-25 -3-35 -16.1.2.3.4.5.6.7.8.9 1 Nomalized DT Fequency Ω/π.24.25.26.27.28.29.3.31.32 Nomalized DT Fequency Ω/π fipm design has 1 db of ipple. Could educe spec but would need longe filte. E.g., fo p =.1 we d get Ode = 544 fipm can design outstanding filtes but fo the most stingent design specs they can be VERY long! 12/2
Let s look at pole-zeo plot fo a simple fipm-designed filte H(Ω) (db) <H(Ω) adians -2-4 -6-8.1.2.3.4.5.6.7.8.9 1 Nomalized DT Fequency Ω/π -1-2 -3.1.2.3.4.5.6.7.8.9 1 Nomalized DT Fequency Ω/π >> zplane(b,1) Linea Phase all designs by fipm have this vey desiable tait!!! 1 Imaginay Pat.5 -.5-1 28 In Stopband: zeos placed ight on UC In Passband: zeos line the UC -1 -.5.5 1 1.5 2 2.5 3 3.5 4 Real Pat 13/2
Design of Equiipple FIR Diffeentiatos A paticula filte that is sometimes needed is a filte that computes samples of the deivative of the undelying CT signal whose samples you have. Desied! x(t) ADC x[n] FIR Diffeentiato y[n] DAC yt () = dx() t dt Fom popeties of Laplace Tansfom fo CT signals we know that a deivative in the time domain coesponds to multiplication by s in the s-domain L F H () s = s H ( ω) So tying to mimic this with a DT filte we have = jω H f ( ω) = jω, π ω π (2π-peiodic) d CT ad/sec Desied 14/2
To exploe this compute its impulse esponse 1 π f jωn hd[ n] = Hd( ω) e dω 2π π 1 = 2π π π jωe jωn cos( π n) Antisymmetic: h = d [ n] = h d [n] n Thus use Case #3 (M odd) o Case #4 (M even) linea phase FIR filtes dω hn [ ] = hm [ 1 n] Both cases satisfy H () = as needed fo the diffeentiato Howeve, fo M odd we have H (π) =, which is not allowable fo a tue diffeentiato. But in pactice we often only need to meet the desied esponse ove a limited ange: H f d jω, ωp ω ωp ( ω) = (2π-peiodic), ω ωp M Odd o Even OK 15/2
Design of Equiipple Diffeentiatos via fipm b = fipm(n,f,a,w,'ftype') specify a filte type, whee 'ftype' is 'diffeentiato', fo type III and type IV filtes, using a special weighting technique Fo nonzeo amplitude bands, it weights the eo by a facto of 1/f so that the eo at low fequencies is much smalle than at high fequencies. Fo FIR diffeentiatos, which have an amplitude chaacteistic popotional to fequency, these filtes minimize the maximum elative eo (the maximum of the atio of the eo to the desied amplitude). 16/2
Example 1.2.5 in Text M = 6 passband edge stopband edge 17/2
Design of Equiipple FIR Hilbet Tansfomes As we saw in the section on Equivalent Lowpass Signals a Hilbet Tansfom is often used in geneating the esult. So tying to mimic this with a DT filte we have f j, < ω π H d ( ω) = (2π-peiodic) j, π < ω < Desied To exploe this compute its impulse esponse 1 π f jωn hd[ n] = Hd( ω) e dω 2π π 1 π jωn jωn = je dω je dω 2π π π n = π n, n = 2 2 sin ( / 2), n Antisymmetic: h d [ n] = h d [n] 18/2
Both antisymmetic Cases have H() = and M Odd gives H(π) = which ae toublesome fo the all-pass natue of the HT. So we usually spec lowe and uppe cutoff fequencies fo the desied amplitude esponse: H f ( ω) = 1, < ω ω ω < π d l u Design of Equiipple Diffeentiatos via fipm b = fipm(n,f,a,w,'ftype') specify a filte type, whee 'ftype' is 'hilbet', fo linea-phase filtes with odd symmety (type III and type IV) The output coefficients in b obey the elation b(k) = b(n+2 k), k = 1,...,n+1. This class of filtes includes the Hilbet tansfome, which has a desied amplitude of 1 acoss the entie band. Fo example, h = fipm(3,[.1.9],[1 1],'hilbet'); designs an appoximate FIR Hilbet tansfome of length 31. 19/2
Example 1.2.6 in Textbook M = 31 lowe edge uppe edge 2/2