linear-phase fir filters design prof. siripong potisuk

32
LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

Upload: sharyl-french

Post on 19-Dec-2015

287 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

LINEAR-PHASE FIR FILTERS DESIGN

Prof. Siripong Potisuk

Page 2: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

Minimum-phase Filters

A digital filter is a minimum-phase filter if and only if all of its zeros lie inside or on the unit circle; otherwise, it is nonminimum-phase or mixed-phase

The system and its inverse are both causal and BIBO stable

The filter produces the minimum amount of group delay

Page 3: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

Group Delay

Negative of the slope of the phase response of a linear system, i.e., filters

The amount by which the spectral component at frequency f gets delayed as it is processed by the filter

A digital linear-phase filter has a constant group delay except possibly at frequencies at which the magnitude response is zero

)(2

1)(or)()( fH

df

dfDH

d

dD

Page 4: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

Example Consider the following four second-order IIR filters.For each filter, (a) Generate the pole-zero plot, and (b) Plot boththe magnitude and phase response.

25.0)5.0(

)5.0)(5.0(2)(

200

z

zzzH

25.0)5.0(

)5.0)(2()(

210

z

zzzH

25.0)5.0(

)2)(5.0()(

201

z

zzzH

25.0)5.0(

)2)(2(5.0)(

211

z

zzzH

Page 5: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

Pole-zero Plot

Page 6: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

Magnitude Response

Page 7: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk
Page 8: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

FIR Filter Characteristics

Completely specified by input-output relation:

bk = filter coefficients and M +1 = filter length All poles are at the origin always stable Impulse response has only a finite number of

terms finite length

][][0

knxbnyM

kk

Page 9: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

Group Delay

Negative of the slope of the phase response of a linear system, i.e., filters

The amount by which the spectral component at frequency f gets delayed as it is processed by the filter

A digital linear-phase filter has a constant group delay except possibly at frequencies at which the magnitude response is zero

)(2

1)(or)()( fH

df

dfDH

d

dD

Page 10: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

Generalized Linear-phase Filters

)}(exp{|)(| )}(exp{|)(| )( jAHHH r

where Ar() = Amplitude Response of H(z), = phase offset, and = group delay

)1()cos(

)sin()tan()(tan

H

M

n

M

n

njM

nnnhjnnhenhH

000sin][cos][][)( But,

)2( )cos(][

)sin(][)(tan

0

0

nnh

nnhH M

n

M

n

Page 11: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

Generalized Linear-phase Filters

M

n

M

n

nnhnnh00

sin)cos(][cos)sin(][ )2()1(

,sincoscossin)sin( :identity tric trigonomeUsing BABABA

)3(0)}(sin{][0

M

nnnh

This is the necessary condition for h[n] to have linear phase.

Two possible cases:

][][and,2

,or 0)1 nMhnhM

(even symmetry)

][][,2

,2

3or

2)2 nMhnh

M (odd symmetry)

Page 12: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

Types of Linear-phase FIR filters

Filter type

h[n] symmetry

Filter order

Phase offset

End-pointzeros

Candidate filters

1 Even Even 0 None All

2 Even Odd 0 z = 1 LP, BP

3 Odd Even /2 z = 1 BP

4 Odd Odd /2 z = 1 HP, BP

Page 13: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

Impulse Responses of Four Types of FIR Linear-phase Filters

