mirror of
https://github.com/mborgerding/kissfft.git
synced 2025-06-03 00:58:12 -04:00
check point
fixed does not currently work for radix 3
This commit is contained in:
parent
317f11e66e
commit
73744b908c
65
kiss_fft.c
65
kiss_fft.c
@ -169,37 +169,50 @@ void bfly3(
|
|||||||
int m
|
int m
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const int p=3;
|
kiss_fft_cpx *Fout0,*Fout1,*Fout2;
|
||||||
int u,k,q1,q;
|
|
||||||
|
int u;
|
||||||
kiss_fft_cpx * scratch = st->scratch;
|
kiss_fft_cpx * scratch = st->scratch;
|
||||||
kiss_fft_cpx * twiddles = st->twiddles;
|
kiss_fft_cpx * twiddles = st->twiddles;
|
||||||
kiss_fft_cpx t;
|
kiss_fft_cpx t[6];
|
||||||
|
//kiss_fft_cpx epi3 = twiddles[fstride*m];
|
||||||
|
kiss_fft_cpx epi3 = { -0.500000000000000 , -0.866025403784439 };
|
||||||
|
kiss_fft_cpx nepi3 = { -0.500000000000000 , 0.866025403784439 };
|
||||||
|
if ( st->inverse){
|
||||||
|
epi3.i *=-1;
|
||||||
|
nepi3.i *=-1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//printf("epi3=%e,%ei\n",epi3.r,epi3.i);
|
||||||
for ( u=0; u<m; ++u ) {
|
for ( u=0; u<m; ++u ) {
|
||||||
k=u;
|
|
||||||
for ( q1=0 ; q1<p ; ++q1 ) {
|
|
||||||
scratch[q1] = Fout[ k ];
|
|
||||||
#ifdef FIXED_POINT
|
|
||||||
scratch[q1].r /= p;
|
|
||||||
scratch[q1].i /= p;
|
|
||||||
#endif
|
|
||||||
k += m;
|
|
||||||
}
|
|
||||||
|
|
||||||
k=u;
|
Fout0=Fout++;
|
||||||
for ( q1=0 ; q1<p ; ++q1 ) {
|
Fout1=Fout0+m;
|
||||||
int twidx=0;
|
Fout2=Fout0+2*m;
|
||||||
Fout[ k ] = scratch[0];
|
scratch[0] = *Fout0;
|
||||||
for (q=1;q<p;++q ) {
|
scratch[1] = *Fout1;
|
||||||
int Norig = st->nfft;
|
scratch[2] = *Fout2;
|
||||||
twidx += fstride * k;
|
|
||||||
if (twidx>=Norig) twidx-=Norig;
|
// st->nfft = 3*m*fstride
|
||||||
C_MUL(t,scratch[q] , twiddles[twidx] );
|
// u < m
|
||||||
Fout[ k ].r += t.r;
|
C_MUL(t[0],scratch[1] , twiddles[fstride*u ] );
|
||||||
Fout[ k ].i += t.i;
|
//C_MUL(t[2],scratch[1] , twiddles[fstride*u+fstride*m] );
|
||||||
}
|
C_MUL(t[2],t[0] , epi3 );
|
||||||
k += m;
|
//C_MUL(t[4],scratch[1] , twiddles[fstride*u+2*fstride*m] );
|
||||||
}
|
C_MUL(t[4],t[2] , epi3);
|
||||||
|
|
||||||
|
C_MUL(t[1],scratch[2] , twiddles[fstride*u*2] );
|
||||||
|
//C_MUL(t[3],scratch[2] , twiddles[(fstride*(u+m)*2)%st->nfft] );
|
||||||
|
C_MUL(t[3],t[1] , nepi3);
|
||||||
|
//C_MUL(t[5],scratch[2] , twiddles[(fstride*(u+2*m)*2)%st->nfft] );
|
||||||
|
C_MUL(t[5],t[3] , nepi3);
|
||||||
|
|
||||||
|
Fout0->r = scratch[0].r + t[0].r + t[1].r;
|
||||||
|
Fout0->i = scratch[0].i + t[0].i + t[1].i;
|
||||||
|
Fout1->r = scratch[0].r + t[2].r + t[3].r;
|
||||||
|
Fout1->i = scratch[0].i + t[2].i + t[3].i;
|
||||||
|
Fout2->r = scratch[0].r + t[4].r + t[5].r;
|
||||||
|
Fout2->i = scratch[0].i + t[4].i + t[5].i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user