686 C H A P T E R 11: Introduction to the Design of Discrete Filters
The desired impulse response is thus
hd[n]=
1
2 π
∫π
−π
Hd(ejω)ejωndω=
1
2 π
∫π/^4
−π/ 4
ejωndω
=
{
sin(πn/ 4 )/(πn) n6= 0
0.25 n= 0
Using a rectangular window, the FIR filter is then of the form (the delay is(N− 1 )/ 2 =10)
Hˆ(z)=Hw(z)z−^10 =
∑^20
n= 0
hd[n−10]z−n
=0.25z−^10 +
∑^20
n=0,n6= 10
sin(π(n− 10 )/ 4 )
π(n− 10 )
z−n
The magnitude and the phase of this filter are shown in Figure 11.23 when we use a rectangular
and a Hamming window.
The magnitude and the phase responses of the filter designed using the Hamming window is much
improved over the one obtained using the rectangular window. Notice that the second lobe in the
stopband for the Hamming window design is at about−50 dB while for the rectangular window
design it is at about−20 dB, a significant difference. In both cases, the phase response is linear
in the passband of the filter, corresponding to the impulse responseh[n] being symmetric with
respect to the(N− 1 )/ 2 =10 sample. n
nExample 11.13
Design a high-pass filter of order 14 and a cut-off frequency of 0.2πusing the Kaiser window. Use
MATLAB.
Solution
Lethlp[n] be the impulse response of an ideal low-pass filter:
Hlp(ejω)=
{
1 −ωc≤ω≤ωc
0 otherwise in [−π,π)
According to the modulation property of the DTFT, we have that
2 hlp[n] cos(ω 0 n) ⇔ Hlp(ej(ω+ω^0 ))+Hlp(ej(ω−ω^0 ))
If we letω 0 =π, then the right term gives a high-pass filter, and sohhp[n]= 2 hlp[n] cos(πn)=
2 (− 1 )nhlp[n] is the desired impulse response of the high-pass filter. The following script shows
how to use the functionfirto design the high-pass filter.