iir filter

50
Infinite Impulse Response Filters By Dr Hariharan Muthusamy School of Mechatronic Engineering Universiti Malaysia Perlis

Upload: wan-ting

Post on 17-Feb-2016

126 views

Category:

Documents


2 download

DESCRIPTION

Design IIR filter

TRANSCRIPT

Page 1: IIR Filter

Infinite Impulse Response Filters

By

Dr Hariharan Muthusamy

School of Mechatronic Engineering

Universiti Malaysia Perlis

Page 2: IIR Filter

Introduction

A digital filter is a linear time invariant discrete time system.

The FIR and IIR filters are of type of non-recursive and recursive type respectively.

In FIR filter design, the present output sample depends on the present input sample and previous input samples.

In IIR filter design, the present output sample depends on the present input, past input samples and output samples.

The Impulse response for realizable filter and The stability condition must satisfy.

The IIR digital filters have the transfer function form

Page 3: IIR Filter

Frequency Selective Filters

A filter rejects the unwanted frequencies from the input signal and allow the desired frequencies.

The ranges frequencies that passed the filter is called the passband and those which are blocked called stopband. The filter are of different types. Lowpass Filter Highpass Filter Bandpass Filter Bandreject Filter

Page 4: IIR Filter

Design of Digital Filters from Analog FiltersThe most common technique used for designing IIR digital filters known as Indirect Method.

The derivation of digital filter transfer function required 3 steps:

Map desired digital filter specifications into equivalent analog filter.

Derive analog transfer function for the analog prototype.

Transform the transfer function of the analog prototype into equivalent digital filter transfer function.

Specification for the magnitude response of low pass filter (a)analog (b)digital (c) Alternate specifications of magnitude response of a

lowpass filter

Page 5: IIR Filter

Fig (b) can be modified to apply to analog lowpass filter as in Fig (a).

Here the digital frequencies ωp, ωs and ωc are replaced by analog frequencies Ωp, Ωs, and Ωc whose unit in radians/sec.

Described by difference equation.Described using differential equation.

The frequency response changed by changing the filter coefficient.

The frequency response modified by changing the components.

Consist of elements: adder, multiplier and delay unit.

Constructed from active or passive electronic components.

Process and generates digital dataProcess analog input and generates analog output.

Digital filter Analog Filter

Advantages:not influence by component aging, temperature and power variation.Highly immune to noise and parameter stability and can operated over wide range of frequencies.no problem input and output impedance matching. Coefficient also can be programmed and altered anytime to obtain desired characteristic.Disadvantage:Quantization error arises due to finite length of the representation of signals and parameters.

Page 6: IIR Filter

Analog Lowpass Filter DesignGeneral form analog filter transfer function is:

Where H(s) is the Laplace transform of the impulse response h(t),

N M must satisfied and H(s) must lie in left half of the s-plane.

Analog lowpass Butterworth filterMagnitude function of Butterworth lowpass filter is given by

N=order of the filter

=cutoff frequency

Seen,magnitude of response approaches ideal lowpasscharacteristic as order N inc.

Page 7: IIR Filter

Round N to the close integer,get N=4

Page 8: IIR Filter

Determine the order and the poles of low pass Butterworth filter that has 3 dB attenuation at 500 Hz and attenuation of 40 dB at 1000Hz.

Round N = 7

Steps to design Analog Butterworth lowpass Filter From given specifications, find order of the filter, N.

Round off it to the next higher integer.

Find the transfer function H(s) for Ωc =1rad/sec for the value of N

Calculate value of cutoff frequency, Ωc .

Find the transfer function Ha (S) for value Ωc by substituting s -> s/ Ωc in H(s) .

Page 9: IIR Filter
Page 10: IIR Filter
Page 11: IIR Filter

Design of IIR filters from analog filters

The conversion technique should be effective it should posses following desirable properties.

The jΩ –axis in the s-plane should map into the unit circle in the z-plane. Thus, have direct relationship btw two frequency variablein two domain.

