dsp-unit 6.1 linear phase fir filters

40
UNIT VI: FIR DIGITAL FILTERS

Upload: maheswara

Post on 27-Jan-2016

239 views

Category:

Documents


2 download

DESCRIPTION

linear filters

TRANSCRIPT

Page 1: Dsp-unit 6.1 Linear Phase Fir Filters

UNIT VI: FIR DIGITAL FILTERS

Page 2: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 2

Contents 1. Introduction 2. Characteristics of FIR Digital Filters

1. Frequency Response 3. Design of FIR Digital filters using

1. Fourier series method 2. Windowing technique3. Frequency sampling technique4. Design examples

4. Comparison of IIR and FIR filters

Page 3: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 3

IIR Filter design The transfer function of the IIR filter is given by

Its frequency responses are (where w is the normalized frequency ranging in [, ].

Page 4: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 4

When a and b are real, the magnitude response |H(ejw)| is an even function, and the phase response (jw) is an odd function. Very often it is convenient to compute and plot the log magnitude of |H(ejw)| as

measured in dB. Linear phase:Consider the ideal delay system. The impulse response is

and the frequency response is

210 |)(|log10 jweH

][][ did nnnh

djwnjwid eeH ][

IIR Filter design

Page 5: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 5

In this case, the magnitude and phase responses are

andHence, when time domain is a constant delay, it causes the frequency a “linear phase.” Sometimes we hope the filter response is linear phase, i.e., the phase response is linear with w.Eg. an ideal low-pass filter with linear phase (i.e., ideal low-pass but the output is delayed by nd samples in the time domain)

However, linear phase is difficult to achieve by using IIR filters, but it can be easily designed by using FIR filters.

1|][| jwid eH

|| ][ wwneH djw

id

ww

wweeH

c

cjwn

jwlp

d

,0

,|][|

Page 6: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 6

Group delay: A convenient measure of the linearity of the phase is the group delay.

For the IIR filter, the group delay is

where

and

)]}([{)]([)( jwjw eHdw

deHgrdw (unit: samples)

Page 7: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 7

Page 8: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 8

Page 9: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 9

Page 10: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 10

Page 11: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 11

1.Linear Phase FIR Digital Filter. Introduction

Advantages and Disadvantages

of

Linear Phase FIR Digital Filters

Page 12: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 12

FIR Digital filters cannot be derived from analog filters, since causal analog filters cannot have a finite impulse response. In many digital signal processing applications, FIR filters are preferred over their IIR counterparts.

FIR digital filter has a finite number of non-zero coefficients of its impulse response:

Mathematical model of a causal FIR digital filter:1

0

( ) ( ) ( )M

k

y n h k x n k

Mnfornh 0][

Advantages & Disadvantages of Linear Phase FIR Filters

Page 13: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 13

1.FIR filters with exactly linear phase can be easily designed. This simplifies the approximation problem, in many cases, when one is only interested in designing of a filter that approximates an arbitrary magnitude response. Linear phase filters are important for applications where frequency dispersion due to nonlinear phase is harmful (e.g. speech processing and data transmission).

2.There are computationally efficient realizations for implementing FIR filters. These include both non-recursive and recursive realizations.

The advantages of FIR filters

Advantages & Disadvantages of Linear Phase FIR Filters

Page 14: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 14

3.FIR filters realized non-recursively are inherently stable and free of limit cycle oscillations when implemented on a finite-word length digital system.

4.The output noise due to multiplication round off errors in FIR filters is usually very low and the sensitivity to variations in the filter coefficients is also low.

5.Excellent design methods are available for various kinds of FIR filters with arbitrary specifications.

The advantages of FIR filters

Advantages & Disadvantages of Linear Phase FIR Filters

Page 15: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 15

The disadvantages of FIR filters:

1.The relative computational complexity of FIR filter is higher than that of IIR filters. This situation can be met especially in applications demanding narrow transition bands or if it is required to approximate sharp cut off frequency. The cost of implementation of an FIR filter can be reduced e.g. by using multiplier-efficient realizations, fast convolution algorithms and multirate filtering.

2.The group delay function of linear phase FIR filters need not always be an integer number of samples.

Advantages & Disadvantages of Linear Phase FIR Filters

Page 16: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 16

2.Linear Phase FIR Digital Filter.

Frequency Response

Page 17: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 17

2. Frequency Response of

Linear Phase FIR Digital Filters

FIR filter of length M :

1

0

][][][M

k

knxkhny

1

0

][)(M

k

kjj ekheH

Page 18: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 18

It will be shown that the linear phase condition is obtained by imposing symmetry conditions on the impulse response of the filter. In particular, we consider two different symmetry conditions for h(k):

The length of the impulse response of the FIR filter (M) can be ODD or EVEN. Then, the four cases of linear phase FIR filters can be obtained.

A. Symmetrical impulse response:1,...,2,1,0]1[][ MkforkMhkh

B. Anti-symmetrical impulse response:

1,...,2,1,0]1[][ MkforkMhkh

Page 19: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 19

2.1. Symmetrical Impulse Response, M: Odd( )h n

n

15M

h(0)=h(14)

“h(7)=h(7)”

h(1)=h(13)

h(6)=h(8)

Page 20: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 20

Example: M=5 (odd), symmetrical impulse response

1 4 0,1,2,3,4

(0) (4) (1) (3) (2) (2)

5 3 3 11 2

2 2 2

M k

h h h h h h

M M

0,1,2, , 1k M

(0) ( 1), (1) ( 2), (2) ( 3), ,

3 1 1 1,

2 2 2 2

h h M h h M h h M

M M M Mh h h h

2.1. Symmetrical Impulse Response, M: Odd

Page 21: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 21

1 131 2 22

2

0

12 ( )

2 2

M MM j k j kM

j

k

M e ee h h k

31 2

2

0

1 12 ( )cos

2 2

MM

j

k

M Me h h k k

1

0

31 2

12

0

( ) ( )

1( )

2

Mj j k

k

MM

j j M kj k

k

H e h k e

Mh e h k e e

the real-valued frequency response ( )rH

2.1. Symmetrical Impulse Response, M: Odd

Page 22: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 22

1

2

1

2

1

2

( ) ( )

( ) ( ) 0

( ) ( ) 0

( ) ( )

1( ) 0

2( )1

( ) 02

Mjj

r

Mj

r r

Mj

r r

jr

r

r

H e e H

H e for H

H e for H

H e H

Mfor H

Mfor H

( ) 1( )

2

d M

d

2.1. Symmetrical Impulse Response, M: Odd

Page 23: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 23

 2.2. Symmetrical Impulse Response, M: Even

( )h n

n

16M

h(0)=h(15)

h(1)=h(14)

h(2)=h(13)

h(7)=h(8)

Page 24: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 24

0,1,2, , 1k M

(0) ( 1), (1) ( 2), (2) ( 3), ,

12 2

h h M h h M h h M

M Mh h

Example: M=4 (even), symmetrical impulse response

1 4 1 3 0,1,2,3

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

4 41 1 1 2

2 2 2 2

M k

h h h h

M M

 2.2. Symmetrical Impulse Response, M: Even

Page 25: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 25

1 4 1 3

0 0 0

( ) ( ) ( ) ( )M

j j k j k j k

k k k

H e h k e h k e h k e

0 1 2 3( ) (0) (1) (2) (3)j j j j jH e h e h e h e h e

0 3 1 2(0) (1)j j j jh e e h e e

1

4 1

0

( ) j kj k

k

h k e e

1

21

0

( )

M

j M kj k

k

h k e e

4.for M

 2.2. Symmetrical Impulse Response, M: Even

Page 26: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 26

1

1 21

0 0

( ) ( ) ( )

MM

j M kj j k j k

k k

H e h k e h k e e

11 22

0

1( ) 2 ( )cos

2

MM

jj

k

MH e e h k k

Here, the real-valued frequency response is given by

12

0

1( ) 2 ( )cos

2

M

rk

MH h k k

1 111 2 22

2

0

2 ( )2

M MM j k j kM

j

k

e ee h k

 2.2. Symmetrical Impulse Response, M: Even

Page 27: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 27

1

2

1

2

1

2

( ) ( )

( ) ( ) 0

( ) ( ) 0

( ) ( )

1( ) 0

2( )1

( ) 02

Mjj

r

Mj

r r

Mj

r r

jr

r

r

H e e H

H e for H

H e for H

H e H

Mfor H

Mfor H

( ) 1( )

2

d M

d

 2.2. Symmetrical Impulse Response, M: Even

Page 28: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 28

We observe that the phase response is a linear function of provided that is positive or negative. When changes the sign from positive to negative (or vice versa), the phase undergoes an abrupt change of radians. If these phase changes occur outside the pass-band of the filter we do not care, since the desired signal passing through the filter has no frequency content in the stop-band.

( )rH ( )rH

 2.2. Symmetrical Impulse Response, M: Even

Page 29: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 29

2.3. Anti-symmetrical Impulse Response, M: Odd

n

( )h n 17M

h(0)=-h(16)

h(1)=-h(15)

h(8)=-h(8)=0

h(7)=-h(9)

!

Page 30: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 30

Example: M=5 (odd), antisymmetrical impulse response 1 4, 0,1,2,3,4

(0) (4), (1) (3),

5 3 3 5

(2) (2) (2) 0 !

1 11 2

2 2 2 2

h

M k

h h h h

M

h

M

h

0,1,2, , 1k M (0) ( 1), (1) ( 2), (2) ( 3), ,

3 1,

2 2

1 10

2 2

h h M h h M h h M

M Mh

M Mh h

h

2.3. Anti-symmetrical Impulse Response, M: Odd

Page 31: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 31

31 2

1

0 0

( ) ( ) ( )

MM

j M kj j k j k

k k

H e h k e h k e e

31 2

2 2

0

12 ( )sin

2

MM

j

k

Me h k k

1 131 2 22

2

0

2 ( )2

M MM j k j kM

j

k

e eje h k

j

the real-valued frequency response ( )rH

2.3. Anti-symmetrical Impulse Response, M: Odd

Page 32: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 32

1

2 2

1

2 2

1 3

2 2

( ) ( )

( ) ( ) 0

( ) ( ) 0

( ) ( )

1( ) 0

2 2( )1 3

( ) 02 2

Mj jj

r

Mj j

r r

Mj j

r r

jr

r

r

H e e H

H e for H

H e for H

H e H

Mfor H

Mfor H

( ) 1( )

2

d M

d

2.3. Anti-symmetrical Impulse Response, M: Odd

Page 33: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 33

Here, the real-valued frequency response is given by

3

2

0

1( ) 2 ( )sin

2

M

rk

MH h k k

12

0

1(0) 2 ( )sin 0 0

2

M

rk

MH h k k

!Low-pass and band-stop filters cannot possess an antisymetrical impulse response because (0) 0.rH !

2.3. Anti-symmetrical Impulse Response, M: Odd

Page 34: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 34

2.4. Anti-symmetrical Impulse Response, M: Even

16M ( )h n

n

h(0)=-h(15)

h(7)=-h(8)

h(1)=-h(14)

Page 35: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 35

 Example: M=4 (even), antisymmetrical impulse response

1 3 0,1,2,3

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

41 1 1

2 2

M k

h h h h

M

0,1,2, , 1k M

(0) ( 1), (1) ( 2), (2) ( 3), ,

12 2

h h M h h M h h M

M Mh h

2.4. Anti-symmetrical Impulse Response, M: Even

Page 36: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 36

1

1 21

0 0

( ) ( ) ( )

MM

j M kj j k j k

k k

H e h k e h k e e

1 111 2 22

2

0

2 ( )2

M MM j k j kM

j

k

e eje h k

j

11 22 2

0

12 ( )sin

2

MM

j j

k

Me h k k

the real-valued frequency response ( )rH

2.4. Anti-symmetrical Impulse Response, M: Even

Page 37: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 37

1

2 2

1

2 2

1 3

2 2

( ) ( )

( ) ( ) 0

( ) ( ) 0

( ) ( )

1( ) 0

2 2( )1 3

( ) 02 2

Mj jj

r

Mj j

r r

Mj j

r r

jr

r

r

H e e H

H e for H

H e for H

H e H

Mfor H

Mfor H

( ) 1( )

2

d M

d

2.4. Anti-symmetrical Impulse Response, M: Even

Page 38: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 38

Here, the real-valued frequency response is given by

12

0

1( ) 2 ( )sin

2

M

rk

MH h k k

12

0

1(0) 2 ( )sin 0 0

2

M

rk

MH h k k

!Low-pass and band-stop filters cannot possess an antisymetrical impulse response because (0) 0.rH !

2.4. Anti-symmetrical Impulse Response, M: Even

Page 39: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 39

Type Frequency Response Applications

Sym

N Odd

LPF, HPF,

BPF ,BSF

Sym

N Even

LPF, BPF

2

3

0

2

1

2

1cos][2

2

1)(

M

k

Mjj k

Mkh

MheeH

12

0

2

1

2

1cos][2)(

M

k

Mjj k

MkheeH

Summary of Characteristics of Linear Phase FIR filters

Page 40: Dsp-unit 6.1 Linear Phase Fir Filters

Apr 21, 2023 40

Type Frequency Response Applications

Anti-Sym

N Odd

Differentiator

Hilbert Transformer

Anti-Sym

N Even

Differentiator

Hilbert Transformer

2

3

0

22

1

2

1sin][2)(

M

k

Mjj k

MkheeH

12

0

22

1

2

1sin][2)(

M

k

jM

jj kM

kheeH

Summary of Characteristics of Linear Phase FIR filters