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

Preview:

Citation preview

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

Applications

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

FIR Filter Design Methods

Windows Frequency-sampling

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

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]

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

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

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

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

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

]

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

]

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]

Example

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

2

1sinc

Mnnh ccd

2

110

M

nMn

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(ω)

Other windows

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

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)

Spectrum of Hanning window

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)

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)

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)

Windows’ characteristics

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)

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)

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)

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)

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)

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

Recommended