%Andrew Karkau
%Matlab project 3
%November 13, 2001

n=0:1:30;
n=n-15;
wp=0.4*pi;
h=(sin(wp.*n))./(pi.*n);
h(16)=wp/pi;

w=hamming(length(n));					%create Hamming window
w=w';
hf=h.*w;										%windowed filter

figure(1)
subplot(2,1,1)
stem(n,h)
title('Impulse Response  (no window)')
xlabel(n)
ylabel('h(n)')
subplot(2,1,2)
stem(n,hf)
title('Impulse Response  (Hamming window)')
xlabel(n)
ylabel('h(n)')
figure(2)
freqz(h);
title('Frequency Response (no window)')
figure(3)
freqz(hf);
title('Frequency Response (Hamming window)')


