digital filters- firsite.iugaza.edu.ps/masmar/files/dsp_disc_digital-filters_part3.pdf · 4 linear...

44
1

Upload: others

Post on 09-Jul-2020

43 views

Category:

Documents


0 download

TRANSCRIPT

1

LOGO

[email protected]

Digital Filters- FIR

Part 3

3

FIR

22 1

2

:

1+Z+ZLet h(n)={1,1,1} , H(z)=Z Z 1

Z

no poles except at Z=0

Ex

4

LINEAR PHASE FIR FILTERS

Type 1 ,2,3 and 4

Filter Design: FIR

1. Windowed Impulse Response

2. Window Shapes

3. Design by Iterative Optimization

FIR filtersno poles (just zeros)

no precedent in analog filter design

5

The coefficients are symmetric

h(n) = h(N − n)

and the order N is even.

General form of a FIR filter type I

Ex: h(n)={h(0),h(1),h(2),h(3),h(4)}The order N=4Number of coefficient=N+1=5h(0)=h(4) , h(1)=h(3)

6

7

Ex:

h(n)={h(0),h(1),h(2),h(3),h(4)}

Symmetric FIR filter

Prove that FIR filters have a linear phase.

1 2 3 4

2 2 1 2

2 2 2 1 1

2 2 2

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

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

( ) ( ) 4 (3)

( ) (0) (1) (2)

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

H z h h Z h Z h Z h Z

Z h Z h Z h h Z h Z

h n h N n h(0) = h( ) , h(1) h

H z Z h Z Z h Z Z h

H e h e e h e e h

2

2

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

( ) *

j

j

H e h h h

H e real

8

2 ( )

Rel Rel

Rel

Rel

2

Rel

Rel

Rel

( ) * ( ) | ( ) |

: ( ) 0

( ) 2

: ( ) 0

( ) ( )

2 ( ) 0( )

2 ( ) 0

j j

j j

H e H H e

If H

If H

H e e H

H

H

9

The coefficients are symmetric

h(n) = h(N − n)

and the order N is odd.

Ex: h(n)={h(0),h(1),h(2),h(3),h(4),h(5)}The order N=5Number of coefficient=N+1=6h(0)=h(5) , h(1)=h(4) , h(2)=h(3)

10

The coefficients are antisymmetric

h(n) = -h(N − n)

and the order N is even.

Ex: h(n)={h(0),h(1),h(2),h(3),h(4)}The order N=4Number of coefficient=N+1=5h(0)=-h(4) , h(1)=-h(3)

11

The coefficients are antisymmetric

h(n) = -h(N − n)

and the order N is odd.

Ex: h(n)={h(0),h(1),h(2),h(3),h(4),h(5)}The order N=5Number of coefficient=N+1=6h(0)=-h(5) , h(1)=-h(4) , h(2)=-h(3)

12

Properties of Linear Phase FIR Filters

For the four types of FIR filters discussed above:

linear phase (or equivalently constant group delay)

( ) ( ) ( ) ( )oj n

oY e X y n x n n

13

1 3 2 3

2 3 2

1 1 1 1

* *

* * *

Z Z Z Z

Z Z Z

14

54.1

1

54.1

2

128.

1 2 3 4 5

6

3

4

6

6 5 4 3 2 1

6

( ) 0.2 0.8 0.6 0.4

0.2 0.8 0.6 0.4( )

0.5861 0.8102 1

0.5861 0.8102 1

0.432 0.5396 0.6

:

9

o

o

o

j

j

j

H z 0.4 + 0.6Z 0.8Z Z Z Z Z

0.4Z + 0.6Z 0.8Z Z Z ZH z

Z

zeroe

Z j e

Z j e

Z j e

Z

s

type(1)

128.6

128.6

5

12

1 2 3

8.6

6

4 5 6

6

0.432 0.5396 0.69

0.904 1.1290 1.45

0.904 1.1290 1

:

6 poles at Z=0

( )( )( )( )( )( )( )

.45

o

o

o

j

j

j

j

Poles

Z Z Z Z Z Z Z Z Z Z Z ZH z

j

Z

e

Z e

Z j e

15

54.1

1

54.1

2

128.6

3

128.6

4

128.6

5

128.6

6

1

1

0.69

0.69

1.45

1.45

o

o

o

o

o

o

j

j

j

j

j

j

Z e

Z e

Z e

Z e

Z e

Z e

128.6

6128.63

128.6

5128.64

1 11.45

0.69

1 11.45

0.69

o

o

o

o

j

j

j

j

e ZZ e

e ZZ e

16

54.1

1

54.1

2

128.6

3

128.6

4

128.6

5

128.6

6

1

1

0.69

0.69

1.45

1.45

o

o

o

o

o

o

j

j

j

j

j

j

Z e

Z e

Z e

Z e

Z e

Z e

1 1 *Z Z

3 3 *Z Z

3 3

1 1

*Z Z

17

18

Properties of Linear Phase FIR Filters

Type 4Type 3Type 2Type 1

have an odd

number of

zeros

have an odd

number of zeros

have an even

number of

zeros or no

zeros

have an even

number of

zeros or no

zeros

Zeros at

Z=1

have an even

or odd

number of

zeros

have an odd

number of zeros

have an odd

number of

zeros

have an even

number of

zeros or no

zeros

Zeros at

Z=-1

19

1 2

For type(2) FIR filter,has the following zero locations:

1 1Z , Z

2 2

(a) Find the remaining zeros ???

(b) Find h(n) ???

j j

20

1 2 1

3 4 3

1 1

90 90

5 6 5

For type(2) FIR filter,has the following zero locations:

1 1Z = Z =Z *=

2 2

1 1Z 1.414 Z =Z *= 1.414

Z Z *

Z 1 Z Z * 1

