

Window Method for FIR Filter Design

The window method for digital filter design is fast, convenient, and robust, but generally suboptimal. It is easily understood in terms of the convolution theorem for Fourier transforms, making it instructive to study after the Fourier theorems and windows for spectrum analysis. It can be effectively combined with the frequency sampling method, as we will see in §4.6 below.

The window method consists of simply ``windowing'' a theoretically ideal filter impulse response $ h(n)$ by some suitably chosen window function $ w(n)$ , yielding

$\displaystyle h_w(n) = w(n)\cdot h(n), \quad n\in{\cal Z}.$ (5.8)

For example, as derived in Eq.$ \,$ (4.3), the impulse response of the ideal lowpass filter is the well known sinc function

$\displaystyle h(n) \eqsp B\cdot$sinc$\displaystyle (B n) \isdefs B\frac{\sin(\pi B n)}{\pi B n}, \quad n\in{\bf Z},$ (5.9)

where $ B=2f_c$ is the total normalized bandwidth of the lowpass filter in Hz (counting both negative and positive frequencies), and $ f_c$ denotes the cut-off frequency in Hz. As noted earlier, we cannot implement this filter in practice because it is noncausal and infinitely long.

Since $ h(n) = B\,$sinc$ (BnT)$ decays away from time 0 as $ 1/n$ , we would expect to be able to truncate it to the interval $ [-N,N]$ , for some sufficiently large $ N$ , and obtain a pretty good FIR filter which approximates the ideal filter. This would be an example of using the window method with the rectangular window. We saw in §4.3 that such a choice is optimal in the least-squares sense, but it designs relatively poor audio filters. Choosing other windows corresponds to tapering the ideal impulse response to zero instead of truncating it. Tapering better preserves the shape of the desired frequency response, as we will see. By choosing the window carefully, we can manage various trade-offs so as to maximize the filter-design quality in a given application.

Window functions are always time limited. This means there is always a finite integer $ N_w$ such that $ w(n)=0$ for all $ \vert n\vert>N_w$ . The final windowed impulse response $ h_w(n) =
w(n)\cdot h(n)$ is thus always time-limited, as needed for practical implementation. The window method always designs a finite-impulse-response (FIR) digital filter (as opposed to an infinite-impulse-response (IIR) digital filter).

By the dual of the convolution theorem, pointwise multiplication in the time domain corresponds to convolution in the frequency domain. Thus, the designed filter $ h_w$ has a frequency response given by

$\displaystyle H_w(f) = \left(W\ast H\right)(f), \quad f\in\left[\,-1/2,\,1/2\,\right)$ (5.10)

where $ H=\hbox{\sc DTFT}(h)$ is the ideal frequency response and $ W=\hbox{\sc DTFT}(w)$ is the window transform. For the ideal lowpass filter, $ H$ is a rectangular window in the frequency domain. The frequency response $ H_w(f)$ is thus obtained by convolving the rectangular window with the window transform $ W(f)$ . This implies several points which can be immediately seen in terms of this convolution operation:

