function [omega,X]=fouriertransform(x,step); %This function computes an approximation of the Fourier transform. %Let N=length(x). It assumes signal x are the values of the signal %corresponding to the time vector %t=(-N/2:N/2-1)*step; % %Output: a frequency vector omega (in radians) and the corresponding Fourier %transform N=length(x); X=fftshift(fft(x))*step; omega=2*pi*(-N/2:N/2-1)/N/step;