682 C H A P T E R 11: Introduction to the Design of Discrete Filters
that causes the truncation ofhd[n]. The windowed impulse responsehw[n] has a discrete-time Fourier
transform of
Hw(ejω)=
(N∑− 1 )/ 2
n=−(N− 1 )/ 2
hw[n]e−jωn
For a large value ofNwe have thatHw(ejω)must be a good approximation ofHd(ejω)—that is,
|Hw(ejω)|≈|Hd(ejω)|
∠Hw(ejω)=∠Hd(ejω)= 0
It is not clear how the value ofNshould be chosen—this is what we meant by this design is a
trial-and-error method.
To makeHw(z)a causal filter, we shift to the right the impulse responsehw[n] by(N− 1 )/2 (assume
N is chosen to be an odd number so that this division is an integer) samples to obtain
Hˆ(z)=Hw(z)z−(N−^1 )/^2 =
(N∑− 1 )/ 2
m=−(N− 1 )/ 2
hw[m]z−(m+(N−^1 )/^2 )
=
N∑− 1
n= 0
hd[n−(N− 1 )/ 2 )]w[n−(N− 1 )/ 2 )]z−n
after lettingn=m+(N− 1 )/2. For a large value ofN, we have
|Hˆ(ejω)|=|Hw(ejω)e−jω(N−^1 )/^2 |=|Hw(ejω)|≈|Hd(ejω)|
∠Hˆ(ejω)=∠Hw(ejω)−
N− 1
2
ω=−
N− 1
2
ω (11.53)
since∠Hw(ejω)=∠Hd(ejω)=0. That is, the magnitude response of the FIR filterHˆ(z)is approxi-
mately (depending on the value ofN) the desired response and its phase response is linear. These
results can be generalized as follows.
n If the desired low-pass frequency response has a magnitude
|Hd(ejω)|=
{
1 −ωc≤ω≤ωc
0 otherwise
(11.54)
and a linear phase
θ(ω)=−ω(N− 1 )/ 2
the corresponding impulse response is given by
hd[n]=
{
sin(ωc(n−α))/(π(n−α)) n6=α
ωc/π n=α
(11.55)