16 iir filter design

23
Digital Signal Processing Discussion #16 IIR Filter Design Tarun Choubisa Dept of ETC, KIIT University 12 April 2011 1

Upload: manisman-parida

Post on 29-Nov-2014

213 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 16 IIR Filter Design

Digital Signal Processing

Discussion #16IIR Filter Design

Tarun ChoubisaDept of ETC,

KIIT University

12 April 2011 1

Page 2: 16 IIR Filter Design

Introduction

•Analog filter design theory was developed in the mid-1900’s.

•As digital signal processing developed, it seemed reasonable to leverage existing knowledge in analog filter design.

•Our strategy will be to design the filter in the analog domain, and then transform the filter to the digital domain.

Page 3: 16 IIR Filter Design

Feb.2008 3

Introduction

• IIR filter design methods

Continuous frequency

band transformation

Impulse

Invariance

method

Bilinear

transformation

method

Step invariance

method

IIR filter

Normalized analog

lowpass filter

Page 4: 16 IIR Filter Design

Feb.2008 4

IIR Filter Design by Impulse invariance method

• The most straightforward of these is the impulse invariance transformation

• Let be the impulse response corresponding to , and define the continuous to discrete time transformation by setting

• We sample the continuous time impulse response to produce the discrete time filter

( )ch t

( )cH s

( ) ( )ch n h nT

Page 5: 16 IIR Filter Design

Feb.2008 5

IIR Filter Design by Impulse invariance method

• is expanded a partial fraction expansion to produce

• We have assumed that there are no multiple poles

• And thus

( )cH s

1

( )N

kc

k k

AH s

s s

1

( ) ( )k

Ns t

c k

k

h t A e u t

1

( ) ( )k

Ns nT

k

k

h n A e u n

11

( )1 k

Nk

s Tk

AH z

e z

Page 6: 16 IIR Filter Design

Feb.2008 DISP Lab 6

IIR Filter Design by Impulse invariance method

• Example:

Expanding in a partial fraction

expansion, it produce

The impulse invariant transformation

yields a discrete time design with the

system function

2 2( )

( )c

s aH s

s a b

1/ 2 1/ 2( )cH s

s a jb s a jb

( ) 1 ( ) 1

1/ 2 1/ 2( )

1 1a jb T a jb TH z

e z e z

Page 7: 16 IIR Filter Design

7

• IIR filter that has poles placed on the unit circle at e j 0

Impulse Response of a Filter

0

ej

e-j

1

0 1

1 2

1 2

( )1

a a ZH z

b Z b Z

Page 8: 16 IIR Filter Design

8

Filter Coefficients

• Output frequency 0

• Cosine wave: h(n) = cos( 0T) u(n)

– a0 = 1, a1 = cos( 0T)

– b1 = 2cos( 0T), b2 = -1

• Sine wave: h(n) = sin( 0T) u(n)

– a0 = 0, a1 = sin( 0T)

– b_1 = 2cos( 0T), b2 = -1

Page 9: 16 IIR Filter Design

9

Effect of Coefficient Quantization

• Implemented as recursive filter on a DSP

• Accuracy of output frequency 0

dependent on the accuracy of filter coefficients

– depends on accuracy of cos( 0T)

– difficult to implement in finite precision arithmetic (quantization error)

Page 10: 16 IIR Filter Design

10

Effect of Coefficient Quantization

• Uniform quantization of filter coefficients

– Possible to obtain only certain output frequencies (pole locations)

– Pole locations more closely spaced around /2 radians than in the regions corresponding

to 0 and radians

Re-0.5-1.0

Z plane

Im

0 rad.rad.0 0.5 1.0

Direct Form

Implementation (3 bits

+ sign bit)

Coefficient quantization can change the pole locations and hence the output frequency

Page 11: 16 IIR Filter Design

An originally stable IIR filter with precession coefficients may become unstable after implementation due to unavoidable

quantization error in its coefficients. !!!

1 2

1( )

1 1.845 0.850586H z

z z

1 2

1( )

1 1.85 0.85H z

z z

Stable IIR filter

After quantization unstable IIR filter

Effect of Coefficient Quantization

Page 12: 16 IIR Filter Design

%Demonistration for the effect of quantization of filter coefficientsL=100; %L is the length of the impulse response h[n]num=[1];den=[1 -1.845 0.850586];den2=[1 -1.85 0.85][h1 t]=impz(num,den,L);subplot(2,1,1);stem(h1);ylabel('Amplitude');xlabel('Time index n');[h2 t]=impz(num,den2,L);subplot(2,1,2);stem(h2);ylabel('Amplitude');xlabel('Time index n');

This program draws the previous impulse

response that shows the effect of quantization on

the system stability.

Effect of Coefficient Quantization

Page 13: 16 IIR Filter Design

Feb.2008 13

