Help with fourier transform
Show older comments
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
Accepted Answer
More Answers (0)
Categories
Find more on Discrete Fourier and Cosine Transforms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!