use cos() and sin() to compute factors

This commit is contained in:
Ahmet Inan 2019-01-15 22:55:28 +01:00
commit f71b7ae711

6
fft.hh
View file

@ -1122,8 +1122,10 @@ public:
typedef typename TYPE::value_type value_type;
FastFourierTransform()
{
for (int n = 0; n < BINS; ++n)
factors[n] = exp(TYPE(0, value_type(SIGN * FFT::twopi<value_type>(n, BINS))));
for (int n = 0; n < BINS; ++n) {
value_type a = SIGN * FFT::twopi<value_type>(n, BINS);
factors[n] = TYPE(std::cos(a), std::sin(a));
}
}
inline void operator ()(TYPE *out, const TYPE *in)
{