digital filters: design of fir filters lecture 23-24 احسان احمد عرساڻي

29
DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 ي ڻ رسا ع مد ح ا سان ح ا

Upload: kevin-harris

Post on 26-Mar-2015

227 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

DIGITAL FILTERS: DESIGN OF FIR FILTERS

Lecture 23-24 عرساڻي احمد احسان

Page 2: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

Introduction to FIR filters

These have linear phase No feedback Output is function of the present and past

inputs only These are also called ‘all-zero’ and ‘non-

recursive’ filters These do not have any poles 1....1 110 Mnxbnxbnxbny M

1

0

M

kk knxbny

1

0

M

k

kzkhzH

Page 3: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

Applications

Where: highly linear phase response is required Need to avoid complicated design

Page 4: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

FIR Filter Design Methods

Windows Frequency-sampling

Page 5: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

FIR Filter Design: Windows Method

0n

njdd enhH

Start from the desired frequency response Hd(ω)

Determine the unit (sample) pulse reponse

hd(n)=F-1{Hd(ω)} hd(n) is generally

infinite in length Truncate hd(n) to a

finite length M

deHnh njdd 2

1

Page 6: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

Truncating hd(n)

Take only M terms N=0 to N=M-1

Remove all others

0 20 40 60 80 100-0.04

-0.02

0

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0.16

nhd

[n]

Page 7: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

0 20 40 60 80 100-0.04

-0.02

0

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0.16

n

hd[n

]

Truncating hd(n)

Take only M terms N=0 to N=M-1

Remove all others Multiplying hd(n)

with a rectangular window

elsewhere

Mnnw

0

01

nwnhnh d

Page 8: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

Determine H(ω)

Take Fourier transform of h(n)

Therefore, compute: Hd(ω) and W(ω)

Hd(ω) depends on the required response hd(n)

nwnhnh d

nwnhFnhF d

nwFnhFnhF d

WHH d

dvvWvHH d2

1

Page 9: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

Computing W(ω)

W(ω)=F{w(n)} w(n) is a

rectangular pulse

0n

njenwW

1

0

M

n

njenwW

j

Mj

e

eW

1

1

2/sin

2/sin2/1

M

eW Mj

Page 10: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

Example

otherwise

eH c

Mj

d0

02/1

A low-pass linear

phase FIR filter with the frequency response Hd(ω) is required

Hd(n) happens to be non-causal having infinite duration

deHnh njdd 2

1

2

1sinc

2

Mnnh cc

d

2

1

2121

sin

M

nM

n

Mnc

Page 11: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

The impulse response hd(n)

0 20 40 60 80 100-0.04

-0.02

0

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0.16

n

hd[n

]

Page 12: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

Windowing the hd(n)

0 20 40 60 80 100

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

n

hd[n

]

Page 13: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

The truncated hd(n)

0 20 40 60 80 100-0.04

-0.02

0

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0.16

n

h[n]

Page 14: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

Example

A low-pass linear phase FIR filter with the frequency response Hd(ω) is required

2

1sinc

Mnnh ccd

2

110

M

nMn

Page 15: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

Frequency of oscilation increases with M

Magnitude of oscillation doesn’t increase or decrease with M

Oscillations occur due to the Gibbs phenonmenon caused by the multipli-cation of the rectangular window with Hd(ω)

Page 16: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

Other windows

Page 17: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

Other windows

0 10 20 30 40 50 600

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

KaiserHammingHanningBartlettBlackmanTukeyLanczos

Page 18: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

Spectrum of Kaiser window

0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5-140

-120

-100

-80

-60

-40

-20

0

Normalized frequency

Mag

nitu

de (

dB)

M=61M=31

(Cycles per sample)

Page 19: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

Spectrum of Hanning window

Page 20: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

Spectrum of Hamming Window

0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5-120

-100

-80

-60

-40

-20

0

Normalized frequency

Mag

nitu

de (

dB)

M=61M=31

(Cycles per sample)

Page 21: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

Spectrum of Blackman Window

0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5-350

-300

-250

-200

-150

-100

-50

0

Normalized frequency

Mag

nitu

de (

dB)

M=61M=31

(Cycles per sample)

Page 22: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

Spectrum of Tukey Window

0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5-350

-300

-250

-200

-150

-100

-50

0

Normalized frequency

Mag

nitu

de (

dB)

M=61M=31

(Cycles per sample)

Page 23: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

Windows’ characteristics

Page 24: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

The FIR filter’s response with Rectangular window

M=61

0 0.5 1 1.5 2 2.5 3

-90

-80

-70

-60

-50

-40

-30

-20

-10

0

Normalized frequency

Mag

nitu

de (

dB)

Page 25: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

FIR filter’s response with Hamming window

M=61

0 0.5 1 1.5 2 2.5 3-120

-100

-80

-60

-40

-20

0

w

Mag

nitu

de (

dB)

Page 26: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

FIR filter’s response with Blackman window

M=61

0 0.5 1 1.5 2 2.5 3

-150

-100

-50

0

wn

Mag

nitu

de (

dB)

Page 27: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

FIR filter’s response with Kaiser window

M=61

0 0.5 1 1.5 2 2.5 3

-100

-80

-60

-40

-20

0

wn

Mag

nitu

de (

dB)

Page 28: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

Using the FIR filter

-10 -8 -6 -4 -2 0 2 4 6 8 10

-0.5

-0.4

-0.3

-0.2

-0.1

0

0.1

0.2

0.3

0.4

0.5

t

x(t)

Page 29: DIGITAL FILTERS: DESIGN OF FIR FILTERS Lecture 23-24 احسان احمد عرساڻي

Blackman’s filter output

-15 -10 -5 0 5 10 15-2.5

-2

-1.5

-1

-0.5

0

0.5

1

1.5

2

2.5

t

y