% Problem 4

N= 128;
M= 2048;
w1= zeros(M,1);
w2= w1;
w3= w1;
w1(1:N)= rectwin(N);
w2(1:N)= hamming(N);
w3(1:N)= kaiser(N,16);


W1= abs((fft(w1)));
W2= abs((fft(w2)));
W3= abs((fft(w3)));

f= 0:M/2-1;
figure(1);
semilogy(f,W1(1:M/2),'-',f,W2(1:M/2),'--',f,W3(1:M/2),'-.'); 
pause

% Problem 3 - freqz
figure(2);
freqz([1 1],[1 1 1 1 1], 1024,'whole');
pause
fvtool([1 1 1 1 1 1 1 1],1);
pause

%  Problem 5
fdatool;

