 I am Prashant S. Malge, Assistant Professor, Department of Electronics Engineering, Walsh and Institute of Technology, Solarboard. Today we will see how to design a FIR filter using windowing technique, the learning outcome. At the end of the session, student will be able to design a FIR filter using windowing technique. Now consider an example for this. Design a low pass filter with desired frequency response given by h d e raise to j omega equal to e raise to minus 2 j omega from minus pi by 4 to plus pi by 4, 0 from mod omega between pi by 4 to pi. Design the filter coefficients h of n if the window function is given as W n equal to this and also determine the frequency response h e raise to j omega of the desired filter. Here this h d, d stands for desired frequency response. Now let us plot the magnitude of this particular frequency response. That is magnitude of h d e raise to j omega. If you look at here the magnitude between minus pi by 4 to plus pi by 4 is 1. So if I consider the response from minus pi by 4 pi to plus pi, so the magnitude of this particular frequency response is 1 from minus pi by 4 to plus pi by 4 and this mod omega between pi by 4 to pi means the response is 0 from minus pi to minus pi by 4 and also it is 0 from plus pi by 4 to pi. Now for this we want to design the filter. So the next step is to determine the desired impulse response from h d e raise to j omega. So this is obtained by taking the inverse Fourier transform of h d e raise to j omega. So where it is written as h d n is equal to 1 upon 2 pi minus pi to pi h d e raise to j omega e raise to j omega n d omega. So we obtain this inverse Fourier transform. Now if you look at this particular response the magnitude response is 0 from minus pi to this minus pi by 4. It is equal to 1 from minus pi by 4 to pi by 4 and it is equal to 0 from once again pi by 4 to pi. So we will divide this integral between three different ranges and with that we can write this integral as h d n is equal to minus pi by 4 sorry minus pi to minus pi by 4 h d e raise to j omega e raise to j omega n d omega. So I will take this 1 upon 2 pi outside plus minus pi by 4 to plus pi by 4 h d e raise to j omega e raise to j omega n d omega plus pi by 4 to pi h d e raise to j omega e raise to j omega n d omega. So if you look at in this range that is from minus pi by 4 to minus pi to minus pi by 4 and from pi by 4 to pi the magnitude of this particular frequency response is 0. So therefore these two integrals will be 0. So therefore h d n can be written as h d n is equal to 1 upon 2 pi integral from minus pi by 4 to plus pi by 4 because in this range the value of h d e raise to j omega n is e raise to minus 2 j omega. Therefore this is equal to e raise to minus 2 j omega e raise to j omega n d omega. So this can be obtained as 1 upon 2 pi minus pi by 4 to plus pi by 4 e raise to j omega n minus 2 d omega. So by taking this integral this is equal to e raise to j omega n minus 2 upon j n minus 2 minus pi by 4 to plus pi by 4. Substituting these limits we can write this as 1 upon 2 pi e raise to j pi by 4 n minus 2 minus e raise to minus j pi by 4 n minus 2 divided by j n minus 2. So now we know that e raise to j theta minus e raise to minus j theta divided by 2 j. So this taking this 2 and j we can write this as 1 upon pi n minus pi n minus 2 into sin pi by 4 n minus 2. So this is what you get h d n for n not equal to 2 and when n equal to 2 because when n it tends to 2 this becomes 0. So as we know that sin theta theta tends to 0 equal to theta. So therefore for n equal to 2 this sin will be equal to pi by 4 n minus 2 that cancel n is equal to 1 by 4. So for n equal to 2. So therefore with this our desired impulse response h d n is equal to sin pi by 4 n minus 2 upon pi n minus 2 for n not equal to 2 and equal to 1 by 4 for n equal to 2. So we can obtain the coefficients by using this particular formula. Now we know that given window function is a rectangular window and it is defined as W n equal to 1 for 0 to 4 0 otherwise. So therefore by multiplying by this window function with this h d n we can obtain the impulse response of the design filter. So impulse response of design filter is h of n is equal to h d n into W n. So as this W n is equal to 1 between 0 to 4 0 otherwise. So therefore h n will be equal to h d n 0 to 4 0 otherwise. So the length of our filter will be only 5 that is it exists only between 0 to 4. So therefore it is a FR filter. So we can obtain the values of these filter coefficients by substituting this n in this particular equation. So therefore h of 0 is equal to h d 0 which is equal to so if we substitute 0 here. So this is sin pi by 2 upon 2 pi so this comes out to be 1 upon 2 pi. So if we substitute h of 1 which is equal to h d 1 where this comes out to be when n equal to 1 this is 1 minus 2 is minus 1 so sin minus pi by 4 upon pi. So sin upon minus pi so minus gets cancelled. So what you get is 1 by root 2 pi same way h of 2 is equal to 1 by 4 now when you substitute n equal to 3 this comes out to be once again sin pi by 4 upon pi. So once again will be equal to h d 1 so this is equal to h of 3 same way when you substitute 4 this will be 4 minus 2 so sin pi by 2 upon 2 pi so that comes out to be equal to h this h of 0 that is 1 upon or this is h of 4. So therefore h of 0 equal to h of 4 equal to 1 by 2 pi h of 1 equal to h of 3 equal to 1 by root 2 pi and h of 2 equal to 1 by 2. So these are the filter coefficients using these filter coefficients now we can obtain the frequency response h e raise to j omega of the design filter. So this can be obtained by h e raise to j omega equal to n equal to 0 to 4 h of n e raise to minus j omega n so this is equal to h of 0 plus h of 1 e raise to minus j omega plus h of 2 e raise to minus 2 j omega plus h of 3 e raise to minus 3 j omega plus h of 4 e raise to minus 4 j omega. From this by taking this e raise to minus 2 j omega common this can be written as h of 0 into e raise to minus sorry plus 2 j omega plus h of 1 e raise to j omega plus h of 2 plus h of 3 e raise to minus j omega plus h of 4 e raise to minus 2 j omega. So as this h of 0 and h of 4 are values are same so this can be written as this is 1 upon 2 pi e raise to 2 j omega plus e raise to minus 2 j omega divided by 2 if we take and multiply by 2 so this comes out to be 2 cos of 2 omega plus same way these 2 are same if you take common e raise to j omega plus e raise to minus j omega by 2 you will get cos so 1 by root 2 pi into 2 cos omega plus h of 2 is 1 by 4 so therefore this h e raise to j omega equal to e raise to minus 2 j omega in bracket 1 by 4 plus this 2 and root 2 so this is root 2 pi cos omega plus 2 gates cancels 1 by power cos 2 omega so this is the impulse response of the filter. This is how we can design the affair filter by using windowing these are the references.