%FAST: FFT that returns only the positive frequencies
% Usage:    S=fast(s);
% If s is N points long, NF=N/2+1 complex points are returned.
%Normalization:
% and X = fft(x)
% then NORM(x) = SQRT[(x,x)] = ||x|| = ||X||/SQRT(N) = SQRT(N)*RMS(x)
% and RMS(x) = ||x||/SQRT(N) = ||X||/N = RMS(X)/SQRT(N)
% Let  X~ = FAST(x)
% then RMS(x) = ||[X~,X~(2:(NF-1))]||/N =
%     RMS( X~(1)+X~(NFT) )/N + (2/N)*RMS( X~(2:(NF-1) )

% rms(x) = std(x,1) NOT std(x)
 
function X=fast(x)
n=length(x)/2+1;
xc=fft(x);
X=xc(1:fix(n));
