%Demo of window FIR filtering using windows .....
% Shows effect of window shape in time domain

% Last revised 10/27/98 - rms

a = 1;
wc = .4*pi;
N = 51;
n = -(N-1)/2:(N-1)/2;


% Rectangular window

stem(n,boxcar(N))
title('Rectangular window, N = 51','fontsize',14)
xlabel('n','fontsize',14)
ylabel('w[n]','fontsize',14)
pause

% Bartlett window

stem(n,bartlett(N))
title('Bartlett window, N = 51','fontsize',14)
xlabel('n','fontsize',14)
ylabel('w[n]','fontsize',14)
pause


% Hanning window

stem(n,hanning(N))
title('Hanning window, N = 51','fontsize',14)
xlabel('n','fontsize',14)
ylabel('w[n]','fontsize',14)
pause


% Hamming window

stem(n,hamming(N))
title('Hamming window, N = 51','fontsize',14)
xlabel('n','fontsize',14)
ylabel('w[n]','fontsize',14)
pause



% Blackman window

stem(n,blackman(N))
title('Blackman window, N = 51','fontsize',14)
xlabel('n','fontsize',14)
ylabel('w[n]','fontsize',14)
pause
