Professional Documents
Culture Documents
FIR Filters
FIR Filters
H ( z ) b0 b1 z 1 bm z m .
H(ejw)
Example: Find the phase response of
1
H ( z ) (1 z ).
1
2
jw jw
H (e ) (1 e 1
2 ).
w ejw H(ejw) H(ejw)
0 1 1
2 (1 1) 0°
p/2 j
1
2 (1 j ) -45°
p -1 1
2 (1 1) *
-90°
0
H(e ), x p
jw
-0.25
-0.5
-0.75
0 0.25 0.5 0.75 1
w, x p
Frequency Response
0.25
0
H(e ), x p
jw
-0.25
-0.5
-0.75
0 0.25 0.5 0.75 1
w, x p
FIR filters do not always have linear phase. As an
example,
1
H ( z) z .
1
2
jw jw
H (e ) e 1
2 .
w ejw H(ejw) H(ejw)
0 1 1
2 1 0°
p/2 j
1
2 j -63°
p -1 1
2 1 -180°
Frequency Response
0.25
-0.25
H(e w), x p
-0.5
j
-0.75
-1
-1.25
0 0.25 0.5 0.75 1
w, x p
Now, let us find the criteria for an FIR filter to have
linear phase.
H ( z ) b0 b1 z 1.
H (e jw ) b0 b1e jw .
If b0 = b1 = b, we have
H (e jw ) b be jw
jw
b(1 e )
be jw / 2 (e jw / 2 e jw / 2 )
jw / 2
2be cos w2 .
The phase response of this filter is
jw w
H (e ) ,
2
H (e jw ) b be jw
jw
b(1 e )
be jw / 2 (e jw / 2 e jw / 2 )
jw / 2
2 jbe sin w2 .
The phase response is
jw w p
H (e )
2 2
As it turns out, as long as the coefficients are
symmetric (even or odd), the phase will be linear.
1
H ( z) 1 z .
1
H ( z) 1 z .
1 2 3
H ( z) 1 z z z .
1 2 3
H ( z) 1 z z z .
1 2 3
H ( z) 1 z z z .
1 2 3
H ( z) 1 2z 2z z .
1 2 3 4 5
H ( z ) 1 2 z 3z 3z 2 z z .
1 2 3 4
H ( z ) 1 2 z 3z 2 z z .
1 2 3 4
H ( z ) 1 2 z 3z 2 z z .
Exercise: For each of the previous examples, find
the (linear) relationship of phase to frequency
H(ejw).
Linear Phase and Group
Velocity
jw jf (w )
H (e ) e .
Suppose we pass a sinewave
x1 (t ) cos w1t
x2 (t ) cos w2t
x(t ) x1 (t ) x2 (t )
y (t ) y1 (t ) y2 (t )
cos(w1t f (w1 )) cos(w 2t f (w 2 )).
Now if the phase response is linear, i.e.,
f (w ) w,
y (t ) y1 (t ) y2 (t )
cos(w1t w1 ) cos(w 2t w2 )
cos(w1[t ]) cos(w 2 [t ])
x1 (t ) x2 (t ).
The filter effectively shifts different frequencies by
the same amount in time. If the filter shifted the
frequencies by different amounts in time (as it would
with non-linear phase), then the signals would be
delayed by different amounts and would not be
aligned at the output of the filter. Such a non-
aligned result is called dispersion.
w
wc wc
Let us take a periodic extension (in frequency
domain) of this function:
… … w
2p 2p
jw
H d (e ) c e
n
n
jnw
,
where
1 p
cn
2p p
H d (w )e jnw dw .
We can readily construct the z-transform transfer
function of this filter:
H d ( z) c z
n
n
n
.
1 p
p H
jnw
cn (w )e dw
2p
d
1 p /2
p
jnw
(1)e dw
2p /2
1 1 jnw p / 2
e
2p ( jn) p / 2
1 1
2p ( jn)
e
jnp / 2
e jnp / 2
1 np
sin .
pn 2
For a practical filter the summation in the Fourier
series cannot be infinite: we must truncate the
Fourier series to n=-r to r (where r is a finite integer):
r
H ( z) c
n r
n
n
z .
c5 z 5 c4 z 4 c3 z 3 c2 z 2 c1 z1
c0 z 0 c1 z 1 c 2 z 2 c3 z 3 c 4 z 4 c5 z 5
1 5 1 3 1 1 1 1 1 1 3 1 5
z z z z z z
5p 3p p 2 p 3p 5p
1.5
r = 20
r = 50
1
|H(e )|
jw
r=5
0.5
-0.5
-1 -0.5 0 0.5 1
w, x p
While the frequency response improves for higher
orders, you will notice that there is always “rippling”
at the transition (even for higher orders). This
“rippling” is called Gibbs phenomenon. This
“rippling” can be decreased by the application of
windows.
r
H ( z) w c
n r
n n
n
z .
We have several types of windows: Hamming, von-
Hann, or “Hanning,” Blackman, Kaiser. Such filters
are available through MATLAB via commands like
>> c = c.*win’;
The resultant filter coefficients cn will yield a filter
with decreased “rippling” at the transition. The
frequency plots for the previous filter with a
Hamming window applied are shown on the
following slide.
Frequency Response
2
1.5
r = 20
r = 50
1
|H(e )|
jw
r=5
0.5
-0.5
-1 -0.5 0 0.5 1
w, x p
The “rippling” is greatly reduced, but the steepness
of the frequency rolloff is decreased.
One last problem,
r
H ( z) c
n r
n z n
2r
c n r z . n
n 0
1 5 1 3 1 1 1 1 1 1 3 1 5
H ( z) z z z z z z
5p 3p p 2 p 3p 5p
1 1 2 1 4 1 5 1 6 1 8 1 10
H ' ( z) z z z z z z
5p 3p p 2 p 3p 5p