Presentation is loading. Please wait.

Presentation is loading. Please wait.

P. 1 DSP-II Digital Signal Processing II Lecture 3: Filter Realization Marc Moonen Dept. E.E./ESAT, K.U.Leuven homes.esat.kuleuven.ac.be/~moonen/

Similar presentations


Presentation on theme: "P. 1 DSP-II Digital Signal Processing II Lecture 3: Filter Realization Marc Moonen Dept. E.E./ESAT, K.U.Leuven homes.esat.kuleuven.ac.be/~moonen/"— Presentation transcript:

1 p. 1 DSP-II Digital Signal Processing II Lecture 3: Filter Realization Marc Moonen Dept. E.E./ESAT, K.U.Leuven marc.moonen@esat.kuleuven.be homes.esat.kuleuven.ac.be/~moonen/

2 DSP-II p. 2 Version 2007-2008 Lecture-3 Filter Realization PART-I : Filter Design/Realization Step-1 : define filter specs (pass-band, stop-band, optimization criterion,…) Step-2 : derive optimal transfer funcion FIR or IIR Step-3 : filter realization (block scheme/flow graph) direct form realizations, lattice realizations,… Step-4 : filter implementation (software/hardware) finite word-length issues, … question: implemented filter = designed filter ? Lecture-2 Lecture-3 Lecture-4

3 DSP-II p. 3 Version 2007-2008 Lecture-3 Filter Realization Lecture 3 : Filter Realizations FIR Filter Realizations IIR Filter Realizations PS: We will assume real-valued filter coefficients

4 DSP-II p. 4 Version 2007-2008 Lecture-3 Filter Realization FIR Filter Realizations FIR Filter Realization =Construct (realize) LTI system (with delay elements, adders and multipliers), such that I/O behavior is given by.. Several possibilities exist… 1. Direct form 2. Transposed direct form 3. Lattice (LPC lattice) 4. Lossless lattice PS: Frequency-domain realization: see Part-2

5 DSP-II p. 5 Version 2007-2008 Lecture-3 Filter Realization FIR Filter Realizations 1. Direct form u[k]u[k-4]u[k-3]u[k-2]u[k-1] x bo + x b4 x b3 + x b2 + x b1 + y[k]

6 DSP-II p. 6 Version 2007-2008 Lecture-3 Filter Realization FIR Filter Realizations 2. Transposed direct form Starting point is direct form : `Retiming’ = select subgraph (shaded) remove delay element on all inbound arrows add delay element on all outbound arrows u[k]u[k-4]u[k-3]u[k-2]u[k-1] x bo + x b4 x b3 + x b2 + x b1 + y[k]

7 DSP-II p. 7 Version 2007-2008 Lecture-3 Filter Realization FIR Filter Realizations `Retiming’ : results in... u[k]u[k-1] x bo + x b1 + y[k] u[k-3]u[k-2] x b4 x b3 + x b2 +

8 DSP-II p. 8 Version 2007-2008 Lecture-3 Filter Realization FIR Filter Realizations ` Retiming’ : repeated application results in... i.e. `transposed direct form’ u[k] x bo + y[k] x b1 + x b2 + x b3 + x b4 (=different software/hardware, same i/o-behavior)

9 DSP-II p. 9 Version 2007-2008 Lecture-3 Filter Realization FIR Filter Realizations 3. Lattice form : Derived from combined realization of with `flipped’ version of H(z) Reversed (real-valued) coefficient vector results in... i.e. - same magnitude response - different phase response

10 DSP-II p. 10 Version 2007-2008 Lecture-3 Filter Realization FIR Filter Realizations Hence starting point is… bo

11 DSP-II p. 11 Version 2007-2008 Lecture-3 Filter Realization FIR Filter Realizations With, this is rewritten as `sloppy notation’

12 DSP-II p. 12 Version 2007-2008 Lecture-3 Filter Realization FIR Filter Realizations This is equivalent to... …Now repeat procedure for shaded graph (=same structure as the one we started from) y[k] u[k]u[k-3]u[k-2] x b’o + x b’1 + x + x + b’3 u[k-2] x b’2 + x + b’3 x b’1 x b’o + + x x ko y[k] ~

