Sign in

username:

password:



Not a member?

Search Online Books



Search tips

Free Online Books

Sponsor

NEW! TMS320C6474: 3x the performance. 1/3 the cost. Three 1 GHz cores on 1 chip.

Chapters

Chapter Contents:

Search Spectral Audio Signal Processing

  

Book Index | Global Index


Would you like to be notified by email when Julius Orion Smith III publishes a new entry into his blog?

  

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 $ 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}.
$

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

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

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 of infinite duration.

Since $ h(n) =$   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 §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 $ 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[-\frac{1}{2},\frac{1}{2}\right)
$

where $ H=\hbox{\sc DTFT}(h)$ is the ideal frequency response and $ W=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:

  • 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 $ B\isdef 2f_c$ 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 $ B$, $ H(\omega)$ approaches an impulse function in the frequency domain. Since the impulse function is the identity operator under convolution, the resulting lowpass filter $ H_w(\omega)$ approaches the window transform $ W(\omega)$ for small $ B$. 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

Order a Hardcopy of Spectral Audio Signal Processing

Previous: Frequency Sampling Method for FIR Filter Design
Next: 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.


Comments


No comments yet for this page


Add a Comment
You need to login before you can post a comment (best way to prevent spam). ( Not a member? )