
function[s]=aaperiodogram(x,w,L)
%function[s]=aaperiodogram(x,w,L)
%w=window(@name,length(x)),(name=hamming,kaiser,hann,rectwin,
%bartlett,tukeywin,blackman,gausswin,nattallwin,triang,blackmanharris);
%L=desired number of points (bins) of the spectrum;
%x=data in row form;s=complex form of the DFT;
xw=x.*w';
for m=1:L
    n=1:length(x);
    s(m)=sum(xw.*exp(-j*(m-1)*(2*pi/L)*n));
end;
%as=((abs(s)).^2/length(x))/norm(w)=amplitude spectral density;
%ps=(atan(imag(s)./real(s))/length(x))/norm(w)=phase spectrum;
  