13 DSP-II p. 13 Version 2007-2008 Lecture-3 Filter Realization FIR Filter Realizations Repeated application results in `lattice form’ u[k] y[k] + + x x ko + + x x k1 + + x x k2 + + x x k3 x bo y[k] ~ = different software/hardware, same i/o-behavior

14 DSP-II p. 14 Version 2007-2008 Lecture-3 Filter Realization FIR Filter Realizations Lattice form : Also known as `LPC Lattice’ (`linear predictive coding lattice’) Ki’s are so-called `reflection coefficients’ Every set of bi’s corresponds to a set of Ki’s, and vice versa. Procedure for computing Ki’s from bi’s corresponds to the well-known `Schur-Cohn’ stability test (from control theory): problem = for a given polynomial B(z), how do we find out if all the zeros of B(z) are stable (i.e. lie inside unit circle) ? solution = from bi’s, compute reflection coefficients Ki’s (following procedure on previous slides). Zeros are stable if and only if all reflection coefficients statisfy |Ki|<1

15 DSP-II p. 15 Version 2007-2008 Lecture-3 Filter Realization FIR Filter Realizations Lattice form : Procedure (page 11) breaks down if |Ki|=1 is encountered. Means at least one root of B(z) lies on or outside the unit circle (cfr Schur-Cohn). Then have to select other realization (direct form, lossless lattice, …) for B(z). Lattice form is often applied to `minimum phase’ filters, i.e. filter with only stable zeros (roots of B(z) strictly inside unit circle). Then design procedure never breaks down.

16 DSP-II p. 16 Version 2007-2008 Lecture-3 Filter Realization FIR Filter Realizations 4. Lossless lattice : Derived from combined realization of (possibly scaled) H(z) with which is such that (*) PS : interpretation ?… (see next slide)

17 DSP-II p. 17 Version 2007-2008 Lecture-3 Filter Realization FIR Filter Realizations PS : Interpretation ? When evaluated on the unit circle, this formula is equivalent to (for filters with real-valued coefficients) i.e. and are `power complementary’ (= form a 1-input/2-output `lossless’ system, see also below ) 1

18 DSP-II p. 18 Version 2007-2008 Lecture-3 Filter Realization FIR Filter Realizations PS : How is computed ? Note that if `a’ is a root of R(z), then `1/a’ is also a root of R(z), hence Note that ai’s can be selected such that all of them lie inside the unit circle. Then is a minimum-phase FIR filter. This is referred to as spectral factorization, =spectral factor.

19 DSP-II p. 19 Version 2007-2008 Lecture-3 Filter Realization FIR Filter Realizations Hence starting point is…

20 DSP-II p. 20 Version 2007-2008 Lecture-3 Filter Realization FIR Filter Realizations From (*) (page 16), it follows that (prove it) Hence there exists a theta_0 such that `sloppy notation’

21 DSP-II p. 21 Version 2007-2008 Lecture-3 Filter Realization FIR Filter Realizations This is equivalent to... …Now repeat procedure for shaded graph (=same structure as the one we started from!) (why?) u[k]u[k-3]u[k-2] x b’o + x b’1 + x + x + u[k-2] x b’2 + x + b’3 x x y[k] + + x x x x ~ ~

22 DSP-II p. 22 Version 2007-2008 Lecture-3 Filter Realization FIR Filter Realizations Repeated application results in `lossless lattice’ u[k] x + + x x x x + + x x x x + + x x x x y[k] + + x x x x ~ ~

23 DSP-II p. 23 Version 2007-2008 Lecture-3 Filter Realization FIR Filter Realizations Lossless lattice : also known as `paraunitary lattice’ (see also Lecture 6) each section is based on an orthogonal transformation, which preserves norm/energy/power (= forms a 2-input/2-output `lossless’ system) hence overall structure preserves the input energy, i.e. is `lossless’ (see also next slides)

24 DSP-II p. 24 Version 2007-2008 Lecture-3 Filter Realization FIR Filter Realizations State-space description Example: 2nd-order system: - R is `realization matrix’ (A-B-C-D-matrix) for 1-input/2-output system - Orthogonality of R implies `losslessness’ (see next slide) ~

25 DSP-II p. 25 Version 2007-2008 Lecture-3 Filter Realization FIR Filter Realizations Orthogonality of R implies `losslessness’ : assume initial internal state is x1[0], x2[0] (2nd order example) input sequence is u[0],u[1],u[2],…,u[L] corresponding output sequences are y[0],y[1],… and y[0],y[1],... then orthogonality implies that `energy’ in initial states + inputs = `energy’ in final states + outputs Equivalent transfer function based property is … i.e. H(z) is `embedded’ in 1-input/2-output lossless system (see page 17) ~ ~ ~ ~

26 DSP-II p. 26 Version 2007-2008 Lecture-3 Filter Realization FIR Filter Realizations PS : Relevance of lattice realizations : robustness example : o = original transfer function + = transfer function after 8-bit truncation of lattice filter parameters - = transfer function after 8-bit truncation of direct-form coefficients (bi’s) PS : A 2x2 orthogonal transformation (rotation) may be implemented in hardware based on a so-called `CORDIC’ (`COR’ for CO-ordinate Rotation’) architecture, which is more efficient (and more robust) than a multiply-add based implementation

27 DSP-II p. 27 Version 2007-2008 Lecture-3 Filter Realization IIR Filter Realizations Construct LTI system such that I/O behavior is given by.. Several possibilities exist… 1. Direct form 2. Transposed direct form PS: Parallel and cascade realization 3. Lattice-ladder form 4. Lossless lattice PS: State space realizations

28 DSP-II p. 28 Version 2007-2008 Lecture-3 Filter Realization IIR Filter Realizations 1. Direct form Starting point is… u[k] x bo x b4 x b3 x b2 x b1 ++++ y[k] ++++ x -a4 x -a3 x -a2 x -a1

29 DSP-II p. 29 Version 2007-2008 Lecture-3 Filter Realization IIR Filter Realizations which is equivalent to... PS : If all a_i=0 (hence H(z) is FIR), then this reduces to a direct form FIR x bo x b4 x b3 x b2 x b1 ++++ y[k] u[k] ++++ x -a4 x -a3 x -a2 x -a1 Direct form B(z)

30 DSP-II p. 30 Version 2007-2008 Lecture-3 Filter Realization IIR Filter Realizations -State-space description: -N delay elements (=minimum number =max of numerator and denominator polynomial order = max(p,q)) -2N+1 multipliers, 2N adders u[k] x bo x b4 x b3 x b2 x b1 ++++ y[k] ++++ x -a4 x -a3 x -a2 x -a1 x1[k]x2[k]x3[k]x4[k]

31 DSP-II p. 31 Version 2007-2008 Lecture-3 Filter Realization IIR Filter Realizations 2. Transposed direct form Starting point is… +++ + x -a4 x -a3 x -a2 x -a1 y[k] u[k] x bo x b4 x b3 x b2 x b1 ++++

32 DSP-II p. 32 Version 2007-2008 Lecture-3 Filter Realization IIR Filter Realizations which is equivalent to... x -a4 x -a3 x -a2 x -a1 y[k] u[k] x bo x b4 x b3 x b2 x b1 ++++

33 DSP-II p. 33 Version 2007-2008 Lecture-3 Filter Realization IIR Filter Realizations Transposed direct form is obtained after retiming... PS : If all a_i=0, then this reduces to a transposed direct form FIR Transposed direct form B(z) x -a4 x -a3 x -a2 x -a1 y[k] u[k] x bo x b4 x b3 x b2 x b1 ++++

34 DSP-II p. 34 Version 2007-2008 Lecture-3 Filter Realization IIR Filter Realizations - State-space description i.e. direct forms state space matrices are `transpose’ of each other (which justifies the name `transposed dir.form’). u[k] x -a4 x -a3 x -a2 x -a1 y[k] x bo x b4 x b3 x b2 x b1 ++++ x1[k]x2[k]x3[k] x4[k]

35 DSP-II p. 35 Version 2007-2008 Lecture-3 Filter Realization IIR Filter Realizations PS: Parallel & Cascade Realization Parallel real. obtained from partial fraction decomposition, e.g. for simple poles: –similar for the case of multiple poles –each term realized in, e.g., direct form –transmission zeros are realized iff signals from different sections exactly cancel out. =Problem in finite word-length implementation u[k] y[k] + +

36 DSP-II p. 36 Version 2007-2008 Lecture-3 Filter Realization IIR Filter Realizations PS: Parallel & Cascade Realization Cascade realization obtained from pole-zero factorization of H(z) e.g. for N even: –similar for N odd –each section realized in, e.g., direct form –second-order sections are called `bi-quads’ u[k]y[k]

37 DSP-II p. 37 Version 2007-2008 Lecture-3 Filter Realization IIR Filter Realizations Cascade realization is non-unique: - multiple ways of pairing poles and zeros - multiple ways of ordering sections in cascade ``Pairing procedure’’ : - pairing of little importance in high-precision (e.g. floating point implementation), but important in fixed-point implementation (with short word-lengths) - principle = pair poles and zeros to produce a frequency response for each section that is as flat as possible (i.e. ratio of max. to min. magnitude response close to unity) - obtained by pairing each pole to a zero as close to it as possible - procedure : start with pole pair nearest to the unit circle, and pair this to nearest complex zeros. remove pole-zero pair, and repeat, etc…. u[k] y[k]

38 DSP-II p. 38 Version 2007-2008 Lecture-3 Filter Realization IIR Filter Realizations 3. Lattice-ladder form Derived from combined realization of with... - numerator polynomial is denominator polynomial with reversed coefficient vector (see also page 9) - hence is an `all-pass’ (=`SISO lossless’) filter :

39 DSP-II p. 39 Version 2007-2008 Lecture-3 Filter Realization IIR Filter Realizations Starting point is…

40 DSP-II p. 40 Version 2007-2008 Lecture-3 Filter Realization IIR Filter Realizations This is equivalent to… ++ xx + xx xxxx ++ + x’[k-1] x x u[k] b0 y[k] ~ x + x + + x xxx ++ + - (prove it!)

41 DSP-II p. 41 Version 2007-2008 Lecture-3 Filter Realization IIR Filter Realizations Right-hand part has the same structure as what we started from, hence repeated application leads to `lattice-ladder form’ u[k] y[k] ~ x x x x + x + + x b0 =lossless section

42 DSP-II p. 42 Version 2007-2008 Lecture-3 Filter Realization IIR Filter Realizations Lattice-Ladder form : Ki’s are `reflection coefficients’ Procedure for computing Ki’s (=sin(theta_i) !!) from ai’s again corresponds to `Schur-Cohn’ stability test (see lecture-2): all zeros of A(z) are stable (i.e. lie inside unit circle) iff all reflection coefficients statisfy |Ki|<1 (i=1,…,N-1) (ps: procedure breaks down if |Ki|=1 is encountered) Orthogonal transformations correspond to `lossless’ sections see next slide…

43 DSP-II p. 43 Version 2007-2008 Lecture-3 Filter Realization IIR Filter Realizations State-space description Example: 2nd-order system: - R is `realization matrix’ (A-B-C-D-matrix) for u[k] -> y[k] (SISO) - R is orthogonal matrix (R^T.R=I), which implies `losslessness’, i.e. ~

44 DSP-II p. 44 Version 2007-2008 Lecture-3 Filter Realization IIR Filter Realizations PS : `All-pass’ part (u[k]->y’[k]) is known as `Gray-Markel’ structure PS : Note that the all-pass part corresponds to A(z) (i.e. N angles theta_i correspond to N coefficients a_i), while the ladder section corresponds to B(z). If all a_i=0 (hence H(z) is FIR !), then all theta_i=0, hence the all-pass part reduces to a delay line, and the lattice-ladder form reduces to a direct-form FIR. x x x + + x in out

45 DSP-II p. 45 Version 2007-2008 Lecture-3 Filter Realization IIR Filter Realizations 4. Lossless-lattice : Derived from combined realization of with... - numerator polynomial is C(z) is such that i.e. and are `power complementary’ (p.17-18)

46 DSP-II p. 46 Version 2007-2008 Lecture-3 Filter Realization IIR Filter Realizations `Lossless-lattice’ : similar derivation (but more complicated -hence skipped) leads to… PS: Gray-Markel is a special case of this (ki’=0) x x x x + + x u[k] y[k] ~ x x x + x+ x =lossless section

47 DSP-II p. 47 Version 2007-2008 Lecture-3 Filter Realization IIR Filter Realizations Orthogonal transformations correspond to `lossless sections State-space description with orthogonal realization matrix R (try it) implies overall lossless characteristic Note that 2N+1 filter coefficients (a_i’s and b_I’s) define 2N+1 rotation angles. If all a_i=0 (hence H(z) is FIR), rotation angles will be such that all feedback paths are cancelled (in a magic way) Example: (draw it/try it!)

48 DSP-II p. 48 Version 2007-2008 Lecture-3 Filter Realization IIR Filter Realizations PS: State-space Realizations State-space description: State-space realization = realization such that all the elements of A,B,C,D are the multiplier coefficients in the structure Example: (transposed) direct form is NOT a state-space realization, cfr. elements (bi-bo.ai) in B or C (page 30 & 34) + + y[k] u[k] N

49 DSP-II p. 49 Version 2007-2008 Lecture-3 Filter Realization IIR Filter Realizations Example: bi-quad `coupled realization’ - direct form realization of bi-quad may be unsatisfactory, e.g. for short word-lengths and poles near z=1 or z=-1 (see lecture-4) - alternative realization: state space description : poles : + ++ - y[k] u[k]

50 DSP-II p. 50 Version 2007-2008 Lecture-3 Filter Realization IIR Filter Realizations State-space description/realization is non-unique: any non-singular matrix T transforms A,B,C,D into an alternative state-space description/realization with State-space realization with orthogonal realization matrix is referred to as `orthogonal filter’ : Relevance : see lecture-4


Download ppt "P. 1 DSP-II Digital Signal Processing II Lecture 3: Filter Realization Marc Moonen Dept. E.E./ESAT, K.U.Leuven homes.esat.kuleuven.ac.be/~moonen/"

Similar presentations


Ads by Google