lecture 22-26 - frequency sampling method

25
DIGITAL FILTER DESIGN: FREQUENCY SAMPLING METHOD ليڪچر22 کان26 Lectures 22-26 حمد عرساڻين احسا ا

Upload: sreenath-reddy

Post on 29-Nov-2014

60 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Lecture 22-26 - Frequency Sampling Method

DIGITAL FILTER DESIGN:FREQUENCY SAMPLING METHOD

احسان احمد عرساڻيLectures 22-26 26کان 22ليڪچر

Page 2: Lecture 22-26 - Frequency Sampling Method

Digital Signal Processing

A Practical Aproach

Second Edition

Emmanuel C. Ifeachor

Barrie W. Jervis

Chapter 7: FIR filter Design

Page 3: Lecture 22-26 - Frequency Sampling Method

Frequency Sampling Method

An alternate approach to Fourier Transform –Window method

The filter coefficients can be calculated based onthe specified magnitudes of the desired filterfrequency response, distributed uniformly infrequency domain

More flexibility

Page 4: Lecture 22-26 - Frequency Sampling Method

Freq. Samp. Method

Create an ideal specification of the filter in the frequency-domain

Take Inverse Discrete Fourier Transform to get the time-domain impulse response of the filter

Remember, in window method we took IDTFT, here we take the IDFT

Page 5: Lecture 22-26 - Frequency Sampling Method

Derivation

Suppose H(k) represents the sampled version of theideal magnitude response of the desired filter, so,h[n] i.e. IDFT of H(k), would represent its impulseresponse

Nknj

N

k

ekHN

nh2

1

0

)(1

][

Nkn

Nkn

N

k

jkHN

nh 22

1

0

sincos)(1

][

Page 6: Lecture 22-26 - Frequency Sampling Method

We have established that for linear phase response, werequire the impulse response to be symmetric (takingN as odd number)

Nkn

Nkn

k

jkHN

nh

N

22

0

sincos)(1

][2

1

Now, there is another issue with this equation

There is a possibility that h[n] may be complex, i.e. itmight include the real component & thequadrature (imaginary) component

Page 7: Lecture 22-26 - Frequency Sampling Method

To avoid the requirement of quadrature processing intime domain, we shall have to make sure that theimpulse response is real

This can only happen if

a) H(0) is real

b) H(k) = H*(N-k)

This concept is illustrated in the figure on next slide

Page 8: Lecture 22-26 - Frequency Sampling Method

Graph courtesy DSP by Ifeachor & Jervis, pp. 380

N = 15k = 0, 1, . . . , 14

Page 9: Lecture 22-26 - Frequency Sampling Method

Filter Design Steps

Given the filter length N, specify the magnitude frequency response for the normalized frequency range from 0 to Fs :

Calculate the FIR filter co-efficients

21,...,1,0 N-k

N

kFf s

k

2

1

