Professional Documents
Culture Documents
'
.
5-2
The last equation can also be rewritten as
[ ] [ ] [ ]
d R
h n h n w n
where
1 0
[ ]
0 otherwise
R
n M
w n
'
where ( )
j
W e
is the Fourier Transform (FT) of [ ] w n .
5-3
Example: When [ ] [ ]
R
w n w n
, i.e. a rectangular window,
( )
[ ]
( )
( )
0
0
/ 2
[ ]
sin ( 1) / 2
sin / 2
M
j j n
n
M
j n
n
j M
j
R
W e w n e
e
M
e
W e
A plot of ( )
j
R
W e
when M = 7 is shown below. Also shown is the
convolution of an ideal low pass spectrum with ( )
j
R
W e
.
5-4
The convolution in the frequency domain leads to a smearing of the
spectrum. The sinusoidal nature of the sinc function in ( )
j
R
W e
leads to
the oscillations in ( )
j
H e
- the Gibbs phenomenon.
To reduce the smearing and oscillations, we should use a windowing
function whose ( )
j
W e
has a (relatively)
1. narrow mainlobe, and
2. low sidelobes
Note that
5-5
1. the longer the windowing function (in the time domain), the narrower
is the main lobe, and
2. the smoother the windowing function (in the time domain), the
lower the sidelobes.
It is clear that when M is fixed, we have conflicting requirements.
Raised Cosine family of windows
Many commonly used windowing functions can be written in the general
form
2 4
[ ] cos cos ; 0
n n
w n a b c n M
M M
_ _
+ +
, ,
.
(a) Rectangular window
1, 0, 0 a b c
(b) Hanning window
0.5, 0.5, 0 a b c
(c) Hamming window
0.54, 0.46, 0 a b c
(d) Blackman window
0.42, 0.5, 0.08 a b c
5-6
Example: The FT of the Hanning window is
( )
{ }
0
0 0
2 / 2 /
0 0
( 2 / ) ( 2 / )
0 0 0
1
2
[ ]
1 1 2
cos
2 2
1 1
2 4
1 1 1
2 4 4
M
j j n
n
M M
j n j n
n n
M M
j n j n M j n M j n
n n
M M M
j n j M n j M n
n n n
W e w n e
n
e e
M
e e e e
e e e
_
+
,
+ +
+ +
( ) ( ) ( )
[ ]
( )
[ ]
[ ]
[ ]
[ ]
( 2 / ) ( 2 / )
1 1
4 4
/ 2 / 2
/ 2
sin ( 1) / 2 sin ( 2 / )( 1) / 2
1 1
2 sin / 2 4 sin ( 2 / ) / 2
sin ( 2 / )( 1) / 2 1
4 sin ( 2 / ) / 2
j j M j M
R R R
j M j M
j M
W e W e W e
M M M
e e
M
M M
e
M
+ +
+ +
+ +
+
where ( )
j
R
W e
is the FT of the rectangular window.
Barlett (triangular window):
2 / 0 / 2
[ ] 2 2 / / 2
0 otherwise
n M n M
w n n M M n M
<
'
'
.
This means (assuming M is even)
( )
{ }
{ }
( )
0
/ 2 1
( ) / 2
0
/ 2 1
/ 2 ( / 2 ) ( / 2 ) / 2
0
/ 2 1
/ 2 / 2
2
0
[ ]
[ ] [ /2]
[ ] [ /2]
2 [ ]cos [ /2]
M
j j n
n
M
j n j M n j M
n
M
j M j M n j M n j M
n
M
j M j M
M
n
W e w n e
w n e e w M e
e w n e e w M e
e w n n w M e
+ +
+ +
1 +
]
( )
( )
/ 2 1
/ 2
2
0
/ 2
[ / 2] 2 [ ]cos
M
j M
M
n
j M j
e
e w M w n n
e W e
1 +
' ;
]
where
( ) ( )
/ 2 1
2
0
[ / 2] 2 [ ]cos
M
j
M
e
n
W e w M w n n
1 +
]
where ( )
j
e
H e
is a real and even function in
.
Exercise: Shown that if both [ ] w n and
[ ]
d
h n
are linear phase, then
[ ] [ ] [ ]
d
h n h n w n
is also linear phase, i.e.
( ) ( )
/ 2 j j j M
e
H e A e e
where
( )
j
e
A e
is a real and even function in
1
]
'
,
where
2
cos
0
0
1
( )
2
x
I x e d
1
1
]
.
As shown in the figure below,
n
x
increases monotonically from 0 to 1 in
the interval 0 n and decreases monotonically from 1 to 0 in the
interval n M . Consequently, [ ] w n is largest at
n
but decreases
monotonically on ether sides of this maxima.
When 0 ,
[ ] 1 w n
for all values of n. In other word, the Kaiser window
at this value of degenerates into a rectangular window.
5-15
Plot of Kaiser windows in the time and frequency domains.
5-16
It is observed that:
1. the Kaiser windows have linear phase, and
2. the larger is, the smoother is the windowing function. This implies a
wider mainlobe but lower sidelobes.
The relationships between Kaiser windows and other windows are shown
in the table on pp 2-7.
Design guidelines using Kaiser windows
- Assume a low pass filter .
- Given that Kaiser windows have linear phase, we will only focus on the
function ( )
j
e
A e
in the approximation filter ( )
j
H e
and the term
( )
j
e
H e
in the ideal low pass filter
( )
j
d
H e
.
- Normalize ( )
j
e
H e
to unity for
0
c
, where
c
is the cutoff
frequency of the ideal low pass filter.
- Specify ( )
j
e
A e
in terms of a passband frequency
p
, a stop band
frequency
s
of the
ideal low pass filter is midway between
p
and
s
, (2)
1
should equal
to
2
because of the nature of windowing.
5-17
- Let
s p
,
1 2
,
and
10
20log A
.
Then choose
and M according to
0.4
0.1102( 8.7) 50
0.5842( 21) 0.07886( 21) 21 50
0 <21
A A
A A A
A
>
+
'
and
8
2.285
A
M
5-18
Example: Determine
c
, , and M when
0.4
p
,
0.6
s
, and
1 2
0.001
.
Solution:
Since
10
20log 60 A
, this means
0.1102(60 8.7) 5.6533 .
Since
0.2
s p
and 60 A ,
60 8
36.22 37
2.285 0.2
M
'
1
0.3 0.7
1 +
5-20
- The width of each of the two transition bands in ( )
j
e
A e
is governed by
8
0.1031
2.285
A
M
This means the stopband frequencies are
1
2
0.3 0.1031 / 2 0.2485
0.7 0.1031 / 2 0.7516
s
s
+
and the passband frequencies are
1
2
0.3 0.1031 / 2 0.3516
0.7 0.1031 / 2 0.6485
p
p
+
In general, any ideal multiband filter can be expressed as a weighted sum
of ideal low pass signals of different frequencies, i.e.
( )
/ 2
1
sin ( /2)
[ ]
( /2)
N
k j M
d k
k
n M
h n e w
n M
where is the peak distortion when the Kaiser window is applied to each
individual ideal low pass signal.
5-21
5.2 The Park-McClellan Algorithm
The windowing method of FIR filter design is straight forward. However,
the technique has 2 disadvantages:
1. distortion in the passband and the stopband are more or less equal, and
2. distortion is usually largest at the discontinuities of the ideal frequency
response.
Very often, we want to design a filter with different passband and stopband
distortions.
In addition, if the distortion is more evenly spread, we will be able to come
up with a shorter FIR filter.
The Park-McClellan algorithm is an iterative procedure for designing an
equi-ripple FIR filter with different distortion in the pass and stop bands.
We will focus our attention on the design of low pass filters of length
2 M L
using this method.
The design of low pass filters with an odd value of M, as well as the design
of other types of filters (such as bandpass, highpass, etc), require some
modifications to the procedure to be described.
5-22
We assume the desired response
( )
j
d
H e
has linear phase. This is achieved
when the desired impulse response, [ ]
d
h n , is symmetrical about / 2 n M ,
i.e.
[ ] [ ]
d d
h n h M n
Given that
( )
j
d
H e
has linear phase, we will focus on its zero-phase
equivalent,
( )
j
e
H e
, in the discussion. This function is a real and even in
.
We impose the condition that the approximation filter
( )
j
H e
also has linear
phase. This means the approximated impulse response [ ] h n satisfies
[ ] [ ] h n h M n
,
and the zero-phase equivalent of
( )
j
H e
is
( ) ( )
[ ]
[ ]
[ ]
/ 2 1
2
0
1
1
1
[ / 2] 2 [ ]cos
[ ] 2 [ ]cos
[0] 2 [ ]cos
[0] 2 [ ]cos
M
j
M
e
n
m L
e e
m L
L
e e
n
A e h M w n n
h L w m L m
a a m m
a a n n
1 +
]
+ +
+
+
where
[ ] [ ]
e
a n h n L +
is a non-casual signal symmetrical about 0 n .
5-23
The term ( ) cos n
can be written as a polynomial of degree n in ( )
cos
.
For example, ( ) ( )
2
cos 2 2cos 1
, and ( ) ( ) ( )
3
cos 3 4cos 3cos , etc.
This means the zero-phase response ( )
j
e
A e
can be written as a L-th order
polynomial in ( )
cos
:
( ) ( )
0
cos( )
L
k
j
e k
k
A e a
where the
k
a
s are the coefficients in this polynomial respresention.
The Park-McCelland algorithm allows us to find the optimal ( )
j
e
A e
(i.e.
the coefficients
k
a
in the polynomial representation) for fixed L,
p
,
s
,
and
1
2
K
.
The distortion,
1
(or
2
'
,
with
1 2 2 L
+
< < < L
,
such that
( ) ( )
1
1
i
i
E
+
(equiripple)
where is the minimum peak distortion. Note that both the pass band
frequency
p
belong to , and if
k p
,
then
1 k s
+
.
The Park-McClelland algorithm uses an iterative procedure to find the set
of extremal frequencies.
1. At the start of the algorithm, guess the the locations of the L+2 extremal
frequencies. Call these frequencies
; 1,2,..., 2
k
k L +
.
2. Define
k
x
as
( )
cos
k k
x
3. Use (7.101) and (7.102) to obtain
j
e
A e
, an estimate of ( )
j
e
A e
. This function
has the characteristics
( )
1 /
k
k p j
e
k s
K
A e
'
t
.
5. Locate the local maxima in
( ) ( ) ( ) { }
( )
j j
e e
E W H e A e
where
( ) E
. If there are more than 2 L + such maxima (
p
and
s
s, update the
s using
these frequencies and go back to Step 2. If not, declare that the optimal
solution has been found. In this case, make
k k
,
, and
( ) ( )
j j
e e
A e A e
,
where [ ] h n is the impulse response of the filter, and
0
( ) [ ]
M
k
k
H z h k z
represents a delay of 1
sample. On the other hand, a branch with a transmittance of [ ] h k means the
signal at the originating node of that branch is multiplied by the constant
[ ] h k . Again, as in any signal flow graph, the signal at a node is the sum of
the product of the signal at an originating node and the corresponding
branch transmittance.
The transfer function ( ) H z of a FIR filter can be expressed in terms of its
zeros according to the following equation
( ) ( )( )
1 2
1 1 * 1
1 1
( ) 1 1 1
M M
k k k
k k
H z C f z g z g z
Here the
k
f
s are the real zeros and the
k
g
s are the complex zeros. The
parameter C is a constant.
The complex zeros will always appear in conjugate pairs (as long as the
impulse response is real). Moreover, ( ) ( )
1 * 1
1 1
k k
g z g z
is a 2
nd
order
polynoimal in
1
z