I need to use the matlab function 'fft' to perform a Fourier transform, but the problem is that it always gives me a double-sided signal, while I would like to have a one-side signal. I sometimes use this function :
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;
Can you suggest me an equivalent one made with fft , given as input t, s and nu ? Thanks so much.
Best Answer