p. 1 dsp-ii digital signal processing ii lecture 3: filter realization marc moonen dept. e.e./esat,...

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

Upload: sibyl-briggs

Post on 02-Jan-2016

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 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

p. 1DSP-II

Digital Signal Processing II

Lecture 3: Filter Realization

Marc Moonen

Dept. E.E./ESAT, K.U.Leuven

[email protected]

homes.esat.kuleuven.ac.be/~moonen/

Page 2: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 2

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

Page 3: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 3

Lecture 3 : Filter Realizations

• FIR Filter Realizations

• IIR Filter Realizations

PS: We will assume real-valued filter coefficients

Page 4: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 4

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

][....]1[.][.][ 10 Nkubkubkubky N

Page 5: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 5

FIR Filter Realizations

1. Direct form

u[k]

u[k-4]u[k-3]u[k-2]u[k-1]

xbo

+

xb4

xb3

+

xb2

+

xb1

+y[k]

][....]1[.][.][ 10 Nkubkubkubky N

Page 6: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 6

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]

xbo

+

xb4

xb3

+

xb2

+

xb1

+y[k]

Page 7: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 7

FIR Filter Realizations

`Retiming’ : results in...

u[k]

u[k-1]

xbo

+

xb1

+y[k]

u[k-3]u[k-2]

xb4

xb3

+

xb2

+

Page 8: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 8

FIR Filter Realizations

`Retiming’ : repeated application results in...

i.e. `transposed direct form’

u[k]

xbo

+y[k]

xb1

+

xb2

+

xb3

+

xb4

(=different software/hardware, same i/o-behavior)

Page 9: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 9

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

][....]1[.][.][~ :)(.)(~

011 NkubkubkubkyzHzzH NN

N

212)(...)(

~).(

~)(

~ jjj ezezez

zHzHzHzH

][....]1[.][.][ :)( 10 NkubkubkubkyzH N

Page 10: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 10

FIR Filter Realizations

Hence starting point is…

bo

u[k] u[k-1]

u[k-2]

xb1

+

xb2

+

x

+

x

+

b3

u[k-3]

xb3

+

b2 x

+

xbo

+

y[k]

b4x

+

u[k-4]

xb4

b1 x

y[k]~

Page 11: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 11

FIR Filter Realizations

With , this is rewritten as

20

10332

0

20222

0

3011,00

0123

3210

10

0

0123

3210

0

0

1' ,

1' ,

1' '

]1[]...[.''''

''''.

0

01.

1

1

][]...[.''''0

0''''

1

1

][~][

bbb

bbb

bbbbb

Nkukubbbb

bbbb

z

Nkukubbbb

bbbb

ky

ky

T

T

TNkukubbbbb

bbbbb

ky

ky][]...[.

][~][

01234

43210

1 , 00

40 b

b

`sloppy notation’

Page 12: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 12

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]

xb’o

+

xb’1

+

x

+

x

+

b’3

u[k-2]

xb’2

+

b’2 x

+

b’3

xb’1 x b’o

+

+

x

xko

y[k]~

Page 13: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 13

FIR Filter Realizations

Repeated application results in `lattice form’

u[k]

y[k]

+

+

x

xko

+

+

x

xk1

+

+

x

xk2

+

+

x

xk3

xbo

y[k]~

= different software/hardware, same i/o-behavior

Page 14: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 14

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

Page 15: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 15

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.

Page 16: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 16

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)

][.~~

...]1[.~~

][.~~

][~~ :)(

~~10 NkubkubkubkyzH N

][....]1[.][.][ :)( 10 NkubkubkubkyzH N

1)(~~

).(~~

)().( 11 zHzHzHzH

Page 17: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 17

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)(~~

)(2

2

jj

ezez

zHzH

)(~~zH)(zH

2

)(~~ jeH

2)( jeH

1

Page 18: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 18

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.

)(~~zH

)(

11 )().(1)(~~

).(~~

zR

zHzHzHzH

iii azazzHzH ))(()(

~~).(

~~ 11

iiazzH )()(

~~ 1

)(~~zH

)(~~zH

Page 19: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 19

FIR Filter Realizations

Hence starting point is…

4

~~b

u[k] u[k-1]

u[k-2]

xb1

+

xb2

+

x

+

x

+

u[k-3]

xb3

+

x

+

xbo

+

y[k]

x

+

u[k-4]

xb4

x

y[k]~

0

~~b

1

~~b 2

~~b

3

~~b

Page 20: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 20

FIR Filter Realizations

From (*) (page 16), it follows that (prove it)

Hence there exists a theta_0 such that

T

T

Nkukubbbb

bbbb

z

Nkukubbbb

bbbb

ky

ky

]1[]...[.'

~~'

~~'

~~'

~~''''

.0

01.

cossin

sincos

][]...[.'

~~'

~~'

~~'

~~0

0''''

cossin

sincos

][~~

][

3210

3210

100

00

3210

3210

00

00

TNkukubbbbb

bbbbb

ky

ky][]...[.~~~~~~~~~~

][~~

][

43210

43210

4

4

0

04040 ~~~~ 0

~~.

~~.

b

b

b

bbbbb

`sloppy notation’

Page 21: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 21

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]

xb’o

+

xb’1

+

x

+

x

+

u[k-2]

xb’2

+

x

+

b’3

x

xy[k]

0cos

+

+

x

x

x

x

0sin

0cos

y[k]~~

0sin

Page 22: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 22

FIR Filter Realizations

Repeated application results in `lossless lattice’

u[k]

x

3sin

2cos

+

+

x

x

x

x

2sin

1cos

+

+

x

x

x

x

1sin

3cos

+

+

x

x

x

x

3cos2cos1cos

2sin1sin 3sin

y[k]

0cos

+

+

x

x

x

x

0sin

0cos

y[k]~~

0sin

Page 23: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 23

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)

22

21

22

21

2

1

2

1 )()()()(.cossin

sincosOUTOUTININ

IN

IN

OUT

OUT

Page 24: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 24

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)

2

][][2

][1

2

][~~

][]1[2

]1[1

2

1

11

11

00

00

2

1

hence ,2

1 if

100

010

001

.

][][

][.

010

cos.0sin

sin.0cos

00

.

cossin00

sincos00

0010

0001

][~~

][]1[

]1[

kukx

kx

ky

kykx

kx

T

R

RR

kukx

kx

ky

kykx

kx

~

Page 25: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 25

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)

][~~...]0[

~~][...]0[]1[]1[

][...]1[]0[]0[]0[22222

221

22222

21

LyyLyyLxLx

Luuuxx

1)(~~

)(2

2

jj

ezez

zHzH

~~~~

Page 26: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 26

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

Page 27: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 27

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

NN

NN

zaza

zbzbb

zA

zBzH

...1

...

)(

)()(

11

110

Page 28: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 28

IIR Filter Realizations

1. Direct form Starting point is… u[k]

xbo

xb4

xb3

xb2

xb1

+ +++y[k]

+ +++

x-a4

x-a3

x-a2

x-a1

)(

1

zA

)(zB

NN

NN

zaza

zbzbb

zA

zBzH

...1

...

)(

)()(

11

110

Page 29: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 29

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

xbo

xb4

xb3

xb2

xb1

+ +++y[k]

u[k] + +++

x-a4

x-a3

x-a2

x-a1

Direct form B(z)

)(

1

zA

)(zB

Page 30: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 30

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]

xbo

xb4

xb3

xb2

xb1

+ +++y[k]

+ +++

x-a4

x-a3

x-a2

x-a1

x1[k] x2[k] x3[k] x4[k]

][.

][

][

][

][

.....][

][.

0

0

0

1

][

][

][

][

.

0100

0010

0001

]1[

]1[

]1[

]1[

0

4

3

2

1

044033022011

4

3

2

13321

4

3

2

1

kub

kx

kx

kx

kx

babbabbabbabky

ku

kx

kx

kx

kxaaaa

kx

kx

kx

kx

Page 31: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 31

IIR Filter Realizations

2. Transposed direct form Starting point is…

)(

1

zA

)(zB

+ +++

x-a4

x-a3

x-a2

x-a1

y[k]

u[k]

xbo

xb4

xb3

xb2

xb1

+ +++

Page 32: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 32

IIR Filter Realizations

which is equivalent to...

)(

1

zA

)(zB

x-a4

x-a3

x-a2

x-a1

y[k]

u[k]

xbo

xb4

xb3

xb2

xb1

+ +++

Page 33: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 33

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

Transposeddirect form B(z)

x-a4

x-a3

x-a2

x-a1

y[k]

u[k]

xbo

xb4

xb3

xb2

xb1

+ +++

)(zB

)(

1

zA

Page 34: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 34

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’).

][.

][

][

][

][

.0001][

][.

.

.

.

.

][

][

][

][

.

000

100

010

001

]1[

]1[

]1[

]1[

0

4

3

2

1

044

033

022

011

4

3

2

1

4

3

2

1

4

3

2

1

kub

kx

kx

kx

kx

ky

ku

bab

bab

bab

bab

kx

kx

kx

kx

a

a

a

a

kx

kx

kx

kx

u[k]

x-a4

x-a3

x-a2

x-a1

y[k]

xbo

xb4

xb3

xb2

xb1

+ +++x1[k] x2[k] x3[k] x4[k]

T

DC

BA

DC

BA

formdirect TransposedformDirect

Page 35: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 35

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

21

121

1

11

110 11)(

)()(

N

i N

iN

i i

i

zz

z

zc

zA

zBzH

u[k]

y[k]

+

+

Page 36: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 36

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’

2/

121

21

0 ..1

..1.

)(

)()(

N

i ii

ii

zz

zzb

zA

zBzH

u[k]

y[k]

Page 37: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 37

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]

Page 38: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 38

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 :

NN

NN

zaza

zbzbb

zA

zBzH

...1

...

)(

)()(

11

110

NN

NNN

zaza

zzaa

zA

zAzH

...1

.1...

)(

)(~

)(~

11

11

1)(

)(~

)(~

2

2

2

j

j

j

ez

ez

ez zA

zAzH

)(~zH

Page 39: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 39

IIR Filter Realizations

Starting point is…

u[k]

+ +

x xb1

+

b2 x

+

b0x b3 x b4x xa3 xa2 xa1 x1

xa1 xa2 xa3 xa4

+ + ++

+ + ++

y[k]

y[k]~

a4

x[k]

-

Page 40: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 40

IIR Filter Realizations

This is equivalent to…

+ +

x x

+

x x

x x x x

+ + +

x’[k-1]

x

xu[k]

b0

y[k]

y[k]~

x

+

x

+

0cos

4.41

1.43

aa

aaa

4.41

2.42

aa

aaa

4.41

3.41

aa

aaa

1

4.41

1.01

aa

abb

4.41

2.02

aa

abb

4.41

3.03

aa

abb

4.41

4.04

aa

abb

+

x

x x x

+ ++ -

4.41

3.41

aa

aaa

4.41

2.42

aa

aaa

4.41

1.43

aa

aaa

0sin

0sin

0cos

040sin ka

(prove it!)

Page 41: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 41

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]

y[k]~

x

x

x

x

+

x

+

0cos

+

x

0cos

0sin

0sin

b0 =lo

ssle

ss

sect

ion

Page 42: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 42

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…

22

21

22

21

2

1

2

1 )()()()(.cossin

sincosOUTOUTININ

IN

IN

OUT

OUT

Page 43: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 43

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.

][

][

][

.][

and

][

][

][

.

100

0sincos

0cossin

.

sincos0

cossin0

001

][~]1[

]1[

2

1

012

2

1

11

11

00

002

1

ku

kx

kx

ky

ku

kx

kx

ky

kx

kx

R

~

1)(~ 2

jez

zH

Page 44: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 44

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

+

0cos

+

x

0cos

0sin

0sin

in

out

Page 45: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 45

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)

NN

NN

zaza

zbzbb

zA

zBzH

...1

...

)(

)()(

11

110

NN

NN

zaza

zczcc

zA

zCzH

...1

....

)(

)()(

~~1

1

110

)(~~zH )(zH

)().()().()().(

1)(~~

).(~~

)().(111

11

zAzAzCzCzBzB

zHzHzHzH

Page 46: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 46

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]y[k]~

x

x

x

+

x +

x=

loss

less

se

ctio

n'0

'0 sink

'0cos

'0cos

'0sin

0cos

0cos

00 sink

0sin

N~

sin

N~

cos

Page 47: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 47

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!)

23

22

21

23

22

21

3

2

1

3

2

1

)()()()()()(

.

'cos0'sin

010

'sin0'cos

.

100

0cossin

0sincos

OUTOUTOUTINININ

IN

IN

IN

OUT

OUT

OUT

6

2,

2

1,

3

1

2

1

2

1)(

~~2

1

2

1)( '

1'00

11 kkkzzHzzH

1)(~~

)(2

2

jj

ezez

zHzH

Page 48: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 48

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)

][.][.][

][.][.]1[

kuDkxCky

kuBkxAkx

+

+

CBy[k]

u[k]

D

A

N

Page 49: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 49

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 :

][][

][.][

][.0

1

][

][.

]1[

]1[

2

1

2

1

2

1

kukx

kxky

kukx

kx

kx

kx

21

21

..1

..1)(

zz

zzzH

ii

iii

poles : .j

+

+ +

-

y[k]

u[k]

Page 50: 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

DSP-IIVersion 2007-2008 Lecture-3 Filter Realization p. 50

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

][.~

][~.~

][

][.~

][~.~

]1[~

kuDkxCky

kuBkxAkx

][.][~

10

0..

10

0~~

~~

1

1

kxTkx

T

DC

BAT

DC

BA

IRRRR

DC

BAR

TT

..