The left–half plane of the s-plane should map into the inside of the unit circle in the z-plane. Thus, convert stable analog to stable digital filter.

4 most widely use Methods for digitizing Analog filter to digital filter

• Approximation of derivatives.

• Impulse invariant transformation.

• Bilinear transformation.

• matched z-transformation technique.

Page 12: IIR Filter

Design of IIR Filter using Impulse Invariance Technique

IIR filter is design such that unit impulse response h(n) of digital filter is the sampled version of the impulse response of analogfilter.The z-transform of infinite impulse response given by

Let us consider the mapping points from the s-plane to the z-plane by the relation z=esT. Substitute s=σ+jΩ and express the complex variable z in polar form:z=rejω

rejω = e(σ+jΩ)T , we r = eσT, ω = ΩT.Therefore, analog is mapped to a place in the z =plane of magnitude eσT and angle ΩT

Page 13: IIR Filter

Real part of analog pole =radius z-plane,

Imaginary part=angle of digital pole,

Consider any pole on j Ω -axis, where σ =0. Poles maps at the z-plane at a radius r=e0.T=1. Therefore,the impulse invariance had map poles from the s-plane’s jΩ -axis to z-plane’s unitcircle.

2nd case

Consider pole on left–half s-plane where σ < 0.Therefore, all s-plane poles with negative real parts map to z-plane poles inside the unit circle – stable analog poles are mapped to stable digital poles. Bcoz r= eσT<1 for <0.

Page 14: IIR Filter

Unstable pole mapping occur when all poles at right half of the s-plane map to the digital poles outside the unit circle.

Third case

many point in s-plane are mapped in one point in z-plane .

Easiest way to explain is to consider two poles in the s=plane with identical real parts.

S 1= , S 2=

Impulse invariant pole mapping

Page 15: IIR Filter

These pole map to z-plane poles z1 and z2,via impulse invariant mapping.

Let Ha(s) is the system function of an analog filter and ck are the coefficients and pk are the poles of analog filter.

The inverse laplace transform of Ha(s)

Sampled ha(t) periodically at t=nT ,

Page 16: IIR Filter

For high sampling rates (small T), the digital gain is high, we can use

Page 17: IIR Filter

Step to design a digital filter using impulse invariance method For given specifications, find Ha(s), transfer function of analog

filter.

Select sampling rate of the digital filter, T second per sample.

Express analog transfer function as sum of single-pole filters.

Compute the z-transform of the digital filter using formula

For high sampling rates

Page 18: IIR Filter

For the analog transfer functiondetermine H(z) using impulse invariance method. Ass T=1sec.

Page 19: IIR Filter

Design third order Butterworth digital filter using impulse invariant technique. Ass sampling period T=1 sec.

Page 20: IIR Filter
Page 21: IIR Filter

Design of IIR filter using Bilinear Transformation

It is a conformal mapping that transforms the jΩ –axis into unit circle in the z-plane only once, that avoid aliasing components.

All point in LHP ‘s’ mapped inside unit circle z-plane.

All points in RHP ’s’ mapped outside unit circle z-plane.

Let consider analog linear filter with system function

Which an be written

Can be characterize by differential equation

Approximate by trapeizoidal formula

y’(t) is derivative of y(t)

Page 22: IIR Filter

Approximation of the integral at t=nT and t0=nT-T yield

From differential eq

Which implies

Page 23: IIR Filter

The system function of the digital filter is

Dividing numerator and Denominator by

Relation between s ad z known as Bilinear transformation.

Let z=rejw.

Page 24: IIR Filter

.

Separating imaginary and real parts

Page 25: IIR Filter

Steps to Design Digital filter using Bilinear Transform technique

From the given specifications,find prewarping analog frequencies using formula

Using the analog frequencies, find H(s) of analog filter .Select the sampling rate of the digital filter, call T seconds per sample.

Substitute into the transfer function found in step 2.