1

)(2)0(cos)(2

1][

N

k

N

nkHkH

Nnh

2

1

N

Page 10: Lecture 22-26 - Frequency Sampling Method

Example: Design a low-pass FIR filter with the following specs using the frequency sampling method,

Pass band : 0-5 KHz

Sampling frequency : 18 KHz

filter length : 9

The ideal frequency response can be easily constructed

We need to sample it at

4,3,2,1,0 , 2 9

18 x kKHzkk

N

kFf s

k4

2

1

N

Page 11: Lecture 22-26 - Frequency Sampling Method

The pass-band edge frequency is 5 KHz, which would actually fall between frequency bins 2 & 3

k =2 → 4 Hz

k =3 → 6 Hz

We’ll choose k=3, since k=2 would mean that the component at 5 KHz would be stopped

|H(k)|

k10 2 3 4 5 6 7 8

Page 12: Lecture 22-26 - Frequency Sampling Method

009

422cos22

9

412cos120

9

1][

nH

nHHnh

for n = 0, 1, 2, 3, 4

4,30

2,1,01)(

k

kkH

9

44cos2

9

42cos21

9

1][

nnnh

Page 13: Lecture 22-26 - Frequency Sampling Method

for n = 0, 1, 2, 3, 4

0725.053.1879.119

1]0[ h

4,30

2,1,01)(

k

kkH

9

44cos2

9

42cos21

9

1][

nnnh

9

404cos2

9

402cos21

9

1]0[

h

9

16cos2

9

8cos21

9

1]0[

h

Page 14: Lecture 22-26 - Frequency Sampling Method

111.01119

1]1[ h

9

4222cos2

9

4212cos21

9

1]2[

h

059.0879.1347.019

1]2[ h

9

44cos2

9

42cos21

9

1][

nnnh

9

414cos2

9

412cos21

9

1]1[

h

9

12cos2

9

6cos21

9

1]1[

h

Page 15: Lecture 22-26 - Frequency Sampling Method

9

4322cos2

9

4312cos21

9

1]3[

h

31993.0347.0532.119

1]3[ h

9

4422cos2

9

4412cos21

9

1]4[

h

55.02219

1]4[ h

Page 16: Lecture 22-26 - Frequency Sampling Method

Using the symmetry property, we can find the remaining coeffs

55.0]4[ h

0723.0]8[]0[ hh

111.0]7[]1[ hh

059.0]6[]2[ hh

31993.0]5[]3[ hh

Page 17: Lecture 22-26 - Frequency Sampling Method

0 1000 2000 3000 4000 5000 6000 7000 8000 9000-600

-400

-200

0

Frequency (Hz)

Phase (

degre

es)

0 1000 2000 3000 4000 5000 6000 7000 8000 9000-60

-40

-20

0

20

Frequency (Hz)

Magnitude (

dB

)

Page 18: Lecture 22-26 - Frequency Sampling Method

Example: Design a FIR low-pass filter using the frequency sampling method, with the following spec

Pass band : 0-5 KHz

Sampling frequency : 18 KHz

filter length : 15

Solve it

Page 19: Lecture 22-26 - Frequency Sampling Method

Optimizing the amplitude resp.

From the graph for the previous example weobserved that there were large ripples in the stopband Gibbs effect, caused due to discontinuity

This is similar to what we observed in the FT-Wmethod when rectangular window was used

In that case we used a window function tosmoothen the discontinuity, trading it off with thetransition width

Page 20: Lecture 22-26 - Frequency Sampling Method

Graph courtesy DSP by Ifeachor & Jervis, pp. 384

Page 21: Lecture 22-26 - Frequency Sampling Method

For a lowpass filter, the stop-band attenuation

increases, approximately, by 20 dB for each

transition band bin (citing Rabiner’s work in 1970),

with a corresponding increase in the transition

width

Approx. stop-band attenuation : (25+20M) dB

Approx. transition width : (M+1)Fs/N

Where M = number of bins in transition band & N is the

length of the filter impulse response

Page 22: Lecture 22-26 - Frequency Sampling Method

The key to using transition width bins is to choose

their values properly, to get the required

attenuation & so that bins are not used

Rabiner, also went ahead and calculated some

optimized values of these transition width bins and

are given on next slide

} stopband in the w{

)()(maxminimize

},...,,{ 21

wHwHW d

TTT M

Page 23: Lecture 22-26 - Frequency Sampling Method

Graph courtesy DSP by Ifeachor & Jervis, pp. 384

Page 24: Lecture 22-26 - Frequency Sampling Method

Example: Design a FIR low-pass filter using the frequency sampling method, with the following spec

Pass band : 0-5 KHz

Sampling frequency : 18 KHz

filter length : 15

stop band attenuation : 42 dB

Solve it

Page 25: Lecture 22-26 - Frequency Sampling Method

Comparison of Filter Design Methods

Hd(ω)

Hd(ω)

or H(k)

Window based method Frequency sampling method

k

sampling

d HH thH d

F

d 1

KnnhkH DFT

0 1

nhnh truncate

d

Hnh DTFT

Hnh DTFT

nhth d

Sampling

d