/* This FFT has been proposed by Paul Bourke http://paulbourke.net/miscellaneous/dft/ This computes an in-place complex-to-complex FFT x and y are the real and imaginary arrays of 2^m points. dir = 1 gives forward transform dir = -1 gives reverse transform You MUST compute first the value m such that 2^(m-1) < n (size of your signal) <= 2^m allocate a new signal of nm=2^m values then fill the n first values of this new signal with your signal and fill the rest with 0 WARNING : you must pass m, not nm !!! */ int FFT(int dir,int m,double *x,double *y) { int n,i,i1,j,k,i2,l,l1,l2; double c1,c2,tx,ty,t1,t2,u1,u2,z; /* Calculate the number of points */ n = 1; for (i=0;i> 1; j = 0; for (i=0;i>= 1; } j += k; } /* Compute the FFT */ c1 = -1.0; c2 = 0.0; l2 = 1; for (l=0;l