IIR Filter Design by Impulse invariance method

• The impulse invariance transformation does map the -axis and the left-half s plane into the unit circle and its interior, respectively

j

Re(Z)

Im(Z)

1

S domain Z domain

sTe

j

Page 14: 16 IIR Filter Design

Complex-plane mapping in impulse invariance transformation

If Ha is band limited, there will be no aliasing, and if it is not band limited there will be aliasing as it was seen

before.

Page 15: 16 IIR Filter Design

Properties:

• Sigma = Re(s):– Sigma < 0, maps into |z|<1 (inside of the UC)

– Sigma = 0, maps into |z|=1 (on the UC)

– Sigma >0, maps into |Z|>1 (outside of the UC)

• Many s to one z mapping: many-to-one mapping– Every semi-infinite left strip (so the whole left plane) maps

to inside of unit circle

• Causality and Stability are the same without changing;

• Aliasing occur if filter not exactly band-limited

Page 16: 16 IIR Filter Design

Given the digital lowpass filter specifications wp,ws,Rp and As, we want to determine H(z) by first designing an equivalent analog filter and then mapping it into the desired digital filter. Design Procedure:

1. Choose T and determine the analog frequencies:

Ωp=wp/T, Ωs=ws/T

2. Design an analog filter Ha(s) using the specifications with one of the three

prototypes .

3. Using partial fraction expansion, expand Ha(s) into

4. Now transform analog poles {pk} into digital poles {epkT} to obtain the digital filter

N

k

k

ka

ps

RsH

1)(

N

k Tp

k

ze

RzH

k1 11)(

Ex:

Page 17: 16 IIR Filter Design

Feb.2008 DISP Lab 17

IIR Filter Design by Impulse invariance method

• Example:

Expanding in a partial fraction

expansion, it produce

The impulse invariant transformation

yields a discrete time design with the

system function

2 2( )

( )c

s aH s

s a b

1/ 2 1/ 2( )cH s

s a jb s a jb

( ) 1 ( ) 1

1/ 2 1/ 2( )

1 1a jb T a jb TH z

e z e z

Page 18: 16 IIR Filter Design

Advantages of Impulse Invariance Mapping

• It is a stable design and the frequencies Ω and w are linearly related.

• Disadvantage– We should expect some aliasing of the analog frequency

response, and in some cases this aliasing is intolerable.

• Consequently, this design method is useful onlywhen the analog filter is essentially band-limited to a lowpass or bandpass filter in which there are no oscillations in the stopband.

Page 19: 16 IIR Filter Design

Feb.2008 19

IIR Filter Design by Bilinear transformation method

• The most generally useful is the

bilinear transformation.

• To avoid aliasing of the frequency response as encountered with the impulse invariance transformation.

• We need a one-to-one mapping from the splane to the z plane.

• The problem with the transformation is many-to-one. sTz e

Page 20: 16 IIR Filter Design

Design of Digital Filters Using Analog Prototypes

• Analog filter design theory was developed in the mid-1900’s.

• As digital signal processing developed, it seemed reasonable to leverage existing knowledge in analog filter design.

• Our strategy will be to design the filter in the analog domain, and then transform the filter to the digital domain.

• We can derive this transformation by recalling the relationship between the Laplace transform and the z-transform:

• We can approximate the logarithm using a Taylor series:

• This transformation is known as the bilinear transform. It maps the left-halfs-plane to the interior of the unit circle in the z-plane.

• Unfortunately, it also “warps” the frequency axis, so the analog filter design must be prewarped so that it lands at the proper frequency in the z-plane.Let s = + j and z = re j :

)ln(1

zT

sez sT

1

1

1

12

1

12)ln(

1

z

z

Tz

z

Tz

Ts

j

j

re

re

Tj

1

12

Page 21: 16 IIR Filter Design

Frequency Warping In the Bilinear Transform

• We can solve for and by equating real and imaginary parts:

• To understand the implications on frequency response, set r = 1 and = 0 :

• This suggests a design strategy where:

(1) Establish requirements (e.g., cutoff frequency of c).

(2) “Prewarp” by computing the equivalent analog frequency: .

(3) Design an analog filter, generating H(s).

(4) Derive:

2tan2

2tan

2

cos1

sin2

1 T

TT

cos21

sin22

cos21

12

2

2

2

rr

r

T

rr

r

T

2tan

2 cc

T

1

12)()(z

z

Ts

sHzH

Page 22: 16 IIR Filter Design

Impulse response of a filterImpulse response of an IIR filter with poles on the unit circle for sinusoidal generation

Page 23: 16 IIR Filter Design

Acknowledgement

• Various graphics used here has been taken from public resources instead of redrawing it. Thanks to those who have created it.

• Thanks to:

– Prof. John G. Proakis

– Prof. Dimitris G. Manolakis