Window Functions for FIR Filter design
This Program is used to generate different window functions For FIR Filter design based on windowing technique
//Program to generate different window functions
//For FIR Filter design based on windowing techniques
clear all
;
close;
clc
M
=11 ;
for n
= 1:M
h_Rect
(n
) = 1;
h_hann
(n
) = 0.5-0.5*cos(2*%pi*(n
-1)/(M
-1));
h_hamm
(n
) = 0.54-0.46*cos(2*%pi*(n
-1)/(M
-1));
h_balckmann
(n
) = 0.42-0.5*cos(2*%pi*n
/(M
-1))+0.08*cos(4*%pi*n
/(M
-1));
end
plot2d(1:M
,[h_Rect
,h_hann
,h_hamm
,h_balckmann
],[2,5,7,9]);
legend(['Rectangular Window';'Hanning';'Hamming';'Balckmann']);
title('Window Functions for Length M = 11')
Rate this code snippet:
4
Rating: 4 | Votes: 1
posted by Senthilkumar R