this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #4 from ralphtandetzky/master

Fix: Made FFT work for T = float.

authored by

Ian Daniher and committed by
GitHub
5720824f e797a0e1

+6 -6
+6 -6
kissfft.hh
··· 136 136 const cpx_type twiddle_mul = exp( cpx_type(0, half_phi_inc) ); 137 137 for ( std::size_t k = 1; 2*k < N; ++k ) 138 138 { 139 - const cpx_type w = 0.5 * cpx_type( 139 + const cpx_type w = (scalar_type)0.5 * cpx_type( 140 140 dst[k].real() + dst[N-k].real(), 141 141 dst[k].imag() - dst[N-k].imag() ); 142 - const cpx_type z = 0.5 * cpx_type( 142 + const cpx_type z = (scalar_type)0.5 * cpx_type( 143 143 dst[k].imag() + dst[N-k].imag(), 144 144 -dst[k].real() + dst[N-k].real() ); 145 145 const cpx_type twiddle = ··· 174 174 do{ 175 175 // recursive call: 176 176 // DFT of size m*p performed by doing 177 - // p instances of smaller DFTs of size m, 177 + // p instances of smaller DFTs of size m, 178 178 // each one takes a decimated version of the input 179 179 kf_work(stage+1, Fout , f, fstride*p,in_stride); 180 180 f += fstride*in_stride; ··· 183 183 184 184 Fout=Fout_beg; 185 185 186 - // recombine the p smaller DFTs 186 + // recombine the p smaller DFTs 187 187 switch (p) { 188 188 case 2: kf_bfly2(Fout,fstride,m); break; 189 189 case 3: kf_bfly3(Fout,fstride,m); break; ··· 290 290 scratch[7].imag()*ya.real() + scratch[8].imag()*yb.real() 291 291 ); 292 292 293 - scratch[6] = cpx_type( 293 + scratch[6] = cpx_type( 294 294 scratch[10].imag()*ya.imag() + scratch[9].imag()*yb.imag(), 295 295 -scratch[10].real()*ya.imag() - scratch[9].real()*yb.imag() 296 296 ); ··· 298 298 *Fout1 = scratch[5] - scratch[6]; 299 299 *Fout4 = scratch[5] + scratch[6]; 300 300 301 - scratch[11] = scratch[0] + 301 + scratch[11] = scratch[0] + 302 302 cpx_type( 303 303 scratch[7].real()*yb.real() + scratch[8].real()*ya.real(), 304 304 scratch[7].imag()*yb.real() + scratch[8].imag()*ya.real()