%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%This Will plot the FFT using a Kaiser %
%Window                                %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function [Xspect, w] = kaiser_fft(A,Wo,N,B,samples)



n=[0:N-1]';
vector_size=length(A);
i=1;
z=0;
y=0;
while i <= vector_size
x = A(i)*cos(n*Wo(i));
y = y + x;
i=i+1;
end

KW = kaiser(N,B);
z = KW.*y;
Xspect = fft(z,samples);
w=[0:samples-1]'*2*pi/samples;
figure,plot(w(1:samples/2)/pi,abs(Xspect(1:samples/2)));
xlabel('frequency(*\pi),\omega'), title('Spectral Analysis, Using Kaiser Window'),ylabel('Amplitude');
figure,stem(w(1:samples/2)/pi,abs(Xspect(1:samples/2)));
xlabel('frequency(*\pi),\omega'), title('Spectral Analysis, Using Kaiser Window'),ylabel('Amplitude');
