# Design one of 4 type of FIR filter by window function?

There're 4 type of FIR to chose from

1. symetry ,even
2. symetry ,odd
3. antisymetry, even
4. antysymetry, odd

Also, there are many type of window like rectangular, Hanning, Kaiser,etc So how to use a window function to design the N-length filter and what's the point of doing it? That's what my teacher ask me to do but I don't understand the reason

What I confuse here is that for example I want the ideal filter $H(\omega)$ that have passband in $\omega_a <\omega<\omega_b$ then what I need to do is just use the inverse Fourier transform to the frequency response of the ideal filter to find $h[n]$ that is infinite then use the window function to make it finite. Then what's the point of make it look like the form of one of those 4 type? Moreover, what I need to do after doing inverse Fourier Transform and window function to make it in the form of FIR digital filter with N-length?

• Maybe your teacher wants to see if you can find a copy of "Rabiner and Gold, Theory and Application of Digital Signal Processing." Section "3.5 Frequency Response of Linear Phase FIR Filters" has a Figure 3.4, which depicts the 4 types of linear FIR, and section "3.8 Design Technique No. 1 - Windowing" shows some examples. Section 3.15 contains additional examples. Dec 25, 2015 at 23:32
• The properties of the 4 types of linear phase FIR filters are explained in this answer. Dec 26, 2015 at 15:14

Aukxn: Whole book chapters have been written to answer your questions. Briefly, in the window design method of designing FIR filters we define our desired freq response using $N+1$ freq-domain samples. Next, we inverse DFT those freq-domain samples to obtain the time-domain impulse samples. But dead DSP pioneers plowed through the algebra to develop equations (for simple filters like lowpass, highpass, bandpass, etc.) that define our impulse response samples without needing to perform inverse DFTs. Those equations are the $h_d[n]$ expressions in mikroe's Table 2-2-1.

Using mikroe's definition that a FIR filter has $N+1$ taps, you decide the value of $N+1$ and then use his appropriate equation to compute a finite-length $h_d[n]$ imp response sequence. Now, performing the DFT on the finite-length $h_d[n]$ sequence will show that its freq response now has potentially undesirable ripples in its passband and the stopband attenuation may not be as high as you'd like. If you cannot tolerate the passband ripples and possibly poor stopband attenuation what can you do?

What you do is window the $h_d[n]$ samples, by multiplying them by some window sequence. The freq response of the windowed $h_d[n]$ imp response samples, $h[n]$, will have drastically reduced passband ripples. But the problem now is, the new filter's freq-domain transition region's sharpness will be degraded by the windowing operation. You can solve that problem by increasing the value of $N+1$. That is, use more taps. So YOU have to decide which is more important to you, reduced passband ripple and improved stopband attenuation or reduced number of taps. That's your decision. And filter designers experiment with various window sequences to help themselves make that decision.

By the way, using a rectangular window means not modifying the $h_d[n]$ samples, produced by mikroe's equations, in any way. Rectangular windows have the worst passband ripple and poorest stopband attenuation but have the sharpest freq-domain transition region. mikroe used a rectangular window in his '2.4.1.4 Example 4' because that's what the voices in his head told him to do.

As for the $M$ in mikroe's equations: the dead DSP pioneers developed two forms for their $h_d[n]$ equations depending on whether they; (1) wanted their $n$ time index to go from a negative integer value to a positive integer value, or (2) wanted their $n$ time index to go from zero to a positive integer value. In the first case there is no $M$ variable in the $h_d[n]$ equations. In the second case there is an $M$ variable in the $h_d[n]$ equations. It's a matter of preference and mikroe, as well as I, preferred the second case. All that I've written here is in the standard DSP textbooks.

The topic your referring to goes by various names such as "FIR Filter Design Using Windows", "Windowing Method of FIR Filter Design", "Window Designed FIR Filters", etc. I'll bet your class textbook covers this topic (most DSP books do). Meaningful answers to your questions require more space than is available here. I suggest you have a look at the following web page (and its following three pages) for a decent introductory discussion of that topic:

http://www.bores.com/courses/intro/filters/4_fir.htm

Then have a look at Section 2.2 of the following web page:

http://www.mikroe.com/chapters/view/72/chapter-2-fir-filters/

• Thank you, I had had a look at the Mikroe link and I don't know why in the example 2.4 of using rectangular window, M is chosen to be the middle of the index. I hope you can explain this to me Dec 26, 2015 at 11:54