2/0,][ 2 Mnnnh

Page 14: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

Linear-phase Zeros

Symmetry condition imposes constraints on the zeros of a linear-phase FIR filter

Transfer function satisfies: Type 1: no end-point zeros Type 2: an end-point zero at z = -1 Type 3: end-point zeros at z = 1 Type 4: an end-point zero at z = 1 All types: complex zeros in groups of four (r1)

)()( 1 zHzzH M

Page 15: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

Pole-zero Plot of a Sixth-order,Type-1 Linear-phase FIR Filter

Page 16: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

Example Construct a type 1 linear-phase filter of order 2 withCoefficients satisfying |bk| =1, k. Also, find the transfer function and its zeros.

Page 17: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

Example Construct a type 2 linear-phase filter of order 1 withCoefficients satisfying |bk| =1, k. Also, find the transfer function and its zeros.

Page 18: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

Example Construct a type 3 linear-phase filter of order 2 withCoefficients satisfying |bk| =1, k. Also, find the transfer function and its zeros.

Page 19: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

Example Construct a type 4 linear-phase filter of order 1 withCoefficients satisfying |bk| =1, k. Also, find the transfer function and its zeros.

Page 20: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

FIR Comb Filters• Based on a model for a single echo• The transfer function is

where R is the amount of delay in samples• The block diagram representation is

• If = 1, this is either a type 1 or 2 linear-phase filters

RzzH 1)(

x[n] y[n]+

z-R

Page 21: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

The Windowing Method

Start with the desired or ideal frequency response

Compute IDTFT to obtain the desired impulse response according the filter type & order

Truncate the resulting impulse response using one of the finite-length windowing functions, i.e., rectangular, Bartlett, Hamming, Hanning, and Blackman

Page 22: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

Ideal Lowpass Characteristics

Page 23: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

)(

)}(sin{

n

nc

c

)(

)}(sin{

n

nc

c

)(

)}(sin{)}(sin{

n

nn lh

lh

)(

)}(sin{)}(sin{

n

nn hl

)( lh

Filter type h[n], 0 k M, k h[]

Lowpass

Highpass

Bandpass

Bandstop

Impulse Responses of Ideal Linear-phase type-1 FIR filtersof Order M = 2

Page 24: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

Example Construct a type 1 linear-phase filter of order 6 withcoefficients satisfying the highpass response characteristics withcutoff frequency of 2000 Hz assuming a sampling frequency of8000 Hz. Also, find the transfer function and generate the pole-zero plot. Repeat for order 40.

Page 25: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

Commonly-used Windowing Functions

otherwise

2/

2/0

0,

2n/M,-2

2n/M,

w[n] otherwise

0

,0

,1][

windowe2.Bartlett lar window1.Rectangu

MnM

MnMn

nw

otherwise

0

,0

),/4cos(08.0)/2cos(5.042.0][

indowBlackman w 5.

otherwise

0

,0

),/2cos(46.054.0][

windowHamming 4.

otherwise

0

,0

),/2cos(5.05.0][

windowHanning 3.

MnMnMnnw

MnMnnw

MnMnnw

Page 26: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk
Page 27: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk
Page 28: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

Meeting Design Specifications

• Appropriate window selected based on frequency-domain specifications

• Estimate the filter order, M, to control the width of the normalized transition band of the filter.

s

PT

F

FFF

||

2TP

C

FFF

Page 29: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

MATLAB Implementation

Function B = firwd(N, Ftype, WL, WH, Wtype)

MATLAB user-defined function for FIR filter design using the windowing method (text, pp.288-290)

Input Arguments: N = number of filter taps (must be an odd number) = M+1 where M is a filter order (even number for Type 1) Ftype = filter type ( 1 – lowpass, 2 – highpass, 3 – Bandpass, 4 – bandstop ) WL = lower cut-off frequency in rad (set to zero for highpass) WH = upper cutoff frequency in rad (set to zero for lowpass) Wtype = window type ( 1 – rectangular, 2 – triangular, 3 – Hanning, 4 – Hamming, 5 – Blackman )

Page 30: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

WindowType

FilterOrder(M)

Passband Ripple

Stopband Attenuation

p Ap (dB) s As (dB)

Rectangular 0.9/F 0.0819 0.7416 0.0819 21

Hanning 3.1/F 0.0063 0.0546 0.0063 44

Hamming 3.3/F 0.0022 0.0194 0.0022 53

Blackman 5.5/F 0.00017 0.0017 0.00017 74

Design Characteristics of Windows

Page 31: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk

Example 7.11 Design a type 1 linear-phase filter with coefficientssatisfying bandstop response characteristics with the followingspecifications:

Lower cutoff frequency of 1250 HzLower transition width of 1500 HzUpper cutoff frequency of 2850 HzUpper transition width of 1300 HzStopband attenuation of 60 dBPassband ripple of 0.02 dBSampling frequency of 8000 Hz.

Page 32: LINEAR-PHASE FIR FILTERS DESIGN Prof. Siripong Potisuk