diff --git a/kiss_fft.c b/kiss_fft.c index 297e627..9f29c87 100644 --- a/kiss_fft.c +++ b/kiss_fft.c @@ -64,7 +64,49 @@ kiss_fft_cpx cexp(double phase) return x; } +static +void fft_work( + kiss_fft_cpx * Fout, + const kiss_fft_cpx * f, + int fstride, + int * factors, + const kiss_fft_state * st + ); + // the heart of the fft +static +void fft2work( + kiss_fft_cpx * Fout, + const kiss_fft_cpx * f, + int fstride, + int * factors, + const kiss_fft_state * st, + int m + ) +{ + int u; + kiss_fft_cpx t; + //kiss_fft_cpx * scratch = st->scratch; + kiss_fft_cpx * twiddles = st->twiddles; + //int Norig = st->nfft; + + if (m==1) { + Fout[0] = f[0]; + Fout[1] = f[fstride]; + } else { + fft_work( Fout , f, fstride*2,factors,st); + fft_work( Fout + m, f+fstride, fstride*2,factors,st); + } + + for ( u=0; uscratch; kiss_fft_cpx * twiddles = st->twiddles; int Norig = st->nfft; p=*factors++; - m=*factors++;//m = n/p; + m=*factors++; + +#if 1 + switch (*factors) { + case 2: + fft2work(Fout,f,fstride,factors,st,m); + return; + default: + break; + } +#endif for (q=0;qfactors[2*nstages] = p; nfft /= p;