Dsp lecture vol 5 design of iir

Post on 25-Jun-2015

333 Views

Category:

Documents

3 Downloads

Preview:

Click to see full reader

Transcript

Infinite Impulse Response (IIR) FiltersVol-5

Introduction

Infinite Impulse Response (IIR) filters are the first choice when: Speed is paramount. Phase non-linearity is acceptable.

IIR filters are computationally more efficient than FIR filters as they require fewer coefficients due to the fact that they use feedback or poles.

However feedback can result in the filter becoming unstable if the coefficients deviate from their true values.

Concept of Digital IIR filter

h(k), k=0,1,2,…,∞

(impulse response-infinite length)

x(n)Input sequence

y(n)output sequence

0

)()()(k

knxkhny

Properties of an IIR Filter

The general equation of an IIR filter can be expressed as follows:

ak and bk are the filter coefficients.

M

k

kk

N

k

kk

MM

NN

za

zb

zaza

zbzbbzH

1

0

11

110

1

1

Properties of an IIR Filter

The transfer function can be factorised to give:

zXzY

pzpzpz

zzzzzzkzH

N

N

21

21

Where: z1, z2, …, zN are the zeros,

p1, p2, …, pN are the poles.

Properties of an IIR Filter .. continued

Time domain theoretical equation of IIR

For the implementation of the above equation we need the difference equation:

)2()2()1()1()2()2()1()1()()0(

0 1)()()(

nyanyanxbnxbnxb

N

k

M

kkny

kbknx

kbny

0

)()()(k

knxkhny

IIR difference Equation and Direct Implementation Structure

IIR structure for order=N = M = 2

x(n)+

+b1

b2

+

+ a1

a2

z-1

y(n)

z-1

z-1

z-1

b0

)2()2()1()1()2()2()1()1()()0()(

nyanyanxbnxbnxbny

IIR Direct Form I and Direct Form II Structures

Z-1

Z-1

+b0

b1

b2

x[n]

x[n-1]

y[n]

x[n-2]

Z-1

Z-1-a1

-a2

y[n-1]

y[n-2]

b0

b1

b2

x[n] y[n]

-a1

-a2

Z-1++

Z-1

)2()2()1()1()2()2()1()1()()0()( nyanyanxbnxbnxbny

IIR Direct Form I

IIR Direct Form II

(Canonic)

Design Procedure

To fully design and implement a filter five steps are required:

(1) Filter specification.(2) Coefficient calculation.(3) Structure selection.(4) Simulation (optional).(5) Implementation.

Filter Specification - Step 1

(a)

1

f(norm)fc : cut-off frequency

pass-band stop-band

pass-band stop-bandtransition band

1

s

pass-bandripple

stop-bandripple

fpb : pass-band frequency

fsb : stop-band frequency

f(norm)

(b)

p1

s

p0

-3

p1

fs/2

fc : cut-off frequency

fs/2

|H(f)|(dB)

|H(f)|(linear)

|H(f)|

Coefficient Calculation - Step 2

There are two different methods available for calculating the coefficients: Direct placement of poles and zeros. Using analogue filter design.

Impulse invariant Bilinear z-transform etc

Pole-zero Placement Method

All that is required for this method is the knowledge that: Placing a zero near or on the unit circle in

the z-plane will minimise the transfer function at this point.

Placing a pole near or on the unit circle in the z-plane will maximise the transfer function at this point.

To obtain real coefficients the poles and zeros must either be real or occur in complex conjugate pairs.

Analogue to Digital Filter Conversion

This is one of the simplest method. There is a rich collection of prototype

analogue filters with well-established analysis methods.

The method involves designing an analogue filter and then transforming it to a digital filter.

The two principle methods are: Bilinear transform method Impulse invariant method.

Realisation Structures - Step 3

Direct Form I:

M

M

NN

M

k

kk

N

k

kk

zaza

zbzbb

za

zb

zX

zYzH

11

110

1

0

11

Difference equation:

M

kk

N

kk knyaknxbny

10

This leads to the following structure…

Realisation Structures - Step 3

Direct Form I:x(n)

+b0

+b1

+b2

+bN-1

+bN

+

+

+

+

+

a1

a2

aM-1

aM

z -1

y(n)

z -1

z -1z -1

z -1

z -1

Realisation Structures - Step 3

Direct Form II canonic realisation:

+b 0

+b 1

z -1

+b 2

+b N

-a 1

-a 2

-a N

+

+

+

+

y(n)x(n) P (n)

z -1

z -1

P (n-1)

P (n-2)

P (n-N)

Bilinear Transform Method Practical example of the bilinear

transform method: The design of a digital filter to approximate a

second order low-pass analogue filter is required.

The transfer function that describes the analogue filter is (This is an analog BUTTERWORTH filter):

The digital filter is required to have: Cut-off frequency =100 Hz Sampling frequency of 1 kHz.

12

12

ss

sH

Example: Design of a LP filter design using Bilinear Transformation

Design a digital equivalent of a 2nd order Butterworth LP filter with a

cut-off freq fc=100 Hz

Sampling frequency fs=1000 Hz.

The normalized cut off frequency of the digital filter

ω=2πfc/fs=2πfc 100/1000=0.628

Now equivalent analog filter cut-off freq

Ω=ktan(ω/2)= 1.tan(0.628/2)=0.325 rads/sec

Design of a LP filter design using Bilinear Transformation ..continued

1221)(

sssH

1325.0

22

325.0

1)(

sssH

Now the transfer function of this Butterworth filter becomes (putting s=s/Ω)

H(s) for a Butterworth filter

Design of a LP filter design using Bilinear Transformation ..continued

Now convert the analog filter H(s) into equivalent digital filter H(z) by applying the bilinear z-transform-

1

1

1

1

1

1

z

z

z

zs

24127.011429.11

2067.01135.0067.0

111

11325.02

2

11

11

1)(

2325.01

zz

zz

z

z

z

z

zH

Design of a LP filter design using Bilinear Transformation ..continued

{bk}Coefficients {ak}coefficients

b0=0.067b1=0.0135b2=0.067

a1= -1.1429a2=0.4127

From the previous we get the filter coefficients-

)2(4127.0)1(1429.1)(67.0)1(135.0)(67.0

)2()2()1()1()2()2()1()1()()0()(

nynynxnxnxnyanyanxbnxbnxbny

The time domain difference equation is obtained

Direct realization of the design

x(n)

+

b0=0.067

+b1

b2

+

+ a1

a2

z-1

y(n)

z-1

z-1

z-1

b1=0.135

b2=0.067

a1=1.1429

a2= -0.4127

b0

Matlab Code for the BZT Methodclear all

fc=100;fs=1000;

wp=2*pi*fc*(1/fs);

OmegaP=2*fs*tan(wp/2);

Omega=tan(wp/2);

Hs_den1=[(1/Omega)^2,((2^0.5)/Omega),1];

Hs_den=[(1/OmegaP)^2,((2^0.5)/OmegaP),1];

Hs_num=1;

Hs_denN=Hs_den/Hs_den(1);

Hs_numN=Hs_num/Hs_den(1);

[b,a]=bilinear(Hs_numN,Hs_denN,fs);

freqz(b,a,fs)

Infinite Impulse Response (IIR) Filters- End -

top related