mirror of
https://github.com/aicodix/dsp.git
synced 2026-04-27 14:30:36 +00:00
use cos() and sin() to compute factors
This commit is contained in:
parent
6d8e0dbc94
commit
f71b7ae711
1 changed files with 4 additions and 2 deletions
6
fft.hh
6
fft.hh
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue