function [v,F] = fourierTransform(dt,f,varargin)
% function [v,F] = fourierTransform(dt,f,varargin)
% Computes the Fourier transform of a causal , finite, band-limited signal
% using the FFT. The array v contains the frequenties at which the spectrum
% is computed. The fft are computed along dimension varargin{1}.

if nargin == 3
    D = varargin{1};
else
    D = 2;
end

N = size(f,D);
dv = 1 / (N*dt);
v = ceil(-0.5*N)*dv : dv : floor(0.5*(N-1))*dv;

F = dt * fftshift(fft(f,[],D),D);

return