1 bien425 – lecture 10 by the end of the lecture, you should be able to: –describe the reason...

16
1 BIEN425 – Lecture 10 By the end of the lecture, you should be able to: Describe the reason and remedy of DFT leakage Design and implement FIR filters using rectangular, Hanning, Hamming and Blackman windowing methods

Upload: brook-griffin

Post on 01-Jan-2016

213 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 1 BIEN425 – Lecture 10 By the end of the lecture, you should be able to: –Describe the reason and remedy of DFT leakage –Design and implement FIR filters

1

BIEN425 – Lecture 10

• By the end of the lecture, you should be able to:– Describe the reason and remedy of DFT leakage – Design and implement FIR filters using rectangular,

Hanning, Hamming and Blackman windowing methods

Page 2: 1 BIEN425 – Lecture 10 By the end of the lecture, you should be able to: –Describe the reason and remedy of DFT leakage –Design and implement FIR filters

2

DFT leakage

• Leakage occurs because the DFT X(i) produces accurate results only when input data has energy precisely at discrete analysis frequencies given by ifs/N.

• What happens if input signal has component at intermediate frequencies?

• This is due to correlation between two waves, one of which does not have an integral number of cycles in N points; therefore the sum for the correlation computation is not zero.

Page 3: 1 BIEN425 – Lecture 10 By the end of the lecture, you should be able to: –Describe the reason and remedy of DFT leakage –Design and implement FIR filters

3

• Recall the convolution theorem, notice that when we sample we not only multiply by an impulse train but also by a rectangular window.

• We previous stated that our discrete frequency spectrum is the convolution of an impulse train with the TRUE frequency spectrum of our signal

• In reality, we are taking the convolution of an impulse train with the frequency spectrum of a rectangular function - the result of this is then convolved with the TRUE frequency spectrum of our signal.

Page 4: 1 BIEN425 – Lecture 10 By the end of the lecture, you should be able to: –Describe the reason and remedy of DFT leakage –Design and implement FIR filters

4

Why rectangular windows?

Page 5: 1 BIEN425 – Lecture 10 By the end of the lecture, you should be able to: –Describe the reason and remedy of DFT leakage –Design and implement FIR filters

5

Spectrum of rectangular window

• For N points and window (unit value) length of K, we can obtain the frequency spectrum which takes the form of Dirichlet Kernel (Lecture10.m)

First zero of the mainlobe occurs at n = N/K.

Mainlobe

Page 6: 1 BIEN425 – Lecture 10 By the end of the lecture, you should be able to: –Describe the reason and remedy of DFT leakage –Design and implement FIR filters

6

• When we do a DFT, we convolve the Dirichlet kernel with the impulse train. Instead of getting spikes for pure sinusoids, we get leakages.

• To deal with this problem, we typically use a window with a different Fourier transform than the rectangle. This is also known as apodization, which literally means “chop the feet off.” This expression refers to the reduction of the magnitude of sidelobes in the window frequency spectrum.

• Matlab example

Page 7: 1 BIEN425 – Lecture 10 By the end of the lecture, you should be able to: –Describe the reason and remedy of DFT leakage –Design and implement FIR filters

7

Some windows

Page 8: 1 BIEN425 – Lecture 10 By the end of the lecture, you should be able to: –Describe the reason and remedy of DFT leakage –Design and implement FIR filters

8

• Filter transfer function can be re-written as:

• First we determine h(i) based on our filter specs, then we decide the windows w(i)

Page 9: 1 BIEN425 – Lecture 10 By the end of the lecture, you should be able to: –Describe the reason and remedy of DFT leakage –Design and implement FIR filters

9

Finding h(i)

• Type 1 and Type 2: In general, given a m-th order linear phase filter exhibiting even-symmetric about i=m/2, with group delay =mT/2

Page 10: 1 BIEN425 – Lecture 10 By the end of the lecture, you should be able to: –Describe the reason and remedy of DFT leakage –Design and implement FIR filters

10

• Similarly for Type 3 and 4 linear phase filters:

• To find h(i), simply insert the right form of Ar(f) based on the filter characteristics into the correct equation.

Page 11: 1 BIEN425 – Lecture 10 By the end of the lecture, you should be able to: –Describe the reason and remedy of DFT leakage –Design and implement FIR filters

11

• In general, for Type 1 linear-phase filter with order m=2p, h(k) can be written as follows

Page 12: 1 BIEN425 – Lecture 10 By the end of the lecture, you should be able to: –Describe the reason and remedy of DFT leakage –Design and implement FIR filters

12

Example

Page 13: 1 BIEN425 – Lecture 10 By the end of the lecture, you should be able to: –Describe the reason and remedy of DFT leakage –Design and implement FIR filters

13

General strategy (ideal)

• Pick m• Pick a window w(i)• Pick a Type 1 ideal impulse response h(i) from

Table 6.1

• Compute bi = w(i)h(i)

• Compute H(z)

m

i

iizbzH

0

)(

Page 14: 1 BIEN425 – Lecture 10 By the end of the lecture, you should be able to: –Describe the reason and remedy of DFT leakage –Design and implement FIR filters

14

Example

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

20Lowpass filter using Hanning window

f/fs

A(f

) (d

B)

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

20Lowpass filter using Blackman window

f/fs

A(f

) (d

B)

Page 15: 1 BIEN425 – Lecture 10 By the end of the lecture, you should be able to: –Describe the reason and remedy of DFT leakage –Design and implement FIR filters

15

Comparing windows

• For a general m-th order FIR low pass filter, we compare the transition bandwidth, passband ripple and stopband attenuation

Transition bandwidth(|Fs-Fp|/fs)

Passband rippleAp (dB)

Stopband attenuation

As (dB)

Rectangular 0.9/m 0.742 21Hanning 3.1/m 0.055 44Hamming 3.3/m 0.019 53Blackman 5.5/m 0.0015 75.4

Page 16: 1 BIEN425 – Lecture 10 By the end of the lecture, you should be able to: –Describe the reason and remedy of DFT leakage –Design and implement FIR filters

16

General strategy (non-ideal)

• Pick m• Pick a window w(i)

• Pick Ar(f)

• Compute bi = w(i)h(i) based on your filter type (1-4)– For Type 1 and 2

– For Type 3 and 4

• Compute H(z)

m

i

iizbzH

0

)(