% [Y, Vf] = Spectre(y,Fs)
% Calcul et tracer du spectre d'un signal temporel
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Entrees
%y = signal temporel, vecteur
%Fs = frequence d'echantillonnage, scalaire [Hz]
%%%% Sortie
%Y = spectre du signal temporel y, vecteur
%Vf = axe frequentiel, vecteur [Hz]

function [Y, Vf] = Spectre(y,Fs)
Imax = round(2000*length(y)/Fs);
Y = abs(fft(y));
Vf = (0:length(y)-1)*Fs/length(y);
Vf = Vf(1:Imax);Y = Y(1:Imax);
end