Tunable IIR Digital Filters Tunable Lowpass and Highpass Digital Filters • We have described earlier two 1st-order and two 2nd-order IIR digital transfer functions with tunable frequency response characteristics • We shall show now that these transfer functions can be realized easily using allpass structures providing independent tuning of the filter parameters • We have shown earlier that the 1st-order lowpass transfer function 1 − α 1 + z −1 H L P ( z) = 2 1 − α z −1 and the 1st-order highpass transfer function 1 + α 1 − z −1 H HP ( z) = 2 1 − α z−1 are doubly-complementary pair 1 Copyright © 2001, S. K. Mitra 2 Copyright © 2001, S. K. Mitra Tunable Lowpass and Highpass Digital Filters Tunable Lowpass and Highpass Digital Filters • A realization ofH LP (z) and H HP (z) based on the allpass-based decomposition is shown below H HP (z) • Moreover, they can be expressed as H LP ( z ) = 1 [1 + A1( z )] 2 H HP ( z) = 1 [1 − A1( z )] 2 where • The 1st-order allpass filter can be realized using any one of the 4 single-multiplier allpass structures described earlier − α + z−1 1 − α z−1 is a 1st-order allpass transfer function A1( z ) = 3 Copyright © 2001, S. K. Mitra 4 Tunable Lowpass and Highpass Digital Filters Copyright © 2001, S. K. Mitra Tunable Lowpass and Highpass Digital Filters • One such realization is shown below in which the 3-dB cutoff frequency of both lowpass and highpass filters can be varied simultaneously by changing the multiplier coefficient α • Figure below shows the composite magnitude responses of the two filters for two different values of α 1 α = 0.4 α = 0.05 Magnitude 0.8 0.6 0.4 0.2 0 0 5 Copyright © 2001, S. K. Mitra 6 0.2 0.4 ω/ π 0.6 0.8 1 Copyright © 2001, S. K. Mitra 1 Tunable Bandpass and Bandstop Digital Filters Tunable Bandpass and Bandstop Digital Filters • The 2nd-order bandpass transfer function 1− α 1 − z− 2 H BP ( z) = 2 1 − β(1 + α) z −1 + α z − 2 and the 2nd-order bandstop transfer function 1+ α 1 − β z−1 + z − 2 H BS ( z ) = 2 1 − β(1 + α) z −1 + α z − 2 also form a doubly-complementary pair 7 • Thus, they can be expressed in the form H BP ( z) = 1 [1 − A2 ( z )] 2 H BS ( z ) = 1 [1 + A2 ( z )] where A2( z ) = 8 • The final structure is as shown below • A realization ofH BP (z) and H BS (z) based on the allpass-based decomposition is shown below • In the above structure, the multiplier β controls the center frequency and the multiplier α controls the 3-dB bandwidth • The 2nd-order allpass filter is realized using a cascaded single-multiplier lattice structure 10 Copyright © 2001, S. K. Mitra Tunable Bandpass and Bandstop Digital Filters Magnitude Magnitude 0.6 0.4 0.4 0.2 0.2 11 β = 0.8 β = 0.1 0.8 0.6 0 0 Realization of an All-pole IIR Transfer Function • Consider the cascaded lattice structure derived earlier for the realization of an allpass transfer function α = 0.8 1 α = 0.4 α = 0.05 0.8 Copyright © 2001, S. K. Mitra IIR Tapped Cascaded Lattice Structures • Figure below illustrates the parametric tuning property of the overall structure β = 0.5 Copyright © 2001, S. K. Mitra Tunable Bandpass and Bandstop Digital Filters Tunable Bandpass and Bandstop Digital Filters 1 α − β(1 + α) z−1 + z − 2 1 − β(1 + α ) z −1 + α z− 2 is a 2nd-order allpass transfer function Copyright © 2001, S. K. Mitra 9 2 0.2 0.4 ω/ π 0.6 0.8 1 0 0 0.2 0.4 0.6 0.8 ω/π Copyright © 2001, S. K. Mitra 1 12 Copyright © 2001, S. K. Mitra 2 IIR Tapped Cascaded Lattice Structures IIR Tapped Cascaded Lattice Structures • A typical lattice two -pair here is as shown below • From the input-output relations we derive the chain matrix description of the two -pair: Wi +1( z) = 1 k i z −1 Wi ( z ) Si +1( z ) ki z −1 Si ( z ) • The chain matrix description of the cascaded lattice structure is therefore Wm+ 1 ( z ) Wm ( z ) Sm+ 1( z ) Sm ( z ) • Its input-output relations are given by Wm ( z) = Wm +1 ( z) − k m z −1S m ( z) Sm +1( z ) = k m Wm ( z) + z−1Sm ( z) 13 Copyright © 2001, S. K. Mitra X 1( z) = 1 Y1( z ) k3 14 IIR Tapped Cascaded Lattice Structures Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra • The transfer functionW1 ( z) / X1 ( z) is thus an all-pole function with the same denominator as that of the 3rd-order allpass function A3( z): W1( z) 1 = X1( z ) 1 + d1z−1 + d 2z − 2 + d3 z− 3 16 Copyright © 2001, S. K. Mitra IIR Tapped Cascaded Lattice Structures IIR Tapped Cascaded Lattice Structures Gray-Markel Method • A two -step method to realize an Mth-order arbitrary IIR transfer function • Step 2: A set of independent variables are summed with appropriate weights to yield the desired numerator PM (z ) • To illustrate the method, consider the realization of a 3rd-order transfer function H ( z) = PM ( z) / DM ( z ) • Step 1: An intermediate allpass transfer function AM ( z ) = z− M DM ( z −1) / DM ( z ) is realized in the form of a cascaded lattice structure 17 k 2 z−1 1 k1z −1 W1( z) z −1 k1 z −1 S1( z) IIR Tapped Cascaded Lattice Structures • From the above equation we arrive at X 1( z) = {1 + [k1(1 + k2 ) + k 2k 3] z −1 + [k 2 + k1k 2 (1 + k 2 )] z− 2 + k 3 z− 2}W1( z) = (1 + d1 z−1 + d2 z − 2 + d 3z −3 )W1 ( z) using the relation S1 ( z) = W1( z) and the relations k1 = d1" , k 2 = d 2' , k3 = d 3 15 k 3z −1 1 z −1 k 2 Copyright © 2001, S. K. Mitra H ( z) = 18 P3 ( z) p 0 + p1z−1 + p2 z − 2 + p3z −3 = D3( z ) 1 + d1z −1 + d 2 z −2 + d3 z −3 Copyright © 2001, S. K. Mitra 3 IIR Tapped Cascaded Lattice Structures IIR Tapped Cascaded Lattice Structures • In the first step, we form a 3rd-order allpass transfer function • Objective: Sum the independent signal variables Y1 , S1 , S2 , and S 3with weights {αi} as shown below to realize the desired numerator P3(z ) A3( z) = Y1( z ) / X1 ( z) = z −3 D3 ( z −1 ) / D3 ( z) • Realization of A3(z) has been illustrated earlier resulting in the structure shown below 19 Copyright © 2001, S. K. Mitra 20 IIR Tapped Cascaded Lattice Structures Copyright © 2001, S. K. Mitra IIR Tapped Cascaded Lattice Structures • To this end, we first analyze the cascaded lattice structure realizing and determine the transfer functions S1( z) / X 1( z) , S2 ( z ) / X 1( z ), and S3 ( z ) / X 1 ( z ) • From the figure it follows that S2 ( z ) = (k1 + z −1 )S1( z) = ( d1" + z −1)S1( z ) and hence S2 ( z ) d1" + z−1 = X1( z ) D3( z ) X1 Y1 • We have already shown S1( z ) 1 = X 1 ( z ) D3 ( z ) 21 Copyright © 2001, S. K. Mitra 22 IIR Tapped Cascaded Lattice Structures IIR Tapped Cascaded Lattice Structures • In a similar manner it can be shown that S 3( z) • Thus, 23 = ( d2' • We now form + d1' z−1 + z − 2 )S1( z) Yo ( z) Y (z ) S ( z) S ( z) S (z ) = α1 1 + α 2 3 + α3 2 + α 4 1 X1( z) X 1( z ) X1( z ) X 1( z ) X1( z ) S 3( z ) d '2 + d1' z −1 + z− 2 = X 1( z ) D3 ( z) • Note: The numerator of Si ( z ) / X1( z) is precisely the numerator of the allpass transfer function Ai( z ) = S i ( z) / Wi ( z) Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra 24 Copyright © 2001, S. K. Mitra 4 IIR Tapped Cascaded Lattice Structures IIR Tapped Cascaded Lattice Structures • Substituting the expressions for the various transfer functions in the above equation we arrive at α1( d3 + d 2 z −1 + d1z− 2 + z −3 ) −1 −2 −1 Yo ( z) + α2 ( d2' + d1' z + z ) + α3 (d1" + z ) + α 4 = X 1( z ) D3 ( z) 25 Copyright © 2001, S. K. Mitra • Comparing the numerator of Yo ( z) / X1( z ) with the desired numeratorP3 (z ) and equating like powers of z −1 we obtain α1d 3 + α2 d2' + α3d1" + α 4 = p0 α1d2 + α 2d1' + α 3 = p1 α1d1 +α2 = p2 α1 = p3 26 IIR Tapped Cascaded Lattice Structures Copyright © 2001, S. K. Mitra IIR Tapped Cascaded Lattice Structures • Solving the above equations we arrive at α1 = p3 • Example - Consider P3( z ) 0 .44 z −1 + 0.362 z − 2 + 0.02 z − 3 = D3 ( z) 1 + 0 .4 z −1 + 0. 18 z− 2 − 0.2 z− 3 • The corresponding intermediate allpass transfer function is given by H ( z) = α 2 = p2 − α1d1 α 3 = p1 −α1d 2 − α 2d1' α 4 = p0 − α1d3 − α 2d '2 −α 3d1" A3( z) = 27 Copyright © 2001, S. K. Mitra 28 Copyright © 2001, S. K. Mitra IIR Tapped Cascaded Lattice Structures IIR Tapped Cascaded Lattice Structures • The allpass transfer function A3( z) was realized earlier in the cascaded lattice form as shown below • Other pertinent coefficients are: d1 = 0.4, d2 = 0.18, d3 = − 0. 2, d1' = 0 .4541667 p0 = 0, p1 = 0.44, p 2 = 0.36, p3 = 0.02, X1 • Substituting these coefficients in α 1 = p3 α 2 = p2 − α1d1 α 3 = p1 −α1d 2 − α 2d1' Y1 • In the figure, k3 = d 3 = −0 .2, k 2 = d 2' = 0.2708333 k1 = d1" = 0.3573771 29 z −3D3( z −1) − 0.2 + 0.18 z −1 + 0. 0.4 z − 2 + z − 3 = D3 ( z ) 1 + 0 .4 z −1 + 0.18 z − 2 − 0.2 z− 3 Copyright © 2001, S. K. Mitra 30 α 4 = p0 − α1d3 − α 2d '2 −α 3d1" Copyright © 2001, S. K. Mitra 5 IIR Tapped Cascaded Lattice Structures Tapped Cascaded Lattice Realization Using MATLAB α1 = 0.02 , α 2 = 0.352 α 3 = 0 .2765333 , α 4 = − 0.19016 • The final realization is as shown below • Both the pole-zero and the all-pole IIR cascaded lattice structures can be developed from their prescribed transfer functions using the M-file tf2latc • To this end, Program 6_4 can be employed k1 = 0.3573771 , k 2 = 0 .2708333 , k3 = − 0. 2 31 33 Copyright © 2001, S. K. Mitra 32 Tapped Cascaded Lattice Realization Using MATLAB FIR Cascaded Lattice Structures • The M-file latc2tf implements the reverse process and can be used to verify the structure developed using tf2latc • To this end, Program 6_5 can be employed • An arbitrary Nth-order FIR transfer function of the form −n HN (z ) = 1+ ∑N n=1 pn z can be realized as a cascaded lattice structure as shown below Copyright © 2001, S. K. Mitra 34 FIR Cascaded Lattice Structures 35 Copyright © 2001, S. K. Mitra • From figure, it follows that X m ( z ) = X m−1( z ) + k m z −1Ym −1( z) Ym ( z) = k m X m−1( z ) + z −1Ym −1 ( z) • In matrix form the above equations can be written as X m ( z ) = 1 k m z −1 X m−1( z ) Ym ( z ) k m z −1 Ym−1( z ) where m = 1, 2, ... , N Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra FIR Cascaded Lattice Structures • Denote Hm ( z) = Xm ( z ) , X 0 (z ) Gm ( z ) = Ym ( z) X 0 ( z) • Then it follows from the input-output relations of the m-th two-pair that Hm ( z ) = Hm−1( z) + k m z −1Gm −1 ( z) Gm ( z ) = k m Hm−1( z ) + z −1Gm −1 ( z) 36 Copyright © 2001, S. K. Mitra 6 FIR Cascaded Lattice Structures FIR Cascaded Lattice Structures • From the previous equation we observe • From the input-output relations of the m-th two-pair we obtain for m = 2: H1( z ) = 1 + k1z −1, G1( z ) = k1 + z −1 where we have used the facts H 2 ( z ) = H1 ( z ) + k2 z −1G1( z ) H0 ( z) = X 0 ( z ) / X 0 ( z) = 1 G2 ( z ) = k 2 H1 ( z) + z −1G1( z) G0 ( z) = Y0 ( z ) / X 0 ( z ) = X 0 ( z ) / X0 ( z) = 1 • Since H1( z) and G1( z) are 1st-order polynomials, it follows from the above that H 2 ( z ) and G2 ( z) are 2nd-order polynomials • It follows from the above that G1( z ) = z −1 ( z k1 + 1) = z −1H 1( z −1) • G1( z) is the mirror-image of H1( z) 37 Copyright © 2001, S. K. Mitra 38 FIR Cascaded Lattice Structures FIR Cascaded Lattice Structures • SubstitutingG1( z ) = z −1H 1 ( z−1) in the two previous equations we get H2 ( z) = H1( z) + k2 z − 2H1 ( z−1) G2 ( z ) = k 2 H1 ( z) + z − 2H1 ( z−1) • Now we can write G2 ( z ) = k 2 H1 ( z) + z − 2H1 ( z−1) = z −2 [k 2 z 2 H1 ( z) + H1( z−1)] = z − 2H 2 ( z −1) • • In the general case, from the input-output relations of the m-th two-pair we obtain Hm ( z ) = Hm−1( z) + km z −1Gm −1 ( z) Gm ( z) = km Hm −1( z) + z−1Gm −1 ( z) • It can be easily shown by induction that Gm ( z ) = z −m Hm ( z−1), m = 1, 2,..., N − 1, N • Gm (z ) is the mirror-image of Hm (z) G2 ( z ) is the mirror-image of H 2 ( z ) 39 Copyright © 2001, S. K. Mitra 40 FIR Cascaded Lattice Structures GN −1( z ) = 41 HN ( z ) + GN ( z)} Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra FIR Cascaded Lattice Structures • To develop the synthesis algorithm, we express Hm−1( z) and G m −1 ( z ) in terms of H m(z ) and G m (z) for m = N, N − 1,... ,2,1 arriving at HN −1( z ) = 1 2 { HN ( z) − k N GN ( z)} (1−k N ) 1 {−k N (1− k 2N ) z −1 Copyright © 2001, S. K. Mitra • Substituting the expressions for H N ( z) = 1 + ∑nN=1 pn z −n and GN ( z ) = z − N H N ( z−1) = ∑nN=−01pn z − n + z − N in the first equation we get H N −1 ( z ) = 42 1 −1 −n {(1 − k N pN ) + ∑ N n =1 ( pn − kn p N − n ) z 1 − kN2 + ( pN − k N ) z − N } Copyright © 2001, S. K. Mitra 7 FIR Cascaded Lattice Structures FIR Cascaded Lattice Structures • If we choose k N = p N , then HN −1( z) reduces to an FIR transfer function of order N − 1 and can be written in the form HN −1( z) = 1 + ∑nN=−11 p'n z −n where pn' = pn −k N p2 N −n , 1 ≤ n ≤ N −1 1− k N • Continuing the above recursion algorithm, all multiplier coefficients of the cascaded lattice structure can be computed 43 Copyright © 2001, S. K. Mitra • Example - Consider H4 ( z ) = 1 + 1.2 z −1 + 1.12 z− 2 + 0. 12 z −3 − 0.08 z − 4 • From the above, we observe k4 = p4 = − 0.08 • Using pn' = pn −k 4 p24 −n , 1 ≤ n ≤ 3 1− k4 44 we determine the coefficients of H3( z ): p3' = 0.2173913 , p2' = 1. 2173913 p1' = 1. 2173913 Copyright © 2001, S. K. Mitra FIR Cascaded Lattice Structures FIR Cascaded Lattice Structures • As a result, H3 ( z) = 1 + 1.2173913 z −1 + 1.2173913 z − 2 + 0.2173913 z− 3 • Thus, k3 = p3' = 0.2173913 • Using ' ' pn" = pn − k 3 p22−n , 1 ≤ n ≤ 2 • As a result, H2 ( z ) = 1 + z −1 + z − 2 • From the above, we get k2 = p2" = 1 • The final recursion yields the last multiplier coefficient k1 = p1" /(1 + k 2 ) = 0 .5 • The complete realization is shown below 1− k3 45 we determine the coefficients of H2 ( z): p2" = 1 .0, p1" = 1.0 Copyright © 2001, S. K. Mitra 46 k1 = 0.5, k 2 = 1, k3 = 0.2173913 , k 4 = − 0.08 Copyright © 2001, S. K. Mitra FIR Cascaded Lattice Realization Using MATLAB • The M-file tf2latc can be used to compute the multiplier coefficients of the FIR cascaded lattice structure • To this end Program 6_6 can be employed • The multiplier coefficients can also be determined using the M-file poly2rc 47 Copyright © 2001, S. K. Mitra 8