The Window Method
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 §B.5
below.
The window method consists of simply ``windowing'' a theoretically
ideal filter impulse response
by some suitably chosen window
function
, yielding
For example, as derived in Eq.

(
B.1), the
impulse response of the
ideal lowpass filter is the well known
sinc function
where

is the total normalized
bandwidth of the lowpass filter
in Hz (counting both negative and positive frequencies), and

denotes the cut-off frequency in Hz. As noted earlier, we cannot
implement this filter in practice because it is noncausal and of
infinite duration.
Since
sinc
decays away from time 0 as
, we would
expect to be able to truncate it to the interval
, for some
sufficiently large
, 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
§B.2 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
such that
for all
. The final windowed impulse response
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
has a frequency response given by
where

is the ideal frequency response and

is
the window transform. For the ideal lowpass filter,

is a
rectangular window in the frequency domain. The frequency response

is thus obtained by
convolving the rectangular window with
the window transform

. This implies several points which can be
immediately seen in terms of this convolution operation:
- The passband gain is primarily the area under the
main lobe of the window transform, provided the main lobe
``fits'' inside the passband (i.e., the total lowpass bandwidth
is greater than or equal to the main-lobe width).
- The stopband gain is given by an integral over a portion
of the sidelobes of the window transform. Since sidelobes
oscillate about zero, a finite integral over them is normally much
smaller than the sidelobes themselves, due to adjacent sidelobe
cancellation under the integral.
- The best stop-band performance occurs when the cut-off
frequency is set so that the stopband sidelobe integral traverses a
whole number of sidelobes.
- The transition bandwidth is equal to the bandwidth of
the main lobe of the window transform, again provided the main
lobe ``fits'' inside the passband.
- For very small lowpass bandwidths
,
approaches
an impulse function in the frequency domain. Since the impulse
function is the identity operator under convolution, the resulting
lowpass filter
approaches the window transform
for small
. In particular, the stopband gain
approaches the window sidelobe level, and the transition width
approaches half the main-lobe width. Thus, for good results,
the lowpass cut-off frequency should be set no lower than half the
window's main lobe width.
Subsections
Previous:
Frequency Sampling Method for FIR Filter DesignNext:
Matlab Support for the Window Method
written by Julius Orion Smith III
Julius Smith's background is in electrical engineering (BS Rice 1975, PhD Stanford 1983). He is presently Professor of Music and Associate Professor (by courtesy) of Electrical Engineering at
Stanford's Center for Computer Research in Music and Acoustics (CCRMA), teaching courses and pursuing research related to signal processing applied to music and audio systems. See
http://ccrma.stanford.edu/~jos/ for details.