Help with fourier transform
Mostra commenti meno recenti
Hello! I'm using this function to perform a simple Fourier Transform:
function four=FourierDir(t,s,nu)
% number of points in the time domain
N=length(t);
Nf=length(nu);
% sampling step in the time domain
Dt=diff(t);
Dt(N)=Dt(N-1);
four=zeros(1,Nf);
for ii=1:Nf
four(ii)=sum(Dt.*s.*exp(-1i*2*pi.*t.*nu(ii)));
end;
How can I perform the same operation but using the matlab function 'fft' , given the same input parameters t,s,nu? s is the set of data I want to transform along t direction, nu is a vector I define for the number of points.
Thanks for the help
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Discrete Fourier and Cosine Transforms in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!