12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7...

152
1 22/6/16 1 Zhongguo Liu_Biomedical Engineering_Shand ong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical Engineering School of Control Science and Engineering, Shandong University

Transcript of 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7...

Page 1: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

123/4/19 1Zhongguo Liu_Biomedical Engineering_Shandong U

niv.

Biomedical Signal processingChapter 7 Filter Design

Techniques

Zhongguo Liu

Biomedical Engineering

School of Control Science and Engineering, Shandong University

Page 2: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

2

Chapter 7 Filter Design Techniques

7.0 Introduction7.1 Design of Discrete-Time IIR Filters

From Continuous-Time Filters7.2 Design of FIR Filters by Windowing7.3 Examples of FIR Filters Design by

the Kaiser Window Method7.4 Optimum Approximations of FIR

Filters7.5 Examples of FIR Equiripple

Approximation7.6 Comments on IIR and FIR Discrete-

Time Filters

Page 3: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

3

Filter Design Techniques

7.0 Introduction

Page 4: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

4

7.0 Introduction

Frequency-selective filters pass only

certain frequencies

Any discrete-time system that

modifies certain frequencies is called

a filter.

We concetrate on design of causal

Frequency-selective filters

Page 5: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

5

Stages of Filter Design

The specification of the desired properties of the system.

The approximation of the specifications using a causal discrete-time system.

The realization of the system.Our focus is on second stepSpecifications are typically given in

the frequency domain.

Page 6: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

6

Frequency-Selective Filters

Ideal lowpass filter

ww

wweH

c

cjwlp ,0

,1

0cw

cw 22

jweH

1

nn

nwnh c

lp ,sin

Page 7: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

7

Frequency-Selective Filters

Ideal highpass filter

0,

1,cjw

hpc

w wH e

w w

0cw

cw 22

jweH

1

sin,c

hp

w nh n n n

n

Page 8: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

8

Frequency-Selective Filters

Ideal bandpass filter

others

wwweH ccjw

bp,0

,121

01c

w1c

w

jweH

1

2cw

2cw

Page 9: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

9

Frequency-Selective Filters

Ideal bandstop filter

others

wwweH ccjw

bs,1

,021

01c

w1c

w

jweH

1

2cw

2cw

Page 10: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

10

If input is bandlimited and sampling frequency is high enough to avoid aliasing, then overall system behave as a continuous-time system:

T

TeHjH

Tj

eff

,0

,

Linear time-invariant discrete-time system

,effjw w

H H j wT

e

continuous-time specifications are converted to discrete time specifications by:

Tw

Page 11: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

11

Example 7.1 Determining Specifications for a Discrete-Time

FilterSpecifications of the continuous-time filter:1. passband2. stopband

20002001.0101.01 forjH eff

30002001.0 forjH eff

sT 410

max

12 2

22 5000

fT T

T

TeHjH

Tj

eff

,0

,

Page 12: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

12

Example 7.1 Determining Specifications for a Discrete-Time

FilterSpecifications of the continuous-time filter:1. passband2. stopband

20002001.0101.01 forjH eff

30002001.0 forjH eff

sT 410

max

12 2

22 5000

fT T

1 0.01

2 0.001

2 (2000)p

2 (3000)s

Page 13: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

13

sT 410T

Example 7.1 Determining Specifications for a Discrete-Time

FilterSpecifications of the discrete-time filter in

1 0.01 2 0.001

2 (2000)p 2 (3000)s

0.4p 0.6s

Page 14: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

14

Filter Design Constraints

Designing IIR filters is to find the approximation by a rational function of z.

The poles of the system function must lie inside the unit circle(stability, causality).

Designing FIR filters is to find the polynomial approximation.

FIR filters are often required to be linear-phase.

Page 15: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

15

Filter Design Techniques

7.1 Design of Discrete-Time IIR

Filters From Continuous-Time

Filters

Page 16: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

16

7.1 Design of Discrete-Time IIR

Filters From Continuous-Time Filters

The traditional approach to the

design of discrete-time IIR filters

involves the transformation of a

continuous-time filter into a

discrete filter meeting prescribed

specification.

Page 17: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

17

Three Reasons

1. The art of continuous-time IIR filter design is highly advanced, and since useful results can be achieved, it is advantageous to use the design procedures already developed for continuous-time filters.

Page 18: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

18

Three Reasons

2. Many useful continuous-time IIR design method have relatively simple closed form design formulas. Therefore, discrete-time IIR filter design methods based on such standard continuous-time design formulas are rather simple to carry out.

Page 19: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

19

Three Reasons

3. The standard approximation

methods that work well for

continuous-time IIR filters do not

lead to simple closed-form

design formulas when these

methods are applied directly to

the discrete-time IIR case.

Page 20: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

20

Steps of DT filter design by transforming a prototype

continuous-time filter

The specifications for the continuous-time filter are obtained by a transformation of the specifications for the desired discrete-time filter.

Find the system function of the continuous-time filter.

Transform the continuous-time filter to derive the system function of the discrete-time filter.

Page 21: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

21

Constraints of Transformation

to preserve the essential properties of the frequency response, the imaginary axis of the s-plane is mapped onto the unit circle of the z-plane. jwezjs

planes planez Im Im

Re Re

Page 22: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

22

Constraints of Transformation

In order to preserve the property of stability, If the continuous system has poles only in the let half of the s-plane, then the discrete-time filter must have poles only inside the unit circle.

planes Im

Re

planez Im

Re

Page 23: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

23