Page 26: IIR Filter

Apply Bilinear Tansformation to H(s)= with T=1sec and find H(z).

Page 27: IIR Filter

Using the Bilinear transformation, design a highpass filter, monotonoic in passband with cutoff frequency 1000 Hz and down 10 dB at 350 Hz. The sampling frequency is 5000Hz.

Prewarping the digital frequencies we have

Therefore we take N =1. The 1st

order Butterworth filter for

Page 28: IIR Filter
Page 29: IIR Filter

Determine H(z) that result when the bilinear transformation is applied to Ha(s)= .

Solution:

In bilinear transformation

Ass T= 1 sec.

Then,

Page 30: IIR Filter

Realization of Digital Filters

There are two type of realization of digital filter transfer function.

Current output sample y(n) is a function of only past and present inputs.

Correspond to FIR digital filter.

The current output y(n) is a function of past outputs, past and present input.Correspond to IIR digital filter.

Non-Recursive RealizationRecursive Realization

Page 31: IIR Filter

IIR Filter can be realized in many forms

Direct form -I realization

Direct form –II realization

Transposed direct form realization

Cascade form realization

Parallel form realization

Lattice form realization.

Page 32: IIR Filter

Direct Form 1 realization

Let consider an LTI recursive system describe by difference equation

Structure call

Direct form 1

Page 33: IIR Filter

Realize the second order digital filter y(n) =

Page 34: IIR Filter

Direct form II realization

Consider the difference equation

The system of above difference equation

Which gives

and from which

The equation 5.112 and Eq 5.113b can be expressed in difference equation form

Page 35: IIR Filter

The realization Eq.(5.114) and Eq.(5.115) shown in Fig.(5.35) ,(5.36)

Page 36: IIR Filter

Realize the second order system y(n)

we realize eq.(5.118a) and

and eq. (5.118b)

Page 37: IIR Filter

Determine the direct form II realization for the following system

.

The solution the system function given Realize eq.(5.120) and

eq.(5.121) and combine them

to get direct II realization of the

system shown below

Let,

Page 38: IIR Filter

Cascade Form

Let consider IIR System with system Function

Represented using block diagram

Realize each Hk(z) in direct form II and cascade all structure

Page 39: IIR Filter

Realizing H1(z) and H2(z)in direct form II, and cascading we obtain cascade form of system function.

Page 40: IIR Filter

Realize the system with difference equation y(n) = ¾y(n-1)-1/8 y(n-2)+x(n) +1/3 x(n-1) in cascade form.

Solution ,

From the difference equation >Similarly,H2(z) can be realize n

Direct form II

Cascading the realization of

H1(z) can be realize in direct form II, H1(z) and H2(z)

Page 41: IIR Filter

Analog Lowpass Chebyshev FiltersThere are 2 types of Chebyshev filters Type – I

They are all-pole filters that exhibit equiripple behaviour in the passband and a monotonic characteristics in the stopband.

Type – IIContains both poles and zeros and exhibits a monotonic behaviour in the passband and equiripple behaviour in the stopband.

The magnitude square response of Nth order type I filter

