%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%    Leonardo Mattos - 12/2010    %
%  leonardo (at) mail.analyx.org  %
%          www.analyx.org         %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function  [] = geraEspectro(titulo,funcao,liminfx,limsupx,liminfy,limsupy,num,Fs2)
%funcao gera espectro

L = length(funcao);         % Comprimento do sinal
y = funcao; 
NFFT = 2^nextpow2(L); % Next power of 2 from length of y
Y = fft(y,NFFT)/L;
f = Fs2/2*linspace(0,1,NFFT/2+1);
figure(num);
plot(f,2*abs(Y(1:NFFT/2+1))) 
title(titulo)
xlabel('Frequency (Hz)')
ylabel('|Amplitude|')
axis([liminfx limsupx liminfy limsupy]);

end


