102
Skew2 = Nmax >> 1;
Wstore = new ShortComplex[Skew2];
WstoreEnd = Wstore + Skew2;
Wstore[0].re = 1.0;
Wstore[0].im = 0.0;
for(N = 4, pWN = W2n + 1, Skew = Skew2 >> 1; N <= Nmax; N += N,
pWN++, Skew2 = Skew, Skew >>= 1)
{
//WN = W(1, N) = exp(-2*pi*j/N)
WN= *pWN;
for(Warray = Wstore; Warray < WstoreEnd; Warray += Skew2)
complex_mul(Warray + Skew, Warray, &WN);
}
return Wstore;
}
static void fft_step(ShortComplex *x, unsigned int T, bool complement, const
ShortComplex *Wstore)
{
unsigned int Nmax, I, J, N, Nd2, k, m, Skew, mpNd2, Step;
unsigned char *Ic = (unsigned char*) &I;
unsigned char *Jc = (unsigned char*) &J;
ShortComplex S;
const ShortComplex *Warray;
Complex Temp;
Nmax = 1 << T;
//first interchanging
for(I = 1; I < Nmax - 1; I++)