:

o o

o o

o o

j45 j45

j45 j45

j j

j 0.707e 0.707e

e e

j e e

have an even number

type(2)

of zer

7assume one Z 1

The order (N)=7 , the length(# of coeffi

the zeros:

cients)=N+1

a

, ,1.4

t

1

=

4

8

o oj45 j45 j450.707e 0.707e e

have

no zeros at z = 1

zero at z =

an odd number of zeros

os or no zeros at z

1

= 1

z = 1

90 90,1.414 ,1 ,1 , 1o o o oj45 j je e e

21

1 2 3 4 5 6 7

7

90 90

7

7 6 5 4 3 2

7

( )( )( )( )( )( )( )( )

( )( )( 1.414 )( 1.414 )( 1 )( 1 )( ( 1))( )

2 2.5 0.5 0.5 2.5 2 1( )

( ) {1, 2,2.5,

o o o o o oj45 j45 j45 j45 j j

Z Z Z Z Z Z Z Z Z Z Z Z Z ZH z

Z

Z 0.707e Z 0.707e Z e Z e Z e Z e ZH z

Z

Z Z Z Z Z Z ZH z

Z

h n

0.5, 0.5,2.5, 2,1}

: (0) (7) 2 5 3 4note h h , h(1) = h(6) , h( ) = h( ) , h( ) = h( )

22

WINDOWS Method

1 1 1( ) ( ) 1. |

2 2 2

sin( )

, , n 02

cc

cc

c c

c

j nj n j n

j n j n n

n

eh n H e d e d

jn

e en

j n

The ideal LPF has a frequency response characte

1 |

ris

|<( )

0 <

tics:

c

c

H

23Limit in freq. unlimited in time, Sol: Using windows

0

sin( )( ) , , n 0

1 1( ) ( ) | 1 , n=0

2 2

c

c

c

j n

n

c

nh n n

n

h n H e d d

For n = 0

24

,

( )sin( )

,

c

LP

c

n = 0

h nn

n 0n

25

26

( )HPh n

( )BPh n

( )BSh n

?prove

27

( )LPh n

( )w n

( )wh n

( )h n

Coefficients of the FIR filter modified by a rectangular window function

,

( )sin( )

,

c

LP

c

n = 0

h nn

n 0n

( ) ( ) ( )LPh n h n w n

28

( )LPh

( )w

( ) ( ) ( )LPh h w

Gibbs Phenomenon

29

Rectangular window

30

31

The truncation of the fourier series is known to

introduce ripples in the frequency response

characteristic H(w) due to the non uniform

convergence of the fourier series at a discontinuity .

The oscillatory behavior near the band edge of the

filter is called the Gibbs phenomenon

To reduce Gibbs phenomenon used

other different type of windows.

32

Other windows

Note: the number of coefficients generated by the window functions is

33

Note: the number of coefficients generated by the window functions is

34

Shapes of several window functions

35

3 tap FIR filter

Length 3

the order N 2 

N 2M M 1

8000.1

8000

0.1

cc

s

c

Ff

F

36

,

( )sin( )

,

( 1) (1) 0.187

(0) 0.2

c

LP

c

n = 0

h nn

n 0n

h h

h

37

1

( 1) (1) 0.08

(0) 1

M

w w

w

38

( ) ( ) ( )

( 1) ( 1) ( 1) (0.187)(0.08) 0.01497

(0) (0) (0) (0.2)(1) 0.2

( ) {0.01497, ,0.014972

0.0149

}

by one sample(causal)

( ) { ,2,0.0 }7 1497

w

w

w

w

w

h n h n w n

h h w

h h w

h n

shifting

h n

39

40

41

Consider the pole-zero plot shown in figure

(a) Does it represent an FIR filter?

(b) Is it a linear-phase system?

60 60

2

60 60

3 4

5 6

7

4 4(b) ,

3 3

3 3 ,

4 4

4 3

3 4

1

o o

o o

j j

1

j j

Z e Z e

Z e Z e

Z Z

Z

( ) Yes, But it may be linear phase FIR or not.a

7 zeroes

42

2

3 4

5

6

7

*

1 1 ,

*

1

*

1

1

1 1

Z Z

Z ZZ Z

ZZ

Z

60 60

2

60 60

3 4

5 6

7

4 4 ,

3 3

3 3 ,

4 4

4 3

3 4

1

o o

o o

j j

1

j j

Z e Z e

Z e Z e

Z Z

Z

Linear phase

43

1 2 3 4 5 6 7

7

60 60 60 60

7

7 6 5 4 3 2

7

( )( )( )( )( )( )( )( )

4 4 3 3 4 3( )( )( )( )( ( ))( ( ))( 1)

3 3 4 4 3 4( )

0 2.8 2.8 0 1 1( )

( ) {1, 1,0,2.8, 2.8,0,1, 1}

: (0)

o o o oj j j j

Z Z Z Z Z Z Z Z Z Z Z Z Z ZH z

Z

Z e Z e Z e Z e Z Z Z

H zZ

Z Z Z Z Z Z ZH z

Z

h n

note h

(7) 2 5 3 4

the order N=7 , length=N+1=8

anti-symmetric

anti-symmetric (4)

h , h(1) = h(6) , h( ) = h( ) , h( ) = h( )

odd

odd type

60 60 60 60

2 3 4

5 6 7

4 4 3 3 , , ,

3 3 4 4

4 3 , , 1

3 4

o o o oj j j j

1Z e Z e Z e Z e

Z Z Z

44

3 ( ) 5 ( 1) 4 ( 2) 5 ( 3) 7 ( 4)

(b) FIR,No poles

(d) for linear phase we require a symmetric or anti-symmetric

but, h(0) h(4) the filter is not linear phase.

(a) h(n) = n n n n n