Document

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
1
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.
2
• 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.
3
Why rectangular windows?
4
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)
Mainlobe
First zero of the
mainlobe occurs
at n = N/K.
5
• 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
6
Some windows
7
• 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)
8
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 t=mT/2
9
• 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.
10
• In general, for Type 1 linear-phase filter with order
m=2p, h(k) can be written as follows
11
Example
12
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)
m
Compute H(z)
H ( z )   bi z i
i 0
13
Example
Lowpass filter using Hanning window
20
0
A(f) (dB)
-20
-40
-60
-80
-100
-120
0
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.45
0.5
0.4
0.45
0.5
f/fs
Lowpass filter using Blackman window
20
0
A(f) (dB)
-20
-40
-60
-80
-100
14
-120
0
0.05
0.1
0.15
0.2
0.25
f/fs
0.3
0.35
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
ripple
Ap (dB)
Stopband
attenuation
As (dB)
Rectangular
0.9/m
0.742
21
Hanning
3.1/m
0.055
44
Hamming
3.3/m
0.019
53
Blackman
5.5/m
0.0015
75.4
15
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
H ( z )   bi z i
i 0
16