(Stopband)1|x|,x)cosh(Ncosh(x)C

(Passband)1|x|x),cos(Ncos(x)C

(1)-----

.......2,1,N

C1

1)H(j

1N

1N

P

2N

2

2

ΩΩε

Ω

Where ε is a parameter of the filter related to the ripple in the passband

CN(x) is the Nth order Chebyshevpolynominal

Page 42: IIR Filter

Taking log for Eq(1), we get

)3(ε

εα)2(

ΩΩεΩ

α

0.50.1

N2

P

P

2N

2

1)(10

1(1)C)(1log10

C1log101log10)H(jlog20

p

At Ω = Ωs, Eq (2) can be written as

s1-

0.1

0.11

P

2

P

s1-2

P

s2N

2s

cosh

110

110cosh

N

NforsolvingEq(4),inforEq(3)ngSubstituti

1Ncoshcosh1log10

(4)

C1log10

s

p

ΩΩ

ε

ΩΩ

ΩΩ

ε

ΩΩ

εα

α

α

Pole locations for Chebyshev Filter

kkk

k

1/N1/N

P

1/N1/N

P

21

jbsincosas

N...,2,1,k2N

1)(2k2

2b

2a

filterChebyshevaofpolesThe

1

φφ

ππφ

μμΩ

μμΩ

εεμ

Page 43: IIR Filter

Comparison between Butterworth and ChebyshevFilter The magnitude response of Butterworth filter decreases monotonically as the

frequency Ω increases from 0 to ∞, whereas the magnitude response of the Chebyshev filter exhibits ripples in the passband or stopband according to the type.

The transition band is more in Butterworth filter when compared to Chebyshevfilter.

The poles of the Butterworth filter lie on a circle, whereas the poles of the Chebyshev filter lie on the ellipse.

Steps to design an analog Chebyshev lowpass filter

1. From the given specifications, find the order of the filter N.

2. Round off it to the next higher integer.

3. Using the following formulas find the values of a and b, which are minor and major axis of the ellipse respectively.

bandpasstheinnattenuatioallowableMaximum

FrequencyPassband

1101Where2

b2

a

filterChebyshevaofpolesThe

p

P

0.1211/N1/N

P

1/N1/N

PP

αΩ

εεεμμμΩμμΩ α

Page 44: IIR Filter

4. Calculate the poles of Chebyshev filter which lie on the ellipse by using the formula

5. Find the denominator polynomial of the transfer function using above poles.

6. The numerator of the transfer function depends on the value of N.

(a) For N odd substitute s = 0 in the denominator polynomial and find the value. This value is equal to the numerator of the transfer function.

(b) For N even substitute s = 0 in the denominator polynomial and divide the result by √1+ε2. This value is equal to the numerator.

kkk

k

jbsincosas

N...,2,1,k2N

1)(2k2

φφ

ππφ

Page 45: IIR Filter

Determine the order and the poles of a type I lowpass Chebyshevfilter that has a 1 dB ripple in the passband and passband frequency Ωp = 1000π, a stopband frequency of 2000π and an attenuation of 40dB or more.

4.536cosh

110

110cosh

N

P

s1-

0.1

0.11

s

p

ΩΩ

α

α

Given data: αp = 1 dB, Ωp = 1000π, αs = 40 dB, Ωp = 2000π

N= 5

πμμΩ

πμμΩ

εεμ

ε α

10412

b

289.52

a

filterChebyshevaofpolesThe

4.171

0.5081)(10

1/N1/N

P

1/N1/N

P

21

0.50.1 P

ππφφππφφ

πφφππφφ

ππφφ

φφ

φφφ

ππφ

j98989.5jbsincosas

j612234.2jbsincosas

289.5jbsincosas

j612234.2jbsincosas

j98989.5jbsincosas

252;216

;180;144;180

5 ..., 2,1,k2N

1)(2k2

555

444

333

222

111

54

321

k

Page 46: IIR Filter

Step 1:

Find N 1.91cosh

110

110cosh

N

P

s1-

0.1

0.11

s

p

ΩΩ

α

α

Step 2: Rounding N to next higher value we get N = 2

Step 3: The values of minor axis and major axis can be found as below

πμμΩ

πμμΩ

εεμ

ε α

21972

b

9102

a

filterChebyshevaofpolesThe

2.4141

11)(10

1/N1/N

P

1/N1/N

P

21

0.50.1 P

ππφφππφφ

ππφ

ππφ

ππφ

j1554643.46jbsincosas

j1554643.46jbsincosas

2254

32

13542

21,k2N

1)(2k2

222

111

k

k

k

Given the specifications αp = 3dB ; αs = 16 dB ; fp = 1kHz, and fs = 2kHz, Determine the order of the filter using Chebyshev approximation. Find H(s).

From the given data we can find, Ωp = 2π x 1000 = 2000 π rad/sec Ωs = 2π x 2000 = 4000 π rad/sec

Page 47: IIR Filter

The denominator of H(s) = (s+643.46π)2 +(1554π)2

The numerator of H(s) =(643.46π)2 +(1554π)2/√1+ε2

=(1414.38)2π2

The transfer function H(s) = (1414.38)2π2/ (s2+1287πs+(1682)2π2

Design a Chebyshev low pass filter with the specifications αp = 1 dB ripple in the passband 0 ≤ ω ≤ 0.2π, αs = 15 dB ripple in the stopband 0.3π ≤ ω ≤ π, using (a), bilinear transformation, (b). Impulse invariance.

Given data αp = 1 dB ; ωp = 0.2π, αs = 15 dB; ωs = 0.3πPrewarped frequencies are given by

1.022

0.32tan

2tan

T2

0.652

0.22tan

2tan

T2

ss

pp

πωΩ

πωΩ

Page 48: IIR Filter

4 N take usLet

3.01cosh

110

110cosh

N

P

s1-

0.1

0.11

s

p

ΩΩ

α

α

0.69182

b

0.2372

a

filterChebyshevaofpolesThe

4.171

0.5081)(10

1/N1/N

P

1/N1/N

P

21

0.50.1 P

μμΩ

μμΩ

εεμ

ε α

j0.639jbsincosas

jbsincosas

j0.2647jbsincosas

j0.639jbsincosas

;247.5

;202.5;157.5;112.5

2,3,41,k2N

1)(2k2

444

333

222

111

4

321

k

0907.0φφ2647.02189.0φφ

2189.0φφ0907.0φφ

φ

φφφ

ππφ

j

The denominator of H(s) =[(s+0.0907)2 +(0.639)2] [(s+0.2189)2 +(0.2647)2]=(s2+0.1814s+0.4165) (s2+0.4378s+0.118)As N is even, the numerator of H(s) =(0.4165) (0.118)/√1+ε2

=0.04381

The transfer function H(s) = 0.04381/[(s2+0.1814s+0.4165) (s2+0.4378s+0.118)]

Page 49: IIR Filter

H(z) = H(s) |

1

1

112zz

Ts

)0.6493z1.5548z1()0.8482z1.499z(1

)z0.001836(12121

41

Impulse Invariance Method:Given data αp = 1 dB ; ωp = 0.2π, αs = 15 dB; ωs = 0.3π

4 N take usLet

3.2cosh

110

110cosh

N

P

s1-

0.1

0.11

s

p

ΩΩ

α

α

0.672

b

0.2292

a

filterChebyshevaofpolesThe

4.171

0.5081)(10

1/N1/N

P

1/N1/N

P

21

0.50.1 P

μμΩ

μμΩ

εεμ

ε α

j0.6190.0876jbsincosas

j0.25640.2115jbsincosas

j0.25640.2115jbsincosas

j0.6190.0876jbsincosas

;247.5

;202.5;157.5;112.5

2,3,41,k2N

1)(2k2

444

333

222

111

4

321

k

φφφφφφφφ

φ

φφφ

ππφ

Page 50: IIR Filter

The denominator of H(s) =[(s+0.0876)2 +(0.619)2] [(s+0.2115)2 +(0.2564)2]=(s2+0.175s+0.391) (s2+0.423s+0.11)As N is even, the numerator of H(s) =(0.391) (0.11)/√1+ε2

=0.03834

The transfer function H(s) = 0.03834 / [(s2+0.175s+0.391) (s2+0.423s+0.11)]

H(s)

Using Impulse invariant transform

j0.2564)0.2115(sB

j0.2564)0.2115(sB

j0.619)0.0876(sA

j0.619)0.0876(sA

21

1

21

1

0.655z1.56z1

0.0238z0.083

0.839z1.49z1

0.0245z0.083H(z)