7.1.1 Filter Design by Impulse Invariance

The impulse response of discrete-time system is defined by sampling the impulse response of a continuous-time system.

dcd nThTnh

dc TjHif ,0

w

T

wjHeHthen

dc

jw ,

wforTw d

k ddc

jw kT

jT

wjHeH

2Relationship of frequencies

Page 24: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

24

,, dT

relation between frequencies

S plane Z plane

-

3 / dT

j

/ dT

/ dT

k ddc

jw kT

jT

wjHeH

2Relationship of frequencies

dc TjHif ,0

w

T

wjHeHthen

dc

jw ,

Page 25: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

25

Aliasing in the Impulse Invariance

k ddc

jw kT

jT

wjHeH

2

dc TjHif ,0

,jwc

d

wthen H e H j

T

w

Page 26: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

26

periodic sampling

[ ] ( ) | ( )c t nT cx n x t x nT

T : sample period; fs=1/T:sample rateΩs=2π/T:sample rate

n

nTtts

s c c cn n

x t x t s t x t t nT x nT t nT

Review

Page 27: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

27

Time domain : )(tx

Complex frequency domain :

dtetxsX st)()(

Laplace transformLaplace transform

js

f2

s pl ane

j

0

Relation between Laplace Relation between Laplace Transform and Z-transformTransform and Z-transform

Review

Page 28: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

28

dtetxjX tj)()(

Fourier Transform

frequency domain :

s-pl ane

j

0

Fourier Transform is the Laplace transform Laplace transform

when s have the value only in imaginary axis, s=jΩ

js Since

So 0 s j

dtetxsX st)()(

Page 29: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

29

( ) ( ) ( ) ( ) ( )n n

x n x t t nT x nT t nT

For discrete-time signal ,

( ) ( ) st

n

x nT t nT e dt

( ) ( )snT sT

n

x nT e X e

[ ( )] ( ) stx n x n e dt

L

sTz e令:( ) ( )n

n

x n z X z

z-transform

of discrete-

time signal

the Laplace transformLaplace transform

Page 30: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

30

( )sT j T T j T jz e e e e re

n

nznxzX )()(

so :Tr e

T

relation betweens zand

Laplace transformLaplace transform continuous time signal

z-transformz-transform discrete-time signalrelation

[ ( )] ( ) ( )snT sT

n

x n x nT e X e

LsTz elet :

Page 31: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

31

2 sT f f

DTFT : Discrete Time Fourier Transform

( )sT j T T j T jz e e e e re

( ) ( )j j n

n

X e x n e

S plane Z plane

-

3 / sT

j

/ sT

/ sT

1|j jrz re e

Page 32: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

32

2 2s sT f f f

z plane

Re[ ]z

Im[ ]z

0

r

0 2 / 2

0 2

2

s

s s

s s

f

f

: 0

0 2

2 4

:sf f f

j

s pl ane

0

22s

s

f

T

sT

3

sT

3

sT

Page 33: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

33

If input is bandlimited and fs>2fmax , :

T

TeHjH

Tj

eff

,0

,

discrete-time filter design by impulse invariance

wforTw d

k ddc

jw kT

jT

wjHeH

2

dc TjHif ,0

,jwc

d

wthen H e H j w

T

dcd nThTnh

Page 34: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

34

,, dT

relation between frequencies

S plane Z plane

-

3 / dT

j

/ dT

/ dT

k ddc

jw kT

jT

wjHeH

2Relationship of frequencies

dc TjHif ,0

w

T

wjHeHthen

dc

jw ,

Page 35: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

35

periodic sampling

[ ] ( ) | ( )c t nT cx n x t x nT

T : sample period; fs=1/T:sample rateΩs=2π/T:sample rate

n

nTtts

s c c cn n

x t x t s t x t t nT x nT t nT

2s

k

S j kT

1 1 2*

2 2s c c sk

X j X j S j X j k dT

1c s

k

X j kT

Review

Page 36: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

36

proof of

T : sample period; fs=1/T:sample rate;Ωs=2π/T:sample rate

n

nTtts

2s

k

S j kT

Review

2s

k

S j kT

sjk tk

n

a e

s(t) 为冲击串序列,周期为 T ,可展开傅立叶级数

1sjk t

n

eT

2 ( )sjk t Fse k

Page 37: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

37

periodic sampling

s c c cn n

x t x t s t x t t nT x nT t nT

j Tnc

k

x nT e

( ) j ts c

n

X j x nT t nT e dt

[ ] ( ) | ( )c t nT cx n x t x nT ( )j j n

cn

X e x nT e

( ) ( ) ( )j j Ts TX j X e X e

1( )j T

c sk

X e X j kT

1 2( ) c

k

j kX X j

T T Te

2s T

( ) 0,j Tif X eT

1( ) c

jthen X X jT T

e

1s c s

k

X j X j kT

Page 38: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

38

discrete-time filter design by impulse invariance

k ddc

jw kT

jT

wjHeH

2

dc TjHif ,0

,jwc

d

wthen H e H j w

T

dcd nThTnh

1 2( ) c

k

j kX X j

T T Te

1

( ) cjX X j

T Te

1 2( ) c

k

j kH H j

T T Te

1( ) c

jH H jT T

e

[ ] ( ) | ( )c t nT cx n x t x nT [ ] ( )ch n h nT

Page 39: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

39

Steps of DT filter design by transforming a prototype

continuous-time filter

Obtain the specifications for continuous-time filter by transforming the specifications for the desired discrete-time filter.

Find the system function of the continuous-time filter.

Transform the continuous-time filter to derive the system function of the discrete-time filter.

Page 40: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

40

Transformation from discrete to continuous

In the impulse invariance design procedure, the transformation is

Assuming the aliasing involved in the transformation is neglected, the relationship of transformation is

w

T

wjHeH

dc

jw ,

dTw

Page 41: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

41

Steps of DT filter design by transforming a prototype

continuous-time filter

Obtain the specifications for continuous-time filter by transforming the specifications for the desired discrete-time filter.

Find the system function of the continuous-time filter.

Transform the continuous-time filter to derive the system function of the discrete-time filter.

Page 42: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

42

Continuous-time IIR filters

Butterworth filtersChebyshev Type I filtersChebyshev Type II filtersElliptic filters

Page 43: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

43

Steps of DT filter design by transforming a prototype

continuous-time filter

Obtain the specifications for continuous-time filter by transforming the specifications for the desired discrete-time filter.

Find the system function of the continuous-time filter.

Transform the continuous-time filter to derive the system function of the discrete-time filter.

Page 44: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

44

Transformation from continuous to discrete

N

k k

k

ss

AsH

1

0,0

0,1

t

teAth

N

k

tsk

c

k

: k ds Tkpole s s z e

two requirements for transformation

N

k

nTskd

N

k

nTskdcd nueATnueATthTnh dkdk

11

N

kTskd

ze

ATzH

dk1

11

Page 45: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

45

Example 7.2 Impulse Invariance with a Butterworth Filter

Specifications for the discrete-time filter:

weH

weH

jw

jw

3.0,17783.0

2.00,189125.0

dd TwTlet 1

Assume the effect of aliasing is negligible

3.0,17783.0

2.00,189125.0

jH

jH

c

c

Page 46: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

46

Example 7.2 Impulse Invariance with a Butterworth Filter

0.89125 1, 0 0.2

0.17783, 0.3

c

c

H j

H j

0.2 0.89125

0.3 0.17783

c

c

H j

H j

0.30.2

2 20.2 1

10.89125

N

c

2 2

0.3 11

0.17783

N

c

2

2

1

1Nc

cH j

j j

2

2

11

N

cc

j jH j

Page 47: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

47

Example 7.2 Impulse Invariance with a Butterworth Filter

2

2

1

1Nc

cH j

j j

2 20.2 1

1 1.258930.89125

N

c

7032.0,6 cN

2 20.3 1

1 31.622040.17783

N

c

20.2

0.25893

N

c

20.3

30.62204

N

c

23

118.263782

N

70470.0,8858.5 cN

0.2 0.89125

0.3 0.17783

c

c

H j

H j

Page 48: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

48

Example 7.2 Impulse Invariance with a Butterworth

Filter

2

2

1

1Nc

cH j

j j

2

2

1

1Nc c c

cH s H s H s

s j

0,1, , 2 1k N 2 2 11 21 ,k

j N k NNc cs j e

6, 0.7032cN

0.182 0.679,j

0.497 0.497,j

0.679 0.182j

Plole pairs: cH s

Page 49: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

49

Example 7.2 Impulse Invariance with a Butterworth Filter

4945.03585.14945.09945.04945.03640.0

12093.0222

ssssss

sH c

22

2 2 2

1

1

N

N N N

c

cc c c

cH s H s H s

ss j

0.182 0.679,j 0.497 0.497,j 0.679 0.182j Plole pairs: cH s

0.12093

0.182 0.679 0.182 0.679 0.497 0.497cH ss j s j s j

1

0.497 0.497 0.679 0.182 0.679 0.182s j s j s j

60.7032Nc

Page 50: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

50

Example 7.2 Impulse Invariance with a Butterworth Filter

1 1

1 2 1 2

1

1 2

0.2871 0.4466 2.1428 1.1455

1 1.2971 0.6949 1 1.0691 0.3699

1.8557 0.6303

1 0.9972 0.2570

z z

z z z z

z

z z

0.12093

0.182 0.679 0.182 0.679 0.497 0.497cH ss j s j s j

1

0.497 0.497 0.679 0.182 0.679 0.182s j s j s j

1

Nk

k k

A

s s

1 1

1 11 1

N Nd k k

k kk d ks T s

T A AH z

e z e z

1dT

Page 51: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

51

Basic for Impulse Invariance

To chose an impulse response for the discrete-time filter that is similar in some sense to the impulse response of the continuous-time filter.

If the continuous-time filter is bandlimited, then the discrete-time filter frequency response will closely approximate the continuous-time frequency response.

The relationship between continuous-time and discrete-time frequency is linear; consequently, except for aliasing, the shape of the frequency response is preserved.

Page 52: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

52

7.1.2 Bilinear Transformation

Bilinear transformation can avoid the problem of aliasing.

Bilinear transformation maps onto

w

1

1

2 1

1dc

zH z H

T z

1

1

1

12

z

z

Ts

d

Bilinear transformation:

cH s

1

1

1

12

z

z

Ts

d

Page 53: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

53

7.1.2 Bilinear Transformation

1

1

1

12

z

z

Ts

d

sT

sTz

d

d

21

21

js 221

221

dd

dd

TjT

TjTz

anyforz 10

anyforz 10

1 12 (1 ) 1dT s z z

11 2 ] 1 2d dT s z T s

