35 C_MUL (t, *Fout2 , *tw1);
37 C_SUB( *Fout2 , *Fout , t );
63 C_MUL(scratch[0],Fout[m] , *tw1 );
64 C_MUL(scratch[1],Fout[m2] , *tw2 );
65 C_MUL(scratch[2],Fout[m3] , *tw3 );
67 C_SUB( scratch[5] , *Fout, scratch[1] );
69 C_ADD( scratch[3] , scratch[0] , scratch[2] );
70 C_SUB( scratch[4] , scratch[0] , scratch[2] );
71 C_SUB( Fout[m2], *Fout, scratch[3] );
78 Fout[m].
r = scratch[5].
r - scratch[4].
i;
79 Fout[m].
i = scratch[5].
i + scratch[4].
r;
80 Fout[m3].
r = scratch[5].
r + scratch[4].
i;
81 Fout[m3].
i = scratch[5].
i - scratch[4].
r;
83 Fout[m].
r = scratch[5].
r + scratch[4].
i;
84 Fout[m].
i = scratch[5].
i - scratch[4].
r;
85 Fout[m3].
r = scratch[5].
r - scratch[4].
i;
86 Fout[m3].
i = scratch[5].
i + scratch[4].
r;
100 const size_t m2 = 2*m;
111 C_MUL(scratch[1],Fout[m] , *tw1);
112 C_MUL(scratch[2],Fout[m2] , *tw2);
114 C_ADD(scratch[3],scratch[1],scratch[2]);
115 C_SUB(scratch[0],scratch[1],scratch[2]);
119 Fout[m].
r = Fout->
r -
HALF_OF(scratch[3].r);
120 Fout[m].
i = Fout->
i -
HALF_OF(scratch[3].i);
126 Fout[m2].
r = Fout[m].
r + scratch[0].
i;
127 Fout[m2].
i = Fout[m].
i - scratch[0].
r;
129 Fout[m].
r -= scratch[0].
i;
130 Fout[m].
i += scratch[0].
r;
138 const size_t fstride,
149 ya = twiddles[fstride*m];
150 yb = twiddles[fstride*2*m];
159 for ( u=0; u<m; ++u ) {
163 C_MUL(scratch[1] ,*Fout1, tw[u*fstride]);
164 C_MUL(scratch[2] ,*Fout2, tw[2*u*fstride]);
165 C_MUL(scratch[3] ,*Fout3, tw[3*u*fstride]);
166 C_MUL(scratch[4] ,*Fout4, tw[4*u*fstride]);
168 C_ADD( scratch[7],scratch[1],scratch[4]);
169 C_SUB( scratch[10],scratch[1],scratch[4]);
170 C_ADD( scratch[8],scratch[2],scratch[3]);
171 C_SUB( scratch[9],scratch[2],scratch[3]);
173 Fout0->
r += scratch[7].
r + scratch[8].
r;
174 Fout0->
i += scratch[7].
i + scratch[8].
i;
176 scratch[5].
r = scratch[0].
r +
S_MUL(scratch[7].r,ya.
r) +
S_MUL(scratch[8].r,yb.
r);
177 scratch[5].
i = scratch[0].
i +
S_MUL(scratch[7].i,ya.
r) +
S_MUL(scratch[8].i,yb.
r);
179 scratch[6].
r =
S_MUL(scratch[10].i,ya.
i) +
S_MUL(scratch[9].i,yb.
i);
180 scratch[6].
i = -
S_MUL(scratch[10].r,ya.
i) -
S_MUL(scratch[9].r,yb.
i);
182 C_SUB(*Fout1,scratch[5],scratch[6]);
183 C_ADD(*Fout4,scratch[5],scratch[6]);
185 scratch[11].
r = scratch[0].
r +
S_MUL(scratch[7].r,yb.
r) +
S_MUL(scratch[8].r,ya.
r);
186 scratch[11].
i = scratch[0].
i +
S_MUL(scratch[7].i,yb.
r) +
S_MUL(scratch[8].i,ya.
r);
187 scratch[12].
r = -
S_MUL(scratch[10].i,yb.
i) +
S_MUL(scratch[9].i,ya.
i);
188 scratch[12].
i =
S_MUL(scratch[10].r,yb.
i) -
S_MUL(scratch[9].r,ya.
i);
190 C_ADD(*Fout2,scratch[11],scratch[12]);
191 C_SUB(*Fout3,scratch[11],scratch[12]);
193 ++Fout0;++Fout1;++Fout2;++Fout3;++Fout4;
200 const size_t fstride,
209 int Norig = st->
nfft;
213 for ( u=0; u<m; ++u ) {
215 for ( q1=0 ; q1<p ; ++q1 ) {
216 scratch[q1] = Fout[ k ];
222 for ( q1=0 ; q1<p ; ++q1 ) {
224 Fout[ k ] = scratch[0];
226 twidx += fstride * k;
227 if (twidx>=Norig) twidx-=Norig;
228 C_MUL(t,scratch[q] , twiddles[twidx] );
241 const size_t fstride,
248 const int p=*factors++;
249 const int m=*factors++;
255 if (fstride==1 && p<=5)
260 # pragma omp parallel for
262 kf_work( Fout +k*m, f+ fstride*in_stride*k,fstride*p,in_stride,factors,st);
266 case 2:
kf_bfly2(Fout,fstride,st,m);
break;
267 case 3:
kf_bfly3(Fout,fstride,st,m);
break;
268 case 4:
kf_bfly4(Fout,fstride,st,m);
break;
269 case 5:
kf_bfly5(Fout,fstride,st,m);
break;
279 f += fstride*in_stride;
280 }
while(++Fout != Fout_end );
287 kf_work( Fout , f, fstride*p, in_stride, factors,st);
288 f += fstride*in_stride;
289 }
while( (Fout += m) != Fout_end );
296 case 2:
kf_bfly2(Fout,fstride,st,m);
break;
297 case 3:
kf_bfly3(Fout,fstride,st,m);
break;
298 case 4:
kf_bfly4(Fout,fstride,st,m);
break;
299 case 5:
kf_bfly5(Fout,fstride,st,m);
break;
313 floor_sqrt = floor( sqrt((
double)n) );
319 case 4: p = 2;
break;
320 case 2: p = 3;
break;
321 default: p += 2;
break;
343 + sizeof(kiss_fft_cpx)*(nfft-1);
345 if ( lenmem==NULL ) {
348 if (mem != NULL && *lenmem >= memneeded)
357 for (i=0;i<
nfft;++i) {
358 const double pi=3.141592653589793238462643383279502884197169399375105820974944;
400 while ( (m%2) == 0 ) m/=2;
401 while ( (m%3) == 0 ) m/=3;
402 while ( (m%5) == 0 ) m/=5;
#define KISS_FFT_TMP_ALLOC(nbytes)
#define kf_cexp(x, phase)
#define KISS_FFT_TMP_FREE(ptr)
void kiss_fft_stride(kiss_fft_cfg st, const kiss_fft_cpx *fin, kiss_fft_cpx *fout, int in_stride)
static void kf_work(kiss_fft_cpx *Fout, const kiss_fft_cpx *f, const size_t fstride, int in_stride, int *factors, const kiss_fft_cfg st)
static void kf_bfly2(kiss_fft_cpx *Fout, const size_t fstride, const kiss_fft_cfg st, int m)
struct kiss_fft_state * kiss_fft_cfg
void kiss_fft_cleanup(void)
static void kf_bfly4(kiss_fft_cpx *Fout, const size_t fstride, const kiss_fft_cfg st, const size_t m)
static void kf_factor(int n, int *facbuf)
kiss_fft_cfg kiss_fft_alloc(int nfft, int inverse_fft, void *mem, size_t *lenmem)
#define C_MULBYSCALAR(c, s)
void kiss_fft(kiss_fft_cfg cfg, const kiss_fft_cpx *fin, kiss_fft_cpx *fout)
static void kf_bfly5(kiss_fft_cpx *Fout, const size_t fstride, const kiss_fft_cfg st, int m)
static void kf_bfly3(kiss_fft_cpx *Fout, const size_t fstride, const kiss_fft_cfg st, size_t m)
int kiss_fft_next_fast_size(int n)
static void kf_bfly_generic(kiss_fft_cpx *Fout, const size_t fstride, const kiss_fft_cfg st, int m, int p)