Hello! Welcome to the fifth lesson in our module on Digital Filter Design Techniques.
In our previous lessons, we thoroughly explored the design of Infinite Impulse Response (IIR) filters using methods like impulse invariance and the bilinear transform. You learned how to create efficient digital filters from analog prototypes and how to correct for frequency warping.
Today, we shift our focus to a different, yet equally important, class of filters: Finite Impulse Response (FIR) filters. These filters are distinct from IIR filters in several key ways, most notably their inherent stability and their ability to have a perfectly linear phase response. Our learning outcome for this lesson is to design FIR filters by applying a window function to a truncated ideal impulse response.
This lesson will guide you through the most intuitive method for FIR filter design. We will cover:
- The concept of starting with an "ideal" filter and why it's not physically realizable.
- The problems introduced by simply truncating the ideal filter's impulse response, a phenomenon known as Gibbs ringing.
- How to use window functions to mitigate these problems.
- A step-by-step procedure for designing an FIR filter to meet specific frequency domain requirements using the window method.
1. The Ideal Filter and the Need for Truncation
The design process for many FIR filters begins with a simple, idealized goal. For example, an ideal low-pass filter would perfectly pass all frequencies below a cutoff frequency and completely block all frequencies above it. This is often called a "brick-wall" filter.
As you know from your study of Fourier analysis, the frequency response of such a filter in the discrete-time domain, , is a rectangular function. To find the impulse response required to create this filter, we would take the inverse discrete-time Fourier transform (IDTFT).
Chapter 4 – Design of FIR Filters
This document from the University of Newcastle upon Tyne provides the mathematical derivation for the impulse response of an ideal low-pass filter. This is the theoretical starting point for our design method.
Please read section 4.2.1, 'Low-pass Filter design'. Follow the derivation that shows the impulse response of an ideal low-pass filter is a sinc function. This establishes the core challenge we need to solve.
As the text shows, the ideal impulse response is:
This is a sinc function. Notice two critical problems:
- It is infinitely long: The response is non-zero for all from to . This would require an infinite number of delay elements and multipliers to implement.
- It is non-causal: The response is non-zero for , meaning the filter would have to produce an output before it receives an input.
To make this filter realizable, we must make it finite and causal. The most straightforward approach is truncation: we simply cut off the impulse response, keeping only the samples around . To make it causal, we then shift the entire sequence by samples. This truncated and shifted sequence, , is now a Finite Impulse Response. But what is the consequence of this abrupt truncation?
2. The Gibbs Phenomenon: The Cost of Truncation
Truncating the impulse response in the time domain is equivalent to multiplying the ideal impulse response by a rectangular window function that is 1 for a finite duration and 0 elsewhere.
From the convolution theorem, you'll recall that multiplication in the time domain corresponds to convolution in the frequency domain. Therefore, the frequency response of our truncated filter is the periodic convolution of the ideal brick-wall response with the Fourier transform of the rectangular window. This convolution introduces undesirable artifacts.
FIR Filter Design using the Window Method
This video by Jake Gunther provides an excellent visual and conceptual explanation of what happens when we truncate an ideal impulse response.
Watch from the beginning to 04:09. The video explains how multiplying the ideal sinc response by a rectangular window in the time domain results in a periodic convolution in the frequency domain. Pay close attention to how this convolution introduces ripples and a transition band.
This smearing effect in the frequency domain is known as the Gibbs phenomenon. No matter how long you make the rectangular window (i.e., how many terms you keep), the passband and stopband will always have ripples, and the transition from passband to stopband will have a finite width.

The properties of these artifacts are directly related to the Fourier transform of the window function itself.
FIR Filter Design using the Window Method
Let's continue with the same video to see a more detailed breakdown of how the window's frequency characteristics shape the final filter.
Watch from 04:09 to 07:53. This segment animates the convolution and explicitly links the main lobe width of the window's spectrum to the filter's transition bandwidth, and the side lobe height to the filter's ripple (passband ripple and stopband attenuation).
3. The Solution: Better Windows
The rectangular window has a narrow main lobe but its first side lobe is only about 13 dB lower than the main lobe, which causes significant ripple. The key insight of the window method is this: if we use a window function that tapers more smoothly to zero at the edges, we can trade a slightly wider main lobe for significantly lower side lobes. This means we can accept a slightly wider transition band in our filter in exchange for much less ripple in the passband and better attenuation in the stopband.
Several standard window functions have been developed for this purpose, each offering a different trade-off.

Let's see a more detailed comparison.
FIR Filter Design using the Window Method
The next segment of the video compares the frequency responses of these common windows, highlighting the trade-offs each one makes.
Watch from 07:53 to 11:09. Observe the differences in main lobe width and side lobe attenuation for the Rectangular, Bartlett (triangular), Hanning, Hamming, and Blackman windows. This is the core trade-off in the window design method.
4. The Window Design Method: A Step-by-Step Recipe
Now we can combine these concepts into a formal design procedure. Given a set of filter specifications (e.g., passband/stopband frequencies, desired stopband attenuation), we can select an appropriate window and determine the necessary filter length.
FIR Filter Design using the Window Method
This final segment from the video lays out a clear, step-by-step flowchart for designing an FIR filter using the window method.
Watch from 14:11 to 29:47. This is the most practical part of the lesson. Follow the flowchart to understand how to go from a set of specifications to a final filter design. The process involves choosing a window shape based on ripple/attenuation and then calculating the window length based on the transition width.
To summarize the design process from the video:
-
Analyze Filter Specifications: From your desired filter characteristics (passband edge , stopband edge , passband ripple , stopband attenuation ), determine the two most critical parameters for window design:
- Minimum Stopband Attenuation: Choose the stricter of the two ripple requirements. This is usually the stopband attenuation, .
- Transition Bandwidth: Calculate .
-
Select a Window Shape: Using a table of window properties (like the one in the video or in LINK, Table 4.3), find a window whose stopband attenuation meets or exceeds your required . For example, if you need 50 dB of attenuation, a Hanning window (44 dB) is insufficient, but a Hamming window (53 dB) would work.
-
Determine Filter Length (N): The same table provides an approximate formula for the transition width of the chosen window, which is always a function of the filter length (e.g., for Hamming, when using normalized frequency). Rearrange this formula to solve for the required length: , where C is the constant for your chosen window. Always round up to the nearest odd integer.
-
Calculate Ideal Impulse Response (): Determine the formula for the ideal, infinite impulse response for your filter type (low-pass, high-pass, etc.) with a cutoff frequency typically set at the center of the transition band, .
-
Compute Final Filter Coefficients ():
- Generate the values of your chosen window function, , for length .
- Generate the values of the ideal impulse response, , for the same length, centered at .
- The final non-causal filter coefficients are .
- To get the final causal filter, apply a delay of samples.
Test your understanding!
You need to design a low-pass FIR filter with a stopband attenuation of at least 70 dB. According to the video and common window tables, which of the following windows is the most appropriate choice to meet this specification?
a) Rectangular
b) Hamming
c) Blackman
Show answer
c) Blackman. A Rectangular window provides ~21 dB of attenuation, and a Hamming window provides ~53 dB. A Blackman window provides ~74 dB of attenuation, which meets the 70 dB requirement.
A More Flexible Approach: The Kaiser Window
The video also briefly introduces the Kaiser window (starting at 30:26). Unlike the fixed windows, the Kaiser window has a shape parameter, , that allows for a continuous trade-off between main lobe width and side lobe level. This allows for a more optimized design that can precisely meet specifications without being "over-designed" (e.g., using a Blackman window for a 60 dB requirement when a custom Kaiser window could do it with a shorter filter length).
Conclusion
In this lesson, you've learned the fundamental principles behind the window method for FIR filter design. This technique provides an intuitive and effective way to approximate an ideal filter response while controlling the inevitable trade-offs.
Key Takeaways:
- Ideal filters are unrealizable because their impulse responses are infinite and non-causal.
- Simple truncation of the ideal impulse response is equivalent to using a rectangular window, which causes significant ripples in the frequency response (Gibbs phenomenon).
- Tapered window functions (like Hamming, Blackman) reduce these ripples by trading a wider transition band for lower spectral side lobes.
- The design process involves selecting a window shape based on the required stopband attenuation and then calculating the filter length based on the desired transition bandwidth.
Preview of the Next Lesson:
The window method is powerful and intuitive, but it is not optimal. The filter you design is not guaranteed to be the best possible filter of a given length for your specifications. In our next lesson, we will explore the frequency sampling method. This is another technique for designing FIR filters that takes a different approach: instead of starting from an ideal impulse response, we will design the filter by directly specifying samples of the desired frequency response.