Page 54: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

54

7.1.2 Bilinear Transformation

jsaxisj

21

21

d

d

Tj

Tjz

1z 1 2

1 2d

d

jw j T

j Te

planes Im

Re

planez Im

Re

221

221

dd

dd

TjT

TjTz

anyforz 10

anyforz 10

js

Page 55: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

55

7.1.2 Bilinear Transformation

1

1

1

12

z

z

Ts

d

2 1

1d

jw

jwjT

ee

2tan 2

d

j wT

2 2 sin 2

2cos 2d

j w

T w

2tan2

wTd

2tan2 1dTw

/2 /2 /2

/2 /2 /22 ( )

( )d

jw jw jw

jw jw jwT

e e ee e e

Page 56: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

56

2tan

2

2tan

2

:

s

ds

p

dp

T

T

prewarp

2

tan2)()(

dT

cj jHeH

relation between frequency response of Hc(s), H(z)

Page 57: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

57

Comments on the Bilinear Transformation

It avoids the problem of aliasing encountered with the use of impulse invariance.

It is nonlinear compression of frequency axis.

S plane Z plane

-

3 / dT

j

/ dT

/ dT

2tan2

wTd

2tan2 1dTw

Page 58: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

58

Comments on the Bilinear Transformation

The design of discrete-time filters using bilinear transformation is useful only when this compression can be tolerated or compensated for, as the case of filters that approximate ideal piecewise-constant magnitude-response characteristics.

0cw

cw 22

jweH

1

Page 59: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

59

Bilinear Transformation of

1

1

1

12

z

z

Ts

d

2tan2

wTd

se

je

2tan 2

d

wT

dT

Page 60: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

60

Comparisons of Impulse Invariance and Bilinear

Transformation

The use of bilinear transformation is restricted to the design of approximations to filters with piecewise-constant frequency magnitude characteristics, such as highpass, lowpass and bandpass filters.

Impulse invariance can also design lowpass filters. However, it cannot be used to design highpass filters because they are not bandlimited.

Page 61: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

61

Comparisons of Impulse Invariance and Bilinear

Transformation

Bilinear transformation cannot design filter whose magnitude response isn’t piecewise constant, such as differentiator. However, Impulse invariance can design an bandlimited differentiator.

Page 62: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

62

Butterworth Filter, Chebyshev Approximation, Elliptic Approximation

7.1.3 Example of Bilinear Transformation

weH

weH

jw

jw

6.0,001.0

4.0,01.199.0

Page 63: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

63

0.0160.01

Example 7.3 Bilinear Transformation of a Butterworth Filter

0.89125 1, 0 0.2

0.17783, 0.3

jw

jw

H e w

H e w

2 0.20.89125 1, 0 tan

2

2 0.30.7783, tan

2

cd

cd

H jT

H jT

, 1dFor convenience we choose T

,17783.015.0tan2

,89125.01.0tan2

jH

jH

c

c

2tan2

wTd

Page 64: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

64

Example 7.3 Bilinear Transformation of a Butterworth Filter

,17783.015.0tan2

,89125.01.0tan2

jH

jH

c

c

N

c

cjj

jH 2

2

1

1

2 2

2 2

2 tan 0.1 11

0.89125

3tan 0.15 11

0.17783

N

c

N

c

305.5N

766.0

,6

c

N

0.0160.01

Page 65: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

65

Locations of Poles

0,1, , 2 1k N 2 2 11 21 ,k

j N k NNc cs j e

0.1998 0.7401,j

0.5418 0.5418,j

0.7401 0.1998j

Plole pairs: cH s

2

2

1

1Nc

cH j

j j

2

2

1

1Nc c c

cH s H s H s

s j

6, 0.766cN

Page 66: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

66

Example 7.3 Bilinear Transformation of a Butterworth Filter

5871.04802.15871.00836.15871.03996.0

20238.0222

ssssss

sH c

21

2121

61

2155.09904.01

1

3583.00106.117051.02686.11

10007378.0

zz

zzzz

zzH

22

2 2 2

1

1

N

N N N

c

cc c c

cH s H s H s

ss j

0.1998 0.7401,j 0.5418 0.5418,j 0.7401 0.1998j Plole pairs: cH s

1

1

1

12

z

z

Ts

d

Page 67: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

67

Ex. 7.3 frequency response of discrete-time filter

Page 68: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

68

Example 7.4 Butterworth Approximation (Hw)

weH

weH

jw

jw

6.0,001.0

4.0,01.199.014Norder

Page 69: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

69

Example 7.4 frequency response

Page 70: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

70

Chebyshev filters

C Chebyshev filter (type I)

)/(1

1|)(| 22

2

cN

cV

jH

)coscos()( 1 xNxVN

c

1

1

Chebyshev polynomial

Chebyshev filter (type II)

122

2

)]/([1

1|)(|

cN

cV

jH

1

c

Page 71: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

71

Example 7.5 Chebyshev Type I , II Approximation

weH

weH

jw

jw

6.0,001.0

4.0,01.199.08Norder

Type I Type II

Page 72: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

72

Example 7.5 frequency response of Chebyshev

Type I Type II

Page 73: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

73

E

elliptic filters

Elliptic filter

)(1

1|)(|

222

Nc U

jH

sp

1

11

2Jacobian elliptic function

Page 74: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

74

Example 7.6 Elliptic Approximation

weH

weH

jw

jw

6.0,001.0

4.0,01.199.06Norder

Page 75: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

75

Example 7.6 frequency response of Elliptic

Page 76: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

76

*Comparison of Butterworth, Chebyshev, elliptic filters: Example

-Given specification

0.4| | .011 |)(| 99.0 jeH ||0.6 0.001 |)(| jeH

6.0 ,4.0 001.0 ,01.0 s21 p

)( s

-Order

Butterworth Filter : N=14. ( max flat)

Chebyshev Filter : N=8. ( Cheby 1, Cheby 2)

Elliptic Filter : N=6 ( equiripple)

B

C

E

Page 77: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

77

-Pole-zero plot (analog)

-Pole-zero plot (digital)

B C1 C2 E

B C1 C2 E

(14) (8)

Page 78: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

78

-Magnitude -Group delay

B

C1

C2

E

B

C1

C2

E

4.0 6.0 4.0 6.0

5

20

Page 79: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

79

7.2 Design of FIR Filters by Windowing

FIR filters are designed based on directly approximating the desired frequency response of the discrete-time system.

Most techniques for approximating the magnitude response of an FIR system assume a linear phase constraint.

Page 80: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

80

Window MethodAn ideal desired frequency response

n

jwnd

jwd enheH

dweeHnh jwnjw

dd 2

1

Many idealized systems are defined by piecewise-constant frequency response with discontinuities at the boundaries. As a result, these systems have impulse responses that are noncausal and infinitely long.

ww

wweH

c

cjwlp ,0

,1

sin clp

w nh n

n

0cw

cw

jweH1

Page 81: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

81

Window Method

otherwise

Mnnhnh d

,0

0,

nwnhnh d

otherwise

Mnnw

,0

0,1

deWeHeH wjjwd

jw

2

1

The most straightforward approach to obtaining a causal FIR approximation is to truncate the ideal impulse response.

Page 82: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

82

Windowing in Frequency Domain

Windowed frequency response

deWeH21

eH jjd

j

The windowed version is smeared version of desired response

Page 83: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

83

Window Method

1

2j wjw j jw

d dH e H e W e d H e

If nnw 1

kn

jwnjw kwenweW 22

0cw

cw

jweH1

0 5 10510 1515

2

2

24 4 6

jwW e

Page 84: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

84

Choice of Window is as short as possible in duration.

This minimizes computation in the implementation of the filter.

nw

approximates an impulse. jweW

0

Mjw jwn jwn

n n

W e w n e e

1

2sin 1 21

1 sin 2

jw MjwM

jw

w Mee

e w

otherwise

Mnnw

,0

0,1

1M

2

1M

2

1M

jwW e

Page 85: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

85

Window Method

jwd

wjjwd

jw eHdeWeHeH

21

then would look like , except where changes very abruptly.

jweH jwd eH

jwd eH

nw jweW0w

If is chosen so that is concentrated in a narrow band of frequencies around

0cwcw

jwdH e

11M

2

1M

2

1M

jwW e

Page 86: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

86

Rectangular Window for the rectangular window has a

generalized linear phase. jweW

As M increases, the width of the “main lobe” decreases. 4 1

mw M

While the width of each lobe decreases with M, the peak amplitudes of the main lobe and the side lobes grow such that the area under each lobe is a constant.

2sin 1 2

sin 2jw jwM

w MW e e

w

1M

2

1M

2

1M

1

M

M

1

M

M

Page 87: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

87

Rectangular Window will oscillate at the

discontinuity.

deWeH wjjwd

The oscillations occur more rapidly, but do not decrease in magnitude as M increases.

The Gibbs phenomenon can be moderated through the use of a less abrupt truncation of the Fourier series.

Page 88: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

88

Rectangular WindowBy tapering the window smoothly to zero

at each end, the height of the side lobes can be diminished.

The expense is a wider main lobe and thus a wider transition at the discontinuity.

Page 89: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

89

7.2 Design of FIR Filters by Windowing Method

To design an ilowpass FIR Filters

ww

wweH

c

cjwlp ,0

,1

sin clp

w nh n

n

0cw

cw

jweH1

Review

dh n h n w n 1, 0

0,

n Mw n

otherwise

deWeHeH wjjwd

jw

2

1

1M

2

1M

2

1M

jwW e

sin 2

2cw n M

n M

02M0

2M0

M

M

2M0 M

Page 90: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

90

7.2.1 Properties of Commonly Used Windows

Rectangular

otherwise

Mnnw

,0

0,1

otherwise

MnMMn

MnMn

nw

,0

2,22

20,2

Bartlett (triangular)

Page 91: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

91

7.2.1 Properties of Commonly Used Windows

Hanning

otherwise

MnMnnw

,0

0,2cos5.05.0

otherwise

MnMnnw

,0

0,2cos46.054.0

Hamming

Page 92: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

92

7.2.1 Properties of Commonly Used Windows

Blackman

otherwise

MnMn

Mnnw

,00,4cos08.0

2cos5.042.0

Page 93: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

93

7.2.1 Properties of Commonly Used Windows

Page 94: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

94

Frequency Spectrum of Windows

(a) Rectangular, (b) Bartlett, (c) Hanning, (d) Hamming, (e) Blackman , (M=50)

(a)-(e) attenuation of sidelobe increases, width of mainlobe increases.

Page 95: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

95

7.2.1 Properties of Commonly Used Windows

biggest , high oscillations at discontinuity

smallest , the sharpest transition

Table 7.1

Page 96: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

96

7.2.2 Incorporation of Generalized Linear Phase

In designing FIR filters, it is desirable to obtain causal systems with a generalized linear phase response.

otherwise

MnnMwnw

,0

0,

The above five windows are all symmetric about the point ,i.e.,2M

Page 97: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

97

7.2.2 Incorporation of Generalized Linear Phase

Their Fourier transforms are of the form

2Mjwjwe

jw eeWeW woffunctionevenandrealaiseW jw

e

causalnwnhnh d :

d d dif h M n h n h n h n w n

2Mjwjwe

jw eeAeH

:h M n h n generalized linear phase

2MM

Page 98: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

98

7.2.2 Incorporation of Generalized Linear Phase

phaselineardgeneralizenhnMh

nwnhnhnhnMhif ddd

:

2Mjwjwo

jw eejAeH

2MM

Page 99: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

99

Frequency Domain Representation

nhnMhif dd 2Mjwjwe

jwd eeHeH

1

2jw

d

j wjH e H W de e

1

2 e e

j wjw jwewhere A H W de e e

221

2 e e

j w j w Mj j MH W de e e e

2Mjwjwe

jw eeWeW w n w M n

2jw jwMeA e e

dh n h n w n

Page 100: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

100

Example 7.7 Linear-Phase Lowpass Filter

The desired frequency response is

ww

wweeH

c

cjwM

jwlp ,0

,2

lph M n

nw

Mn

Mnwnh c

2

2sin

21

2

sin 2

2

c

clp

c

w

w

jwM jwnh n dw

w n Mfor n

n M

e e

2M

wweH

wweH

sjw

pjw 01

Page 101: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

101

magnitude frequency response

pw

sw

1 0jwp p

jws s

H e w w

H e w w

s pw w w

1020logp p

0.1 0.15jwH e w

1 0.05 0 0.25jwH e w

0.1s pw w w 1020log 0.05 26p dB

1020logs s

20s dB

Page 102: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

102

7.2.1 Properties of Commonly Used Windows

smallest , the sharpest transition

biggest , high oscillations at discontinuity

Page 103: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

103

7.2.3 The Kaiser Window Filter Design Method

1 22

0

0

1, 0

0,

I nn Mw n

I

otherwise

2,where M

0 :I u zero order modified Bessel function of the first kind

2

01

21

!r

ru

I ur

: 1,length M :parametershape:two parameters

Trade side-lobe amplitude for main-lobe width

Page 104: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

104

Figure 7.24

As increases, attenuation of sidelobe increases, width of mainlobe increases.

As M increases, attenuation of sidelobe is preserved, width of mainlobe decreases.

M=20

(a) Window shape, M=20, (b) Frequency spectrum, M=20, (c) beta=6

=6

Page 105: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

105

Table 7.1

Transition width is a little less than mainlobe width

Page 106: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

106

Increasing M wile holding constant causes the main lobe to decrease in width, but does not affect the amplitude of the side lobe.

ComparisonIf the window is tapered more, the side lobe

of the Fourier transform become smaller, but the main lobe become wider.

M=20

=6

M=20

Page 107: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

107

pw

sw

Filter Design by Kaiser Window

wweH

wweH

sjw

pjw 01

ps www 10log20A

Page 108: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

108

Filter Design by Kaiser Window

ps www 10log20A

21,0.0

5021,2107886.0215842.0

50,7.81102.04.0

A

AAA

AA

2285.2

8

w

AM

1 22

0

0

1, 0

0,

I nn Mw n

I

otherwise

M=20

Page 109: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

109

Example 7.8 Kaiser Window Design of a Lowpass Filter

weH

weH

jw

jw

6.0,001.0

4.0,01.199.0

ps www 10log20A

1 22

0

0

1sin

, 0c

I nw n

n Mn I

0,h n

otherwise

5.182 Mwhere

21,0.0

5021,2107886.0215842.0

50,7.81102.04.0

A

AAA

AA

8

2.285

AM

w

Page 110: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

110

Example 7.8 Kaiser Window Design of a Lowpass Filter

weH

weH

jw

jw

6.0,001.0

4.0,01.199.0

001.0,min,001.0,01.0

,6.0,4.0

:1

2121

sp ww

step

0.52

s pc

w wcutoff frequency w

2 :step

3:step100.2 20log 60

0.5653 37

s pw w w A

M

Page 111: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

111

Example 7.8 Kaiser Window Design of a Lowpass Filter

0.5653

5.182 Mwhere 2

01

21

!r

ru

I ur

1 22

0

0

1sin

, 0c

I nw n

n Mn I

0,h n

otherwise

21,0.0

5021,2107886.0215842.0

50,7.81102.04.0

A

AAA

AA

837

2.285

AM

w

10

3:

0.2 20log 60s p

step

w w w A

Page 112: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

112

1 22

0

0

1sin

, 0c

I nw n

h n n Mn I

Ex. 7.8 Kaiser Window Design of a Lowpass Filter

Page 113: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

113

7.3 Examples of FIR Filters Design by the Kaiser Window

MethodThe ideal highpass filter with

generalized linear phase

wwe

wweH

cMjw

cjwhp ,

,02

jwlp

Mjwjwhp eHeeH 2

nMn

Mnw

Mn

Mnnh c

hp ,2

2sin

2

2sin

hph n h n w n

Page 114: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

114

Example 7.9 Kaiser Window Design of a Highpass Filter

Specifications:

wweH

wweH

pjw

sjw

,11

,

11

2

021.0,5.0,35.0 211 ps wwwhere

24,6.2 M

By Kaiser window method

Page 115: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

115

Example 7.9 Kaiser Window Design of a Highpass Filter

Specifications:

wweH

wweH

pjw

sjw

,11

,

11

2

021.0,5.0,35.0 211 ps wwwhere

24,6.2 M

By Kaiser window method

Page 116: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

116

7.3.2 Discrete-Time Differentiator

wejweH Mjwjwdiff ,2

nMn

Mn

Mn

Mnnhdiff ,

2

2sin

2

2cos2

nwnhnh diff

phaselineardgeneralizeIVtypeorIIItypenMhnh :

Page 117: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

117

Example 7.10 Kaiser Window Design of a Differentiator

Since kaiser’s formulas were developed for frequency responses with simple magnitude discontinuities, it is not straightforward to apply them to differentiators.

Suppose 4.210 M

Page 118: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

118

Group Delay

Phase:

Group Delay:

25

22

ww

M

samplesM

52

Page 119: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

119

Group Delay

Phase:

Group Delay:

Noninteger delay

22

5

22

ww

M

samplesM

2

5

2

Page 120: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

120

7.4 Optimum Approximations of FIR Filters

Goal: Design a ‘best’ filter for a given MIn designing a causal type I linear phase

FIR filter, it is convenient first to consider the design of a zero phase filter.

Then insert a delay sufficient to make it causal.

nhnh ee

Page 121: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

121

7.4 Optimum Approximations of FIR Filters

nhnh ee

2, MLenheAL

Ln

jwne

jwe

functionperiodicevenrealwnnhheAL

nee

jwe ,,:cos20

1

.2 samplesMLbyitdelaying

bynhfromobtainedbecansystemcausalA e

nMhMnhnh e 2

2Mjwjwe

jw eeAeH

Page 122: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

122

7.4 Optimum Approximations of FIR Filters

Designing a filter to meet these specifications is to find the (L+1) impulse response values

Lnnhe 0,

In Packs-McClellan algorithm,

is fixed, and is variable. 21,,, andwwL sp

21 or

Packs-McClellan algorithm is the dominant method for optimum design of FIR filters.

Page 123: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

123

7.4 Optimum Approximations of FIR Filters

wnwTwn n coscoscoscoscos 1 1coscos0coscos0cos 1

0 wwTw

wwwTw coscoscos1coscos1cos 11

1cos2cos2cos 22 wwTw

wTwTw

wTwn

nn

n

coscoscos2

coscos

21

wwwww

wwww

cos3cos4cos1cos2cos2

cos2coscos23cos32

Page 124: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

124

7.4 Optimum Approximations of FIR Filters

L

k

kk

wx

L

k

kk

L

nee

jwe

xaxPwhere

xPwawnnhheA

0

cos01

coscos20

functionweightingtheiswWwhere

eAeHwWwE

functionerrorionapproximatanDefinejw

ejw

d

Page 125: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

125

7.4 Optimum Approximations of FIR Filters

ww

wweH

s

pjwd ,0

0,1

ww

wwKwW

s

p

,1

0,1

1

2

Page 126: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

126

Minimax criterion

Within the frequency interval of the passband and stopband, we seek a frequency response that minimizes the maximum weighted approximation error of

jwe eA

jwe

jwd eAeHwWwE

wE

FwLnnhe maxmin

0:

Page 127: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

127

Other criterions

00:1 min dwwEH

Lnnhe

0

2

0:2 min dwwEH

Lnnhe

wEH

FwLnnhe maxmin0:

Page 128: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

128

Let denote the closet subset consisting of the disjoint union of closed subsets of the real axis x.

Alternation Theorem

pF

is an r th-order polynomial.

r

k

kk xaxP

0

denotes a given desired function of x that is continuous on

xDP

pF is a positive function, continuous on pF xWP

The weighted error is xPxDxWxE PPP

xEE PFx P

max

The maximum error is defined as

Page 129: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

129

Alternation Theorem

A necessary and sufficient condition that be the unique rth-order polynomial that minimizes is that exhibit at least (r+2) alternations; i.e., there must exist at least (r+2) values in such that

xPE xEP

ix PF

221 rxxx

ExExE iPiP 1

1,,2,1 ri

and such that

for

Page 130: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

130

Example 7.11 Alternation Theorem and Polynomials

Each of these polynomials is of fifth order.

The closed subsets of the real axis x referred to in the theorem are the regions

11.01.01 xandx

1xWP

Page 131: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

131

7.4.1 Optimal Type I Lowpass Filters

For Type I lowpass filter

The desired lowpass frequency response

Weighting function

L

k

kk wawP

0

coscos

wwww

wwwwwD

ss

ppp coscos1,0

01coscos,1cos

wwww

wwwwKwW

ss

ppp

coscos1,1

01coscos,1

cos

Page 132: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

132

7.4.1 Optimal Type I Lowpass Filters

The weighted approximation error is

The closed subset is

or

wPwDwWwE PPP coscoscoscos

wwandww sp0

sp wwandww cos11coscos

xEP

Page 133: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

133

7.4.1 Optimal Type I Lowpass Filters

The alternation theorem states that a set of coefficients will correspond to the filter representing the unique best approximation to the ideal lowpass filter with the ratio fixed at K and with passband and stopband edge and if and only if exhibits at least (L+2) alternations on , i.e., if and only if alternately equals plus and minus its maximum value at least (L+2) times.

Such approximations are called equiripple approximations.

ka

21

pwsw )(coswEP

PF

)(coswEP

Page 134: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

134

7.4.1 Optimal Type I Lowpass Filters

The alternation theorem states that the optimum filter must have a minimum of (L+2) alternations, but does not exclude the possibility of more than (L+2) alternations.

In fact, for a lowpass filter, the maximum possible number of alternations is (L+3).

Page 135: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

135

7.4.1 Optimal Type I Lowpass Filters

Because all of the filters satisfy the alternation theorem for L=7 and for the same value of , it follows that and/or must be different for each ,since the alternation theorem states that the optimum filter under the conditions of the theorem is unique.

21 K

pwsw

Page 136: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

136

Property for type I lowpass filters from the alternation

theorem

The maximum possible number of alternations of the error is (L+3)

Alternations will always occur at andAll points with zero slop inside the

passband and all points with zero slop inside stopband will correspond to alternations; i.e., the filter will be equiripple, except possibly at and

pw sw

0w

w

Page 137: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

137

7.4.2 Optimal Type II Lowpass Filters

For Type II causal FIR filter:The filter length (M+1) is even, ie, M is oddImpulse response is symmetricThe frequency response is

Mnnh 0

nhnMh

21,,2,1,212

2

1cos

2cos2

21

1

2

21

0

2

MnnMhnbwhere

nwnbe

nM

wnheeH

M

n

Mjw

M

n

Mjwjw

Page 138: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

138

7.4.2 Optimal Type II Lowpass Filters

21

0

21

1

cos~

2cos2

1cos

M

n

M

n

wnnbwnwnb

wPweeH Mjwjw cos2cos2

21cos0

MLandwawPwhereL

k

kk

nMhnbnbnbafind k 212~

Page 139: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

139

7.4.2 Optimal Type II Lowpass Filters

For Type II lowpass filter,

ww

wwwwDeH

s

pP

jwd

,0

0,2cos

1cos

ww

wwK

wwWwW

s

pP

,2cos

0,2cos

cos

Page 140: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

140

7.4.3 The Park-McClellan Algorithm

From the alternation theorem, the optimum filter will satisfy the set of equation

2,,2,11 1 LieAeHwW ijwe

jwd

jwe eA

ii

jwd

jwd

jwd

L

LLLLL

L

L

wxwhere

eH

eH

eH

a

a

wWxxx

wWxxx

wWxxx

L

cos

11

11

11

2

2

1

1

0

2

2

22

22

22

222

11

211

Page 141: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

141

7.4.3 The Park-McClellan Algorithm

Guessing a set of alternation frequencies

2

12

1

1

2

1 cos,1

1

L

kii

iiik

kL

k k

kk

L

k

jwdk

wxxx

bwhere

wW

b

eHb k

2,,2,1 Liforwi slpl wwww 1,and

Page 142: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

142

7.4.3 The Park-McClellan Algorithm

2

1

1

1

1

1

1

1

cos,cos

Lkk

L

kii ik

k

kkL

kkk

k

L

kkk

jwe

xxbxx

d

wxxxxd

CxxdwPeA

Page 143: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

143

7.4.3 The Park-McClellan Algorithm

For equiripple lowpass approximation

Filter length: (M+1)

ps wwwwherew

M

324.2

13log10 2110

Page 144: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

144

7.5 Examples of FIR Equiripple Approximation

7.5.1 Lowpass Filter

weH

weH

jw

jw

6.0,001.0

4.0,01.199.0

26M

wweA

wweA

wW

wEwE

errorionapproximatunweighted

sjw

e

pjw

eA

,0

0,1

Page 145: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

145

Comments

M=26, Type I filterThe minimum number of

alternations is (L+2)=(M/2+2)=157 alternations in passband and 8

alternations in stopbandThe maximum error in passband and

stopband are 0.0116 and 0.0016, which exceed the specifications.

Page 146: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

146

7.5.1 Lowpass Filter

M=27, , Type II filter, zero at z=-1The maximum error in passband and

stopband are 0.0092 and 0.00092, which exceed the specifications.

The minimum number of alternations is (L+2)=(M-1)/2+2=15

7 alternations in passband and 8 alternations in stopband

w

Page 147: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

147

Comparison

Kaiser window method require M=38 to meet or exceed the specifications.

Park-McClellan method require M=27Window method produce

approximately equal maximum error in passband and stopband.

Park-McClellan method can weight the error differently.

Page 148: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

148

7.6 Comments on IIR and FIR Discrete-Time Filters

What type of system is best, IIR or FIR?

Why give so many different design methods?

Which method yields the best result?

Page 149: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

149

7.6 Comments on IIR and FIR Discrete-Time Filters

Closed-Form

Formulas

Generalized Linear Phase

Order

IIR Yes No Low

FIR No Yes High

Page 150: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

150

7.2.1 Properties of Commonly Used Windows

Their Fourier transforms are concentrated around

They have a simple functional form that allows them to be computed easily.

0w

The Fourier transform of the Bartlett window can be expressed as a product of Fourier transforms of rectangular windows.

The Fourier transforms of the other windows can be expressed as sums of frequency-shifted Fourier transforms of rectangular windows.(Problem7.34)

Page 151: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

151

Homework

Simulate the frequency response (magnitude and phase) for Rectangular, Bartlett, Hanning, Hamming, and Blackman window with M=21 and M=51

Page 152: 12015-9-171Zhongguo Liu_Biomedical Engineering_Shandong Univ. Biomedical Signal processing Chapter 7 Filter Design Techniques Zhongguo Liu Biomedical.

152

23/4/19152Zhongguo Liu_Biomedical Engineering_Shandong U

niv.

Chapter 5 HW7.2, 7.4, 7.15,

上一页 下一页返 回