Digital Filter Chapter 8 Digital Filter Block Diagram Representation Equivalent Basic FIR Digital Filter Basic IIR Digital Filter. Block Diagram Representation In the time domain, the input-output relations of an LTI digital filter is given by the convolution sum or, by the linear constant coefficient difference equation y y n h k x n k k N n dk yn k pk xn k k For the implementation of an LTI digital filter, the input-output relationship must be described by a valid computational algorithm. M k 0. Block Diagram Representation The convolution sum description of an LTI discrete-time system can, in principle, be used to implement the system. For an IIR finite-dimensional system, this approach is not practical as here the impulse response is of infinite length. However, a direct implementation of the IIR finite-dimensional system is practical
. Block Diagram Representation To illustrate what we mean by a computa- tional algorithm, consider the causal first- order LTI digital filter shown below p xn [ ] 0 x( n ) p 0 dyn [ ] pxn [ ] p d yn [ ] dyn [ ] pxn [ ] pxn [ ] 0. Block Diagram Representation Using the above equation we can compute y[n] for n 0 knowing the initial condition y[-] and the input x[n] for n - y[0] dy[ ] p0x[0] px[ ] y[] dy[0] p0x[] px[0] y[] d y[] p x[] p x[] 0 We can continue this calculation for any value of n we desire (by iterative computation). Basic Building Blocks The computational algorithm of an LTI digital filter can be conveniently represented in block diagram form using the basic building blocks shown below xn ( ) x( n ) wn ( ). Basic Building Blocks The corresponding signal flow charts are shown on the right-hand side x(n) x(n ) x(n) x(n ) x(n) ax(n) a x(n) ax(n) a x( n ) x( n) x (n) x (n)+x (n) x (n) x (n)+x (n) x( n ) x( n) x (n) x (n)
. Basic Building Blocks Advantages of block diagram/signal flow chart representation Easy to write down the computational algorithm by inspection. Easy to analye the block diagram to determine the explicit relation between the output and input. Easy to manipulate a block diagram to derive other equivalent block diagrams yielding different computational algorithms.. Basic Building Blocks Advantages of block diagram/signal flow chart representation (const.) Easy to determine the hardware requirements. Easier to develop block diagram representations from the transfer function directly.. Analysis of Block Diagrams Steps of Analying Block Diagrams Carried out by writing down the expressions for the output signals of each adder as a sum of its input signals, and developing a set of equations relating the filter input and output signals in terms of all internal signals Eliminating the unwanted internal variables then results in the expression for the output signal as a function of the input signal and the filter parameters that are the multiplier coefficients. Analysis of Block Diagrams Example: Consider the single-loop feedback structure shown below E( ) X ( ) G ( ) Y( ) G ( ) The output E() of the adder is E( ) X( ) G ( ) Y( ) But from the figure Y( ) G ( ) E( )
. Analysis of Block Diagrams Eliminating E() ( ) from the previous two equations we arrive at G( ) G( ) Y( ) G( ) X( ) which leads to Y ( ) G ( ) H ( ) X( ) G ( ) G ( ). Canonic and Noncanonic A digital filter structure is said to be canonic if the number of delays in the block diagram representation is equal to the order of the transfer function Otherwise, it is a noncanonic structure The structure t shown in the next slide is noncanonic as it employs two delays to realie a first-order difference equation. Canonic and Noncanonic. Equivalent yn [ ] dyn [ ] pxn [ ] pxn [ ] 0 p 0 x( n ) p d Two digital filter structures are defined to be equivalent if they have the same transfer function There are a number of methods for the generation of equivalent structures However, a fairly simple way to generate an equivalent structure from a given realiation is via the transpose operation 4
. Equivalent Transpose Operation () Reverse all paths () Replace pick-off nodes by adders, and vice versa () Interchange the input and output nodes All other methods for developing equivalent structures are based on a specific algorithm for each structure. Equivalent There are literally an infinite number of equivalent structures realiing the same transfer function It is thus impossible to develop all equivalent realiations In this course we restrict our attention to a discussion of some commonly used structures. Equivalent Under infinite precision arithmetic any given realiation of a digital filter behaves identically to any other equivalent structure However, in practice, due to the finite wordlength limitations, a specific realiation behaves totally differently from its other equivalent realiations. Equivalent Hence, it is important to choose a structure that has the least quantiation effects when implemented using finite precision arithmetic One way to arrive at such a structure is to determine a large number of equivalent structures, analye the finite wordlength effects in each case, and select the one showing the least effects 5
. Equivalent In certain cases, it is possible to develop a structure that by construction has the least quantiation effects Here, we review some simple realiations that in many applications are quite adequate. FIR Digital Filter Direct Form Cascade Form Polyphase Realiation Linear-phase Structure Tapped Delay Line. FIR Digital Filter A causal FIR filter of order N is characteried by a transfer function H() given by H N k hk k 0 which is a polynomial in In the time-domain the input-output relation of the above FIR filter is given by N y n h k x n k k 0. Direct Form FIR Digital Filter An FIR filter of order N is characteried by N+ coefficients and, in general, require N+ multipliers and N two-input adders in which the multiplier coefficients are precisely the coefficients of the transfer function are called direct form structures 6
. Direct Form FIR Digital Filter A direct form realiation of an FIR filter can be readily developed from the convolution sum description as indicated below for N =4. Direct Form FIR Digital Filter An analysis of this structure yields yn h0xn h xn hxn h x n h 4 x n 4 x( n) xn ( ) xn ( ) xn ( ) xn ( 4) h (0) h() h() h() h(4) which is precisely of the form of the convolution sum description The direct form structure shown on the previous slide is also known as a tapped delay line or a transversal ( 横截型 ) filter.. Direct Form FIR Digital Filter General Form n x x x n h0 h0 xn xn xn xn 4 h h h h h4 h hn hn yn yn. Cascade Form FIR Digital Filter A higher-order FIR transfer function can also be realied as a cascade of second order FIR sections and possibly a first-order section To this end we express H() as K H ( ) h[0] k k k k k where K N / if N is even, and if N is odd, with K N K 0 / 7
. Cascade Form FIR Digital Filter A cascade realiation for N = 6 is shown below h(0). Polyphase Realiation The polyphase decomposition of H() leads to a parallel form structure xn h(0) yn To illustrate this approach, consider a causal FIR transfer function H() with N = 8: 4 [0] [] [] [] [4] H h h h h h h[5] h[6] h[7] h[8] 5 6 7 8. Polyphase Realiation H() can be expressed as a sum of two terms, with one term containing the even-indexed coefficients and the other containing the oddindexed coefficients: 0 4 6 8 5 7 h h h 5 h 7 H h h h h h 4 6 8 0 4 6 8 h h h5 h7 h h h h h 4 6 8 4 6. Polyphase Realiation By using the notation 0 0 4 6 8 E h h h5 h7 we can express H() as E h h h h h H 4 E E 0 8
. Polyphase Realiation In a similar manner, by grouping the terms in the original expression for H(), we can reexpress it in the form H E E E 0 where we have 0 0 6 4 7 5 8 E h h h E h h h E h h h. Polyphase Realiation The decomposition of H() in the form or H H E E 0 E E E 0 is more commonly known as the polyphase decomposition. Polyphase Realiation In the general case, an L-branch polyphase decomposition of an FIR transfer function of order N is of the form H ( ) L m0 m ( where ( N )/ L E ( ) h[ Lnm] m n0 with h[ n] 0 for n >N E m L ) m. Polyphase Realiation Figures below show the 4-branch, -branch, and -branch polyphase realiation of a transfer function H() E ( 4 0 ) E ( 4 ) E ( 4 ) E ( 4 ) (a) + + + E ( 0 ) E ( ) (b) E ( 0 ) E ( ) E ( ) (c) 9
. Polyphase Realiation The subfilters E ( L m ) in the polyphase realiation of an FIR transfer function are also FIR filters and can be realied using any methods described so far However, to obtain a canonic realiation of the overall structure, the delays in all subfilters must be shared. Polyphase Realiation Figure below shows a canonic realiation of a length-9 FIR transfer function obtained using delay sharing h[] h[] h[5] h[8] h[7] h[4] h[6] h[0] h[].4 Linear-Phase FIR Digital Filter Linear-phase FIR filter of length N is characteried by the symmetric impulse response h[ n] h[ N n] An antisymmetric impulse response condition h[ n] h[ N n] results in a constant group delay and linearphase property Symmetry of the impulse response coefficients can be used to reduce the number of multiplications.4 Linear-Phase FIR Digital Filter Length N+ is odd ( N=6 6 ) 0 0 H h h h h h h h h 4 5 6 6 5 4 0 ( ) h( ) h ( ) h x(n) h(0) h() h() h() y(n) 0
.4 Linear-Phase FIR Digital Filter.4 Linear-Phase FIR Digital Filter h (0) h () h () h() Length N+ is even ( N=7) H h0 h h h 4 5 7 7 h h h h 0 7 6 5 4 h0 ( ) h( ) h ( ) h ( ) The Type linear-phase structure for a length- 7 FIR filter requires 4 multipliers, whereas a direct form realiation requires 6 multipliers h(0) h() h() h().4 Linear-Phase FIR Digital Filter h (0) h () h () h() The Type linear-phase structure for a length- 8 FIR filter requires 4 multipliers, whereas a direct form realiation requires 7 multipliers.4 Linear-Phase FIR Digital Filter x( n) x( n) h(0) Type and 4 h() General Form Type and h() N h ± ± ± ± ± h(0) h() N h() h ± ± ± ± (N+) / multipliers Direct Form needs N multipliers N/ multipliers
.5 Tapped Delay Line The structure consists of a chain of M +M +M unit delays with taps at the input, at the end of first M delays, at the end of next M delays, and at the output, respectively. x[n] M M M 0 y[n].5 Tapped Delay Line The direct form FIR structure of the figure can be seen to be a special case of a tapped delay line, where there is a tap after each unit delay. P 0 x (n) y(n) P d 4. IIR Digital Filter Direct Form Cascade Form Parallel Form 4. Direct Form IIR Digital Filter The causal IIR digital filters we are concerned with in this course are characteried by a real rational transfer function of or, equivalently by a constant coefficient difference equation. From the difference equation representation, it can be seen that the realiation of the causal IIR digital filters requires some form of feedback.
4. Direct Form IIR Digital Filter Direct forms -- Coefficients are directly the transfer function coefficients Consider for simplicity a rd-order IIR filter with a transfer function (assuming d ) 0 P ( ) p0 p p p H( ) D ( ) d d d We can implement H() as a cascade of two filter sections as shown below X ( ) H ( ) W( ) H ( ) Y( ) 4. Direct Form IIR Digital Filter where H ( ) P ( ) p 0 p p p H( ) / D( ) The filter section H () can be seen to be an FIR filter and can be realied as shown below p x( n ) 0 wn ( ) p p p 4. Direct Form IIR Digital Filter The time-domain representation of H () is given by yn [ ] wn [ ] dyn [ ] d yn [ ] dyn [ ] Realiation of H () follows from the above equation and is shown below wn ( ) y( n) d d d 4. Direct Form IIR Digital Filter Considering the basic cascade realiation results in Direct form I : H( ) P( ) D ( ) x( n) p 0 p p p eros d d d poles
4. Direct Form IIR Digital Filter Changing the order of blocks in cascade results in Direct form II : H ( ) P ( ) ( ) D ( ) D ( ) P x( n) d d d poles ' ' ' p 0 p p p eros 4. Direct Form IIR Digital Filter Observe in the direct form structure shown below, the signal variable at nodes and are the same, and hence the two top delays can be shared Following the same argument, the bottom two delays can be shared Sharing of all delays reduces the total number of delays to resulting in a canonic realiation along with its transpose structure. 4. Direct Form IIR Digital Filter Sharing of all delays reduces the total number of delays to resulting in a canonic realiation shown below along with its transpose structure. d d d p 0 p p p p 0 p Direct form realiations of an N-th order IIR transfer function should be evident. p p d d d 4. Cascade Realiations By expressing the numerator and the denominator polynomials of the transfer function as a product of polynomials of lower degree, a digital filter can be realied as a cascade of low-order filter sections Consider, for example, H()=P()/D() expressed as H HH H k P ( ) P ( ) Pk ( ) D ( ) D ( ) D ( ) k 4
4. Cascade Realiations Consider, for example, H()=P()/D() expressed as 4. Cascade Realiations Examples of cascade realiations obtained by different pole-ero pairings are shown below H H H H P ( ) P ( ) Pk ( ) D ( ) D ( ) D ( ) k k P ( ) D ( ) P ( ) D ( ) P ( ) D ( ) P P P ( ) ( ) ( ) D ( ) D ( ) D ( ) P ( ) D ( ) P ( ) D ( ) P ( ) D ( ) P ( ) D ( ) P ( ) D ( ) P ( ) D ( ) P P P ( ) ( ) ( ) D ( ) D ( ) D ( ) P ( ) D ( ) P ( ) D ( ) P ( ) D ( ) 4. Cascade Realiations There are altogether a total of 6 ( P P ) different cascade realiations of P ( ) P( ) P( ) P( ) H( ) D ( ) D( D ) ( D ) ( ) based on pole-ero-pairings pairings and ordering Due to finite wordlength effects, each such cascade realiation behaves differently from Others 4. Cascade Realiations b 0 x ( n ) y ( n ) xn ( ) xn ( ) b b a a P( ) D ( ) w w b 0 x ( n ) yn ( ) a b a b D ( ) P( ) 5
4. Cascade Realiations Usually, the polynomials are factored into a product of st-order and nd-order (sos) polynomials: k k H( ) p0 k k k for a first-order factor 0 H k β β α j j j α j k x( n ) a a k b 0 b b 4. Cascade Realiations Realiing complex conjugate poles and eros with second order blocks results in real coefficients Example Third order transfer function P ( ) H( ) p0 D ( ) 4. Cascade Realiations One possible realiation is shown below p 0 General structure: H () H () H N/ () 4. Cascade Realiations Example Direct form II and cascade form realiations of 0.44 0.6 0.0 H 0.8 0.5 0.4 0.44 0.6 0.0 0.8 0.5 0.4 6
4. Cascade Realiations Example Direct form II and cascade form realiations 0.4 0. 44 0.8 0. 0.6 0.0 Direct Form II 0.4 0. 8 0.5 Cascade Form 0.44 0.6 0.0 4. Parallel Realiations Parallel realiations are obtained by making use of the partial fraction expansion of the transfer function Parallel form I: 0 k k H( ) 0 k k k for a real pole k k 0 4. Parallel Realiations Parallel realiations are obtained by making use of the partial fraction expansion of the transfer function Parallel form II: k k H( ) 0 k k k for a real pole k k 0 4. Parallel Realiations The two basic parallel realiations of a rd order IIR transfer function are shown below 0 0 x( n ) x( n) 0 Parallel Form I 0 Parallel Form II y( n) 7
4. Parallel Realiations General structure: H () H () H N/ () Easy to realie: No choices in section ordering and No choices in pole and ero pairing 4. Parallel Realiations Example A partial-fraction expansion of 0.44 0.6 0.00 H( ) 0.4 0.8 0. in yields 0.6 0.5 0. H ( ) 0 0. 0.4 0.8 0.5 Likewise, a partial-fraction expansion of H() in yields 0.4 0. 0.5 H( ) 0.4 0.8 0.5 4. Parallel Realiations Their realiations are parallel allel form I shown sow below 0.4 0.8 0.5 0. 0.5 0. 0.6 0.8 0. 0.4 0.5 0.6 0.5 0. 4. Parallel Realiations Likewise, a partial-fraction expansion of H() in yields parallel l form II H 0.4 0.4 0. 0.5 0.8 0.5 0.4 0. 4 0.8 0.5 0. 0.5 0.8 0.44 0.4 0. Parallel Form I Parallel Form II 0.5 0.5 8
4. Parallel Realiations Consider H() N N H[ k] k N W k0 N H( ) Hc Hk N k 0 N Hc Hk [ ] Hk k WN N 4. Parallel Realiations N N Consider Hk] H() [ k N W xn N 0 W N W N N W N k0 H 0 H N H N N yn 9