function [F,X]=Func_TFD(t,y) // Transformée de Fourier discrète -------------------- // voir commandes dft(), et aussi fft() // Identique à : X=abs(dft(y,-1))./(length(y)/2); // Identique à : X=abs(fft(y))./(length(y)/2); // (amplitude normalisée) N=length(y); tmax=max(t); deltanu=1/tmax; F=deltanu.*(0:N-1); k=0:N-1; for p=1:N X(p)=sum(y.*exp(-2.*%pi.*%i.*(p-1).*k./N)); end X=abs(X)/(N/2); endfunction