Merge pull request #4 from ralphtandetzky/master

Fix: Made FFT work for T = float.
This commit is contained in:
Ian Daniher 2016-10-13 21:03:34 -07:00 committed by GitHub
commit 5720824f4c

View File

@ -136,10 +136,10 @@ class kissfft
const cpx_type twiddle_mul = exp( cpx_type(0, half_phi_inc) ); const cpx_type twiddle_mul = exp( cpx_type(0, half_phi_inc) );
for ( std::size_t k = 1; 2*k < N; ++k ) for ( std::size_t k = 1; 2*k < N; ++k )
{ {
const cpx_type w = 0.5 * cpx_type( const cpx_type w = (scalar_type)0.5 * cpx_type(
dst[k].real() + dst[N-k].real(), dst[k].real() + dst[N-k].real(),
dst[k].imag() - dst[N-k].imag() ); dst[k].imag() - dst[N-k].imag() );
const cpx_type z = 0.5 * cpx_type( const cpx_type z = (scalar_type)0.5 * cpx_type(
dst[k].imag() + dst[N-k].imag(), dst[k].imag() + dst[N-k].imag(),
-dst[k].real() + dst[N-k].real() ); -dst[k].real() + dst[N-k].real() );
const cpx_type twiddle = const cpx_type twiddle =