/*********************************************************************** * FFT (SWITCH=FFT) or IFFT (SWITCH=IFFT) routine ***********************************************************************/ void fft(x,n,SWITCH) /* For IFFT, signal is not divided by n in this version */ enum Boolean SWITCH; struct Complex *x; int n; { struct Complex u, w, t, ctemp; int nv2, nm1; int i, j, jj, k, l; int le, le1, ip, m; float fm; fm=log((double)n)/log((double)2); m=fm; nv2=n/2; nm1=n-1; j=0; jj=1; for(i=0;i