From bd23fe8d239bb6c5dae22b145503abd93402d0d6 Mon Sep 17 00:00:00 2001 From: Mark Borgerding Date: Sat, 8 Nov 2003 01:42:15 +0000 Subject: [PATCH] the path I was taking would only work for prime numbers (Galois fields) --- kiss_fft.c | 73 +++++++++++++++--------------------------------------- 1 file changed, 20 insertions(+), 53 deletions(-) diff --git a/kiss_fft.c b/kiss_fft.c index e56c805..132ed2a 100644 --- a/kiss_fft.c +++ b/kiss_fft.c @@ -287,63 +287,32 @@ void bfly_generic( int p ) { - int u,q,d,fsm,halfp,mp,uf; + int u,k,q1,q; kiss_fft_cpx * scratch = st->scratch; - kiss_fft_cpx * scratch2 = scratch + p; - kiss_fft_cpx * tw = st->twiddles; - kiss_fft_cpx tlo,t3,t4; - kiss_fft_cpx *Foutlo,*Fouthi; - - fsm = fstride*m; - halfp=p/2; - mp=m*p; - - for ( q=1; q

= st->nfft) - twidx -= st->nfft; - *scratch2++ = tlo; - } - } + kiss_fft_cpx * twiddles = st->twiddles; + kiss_fft_cpx t; + int Norig = st->nfft; for ( u=0; ur += t3.r - t4.r; - Foutlo->i += t3.i - t4.i; - Fouthi->r += t3.r + t4.r; - Fouthi->i -= t3.i + t4.i; - }while( (Foutlo += m) < Fouthi ); + k=u; + for ( q1=0 ; q1

=Norig) twidx-=Norig; + C_MUL(t,scratch[q] , twiddles[twidx] ); + C_ADDTO( Fout[ k ] ,t); + } + k += m; } - ++Fout; } } @@ -369,9 +338,7 @@ void fft_work( switch (p) { case 2: bfly2(Fout,fstride,st,m); break; -#if 1 case 3: bfly3(Fout,fstride,st,m); break; -#endif case 4: bfly4(Fout,fstride,st,m); break; case 5: bfly5(Fout,fstride,st,m); break; default: bfly_generic(Fout,fstride,st,m,p); break;