Permalink
Browse files

COMMON: FFT update cos/sin table constructor change

They now take in the size rather than the power of 2 exponent.
  • Loading branch information...
dafioram committed Aug 16, 2018
1 parent 83dcb60 commit 53e03aa37c08d93a524cf2512c43f57b61b8dbdd
Showing with 5 additions and 2 deletions.
  1. +5 −2 common/fft.cpp
@@ -37,6 +37,7 @@ FFT::FFT(int bits, int inverse) : _bits(bits), _inverse(inverse) {
assert((_bits >= 2) && (_bits <= 16));

int n = 1 << bits;
int nPoints;

_tmpBuf = new Complex[n];
_expTab = new Complex[n / 2];
@@ -48,8 +49,10 @@ FFT::FFT(int bits, int inverse) : _bits(bits), _inverse(inverse) {
_revTab[-splitRadixPermutation(i, n, _inverse) & (n - 1)] = i;

for (int i = 0; i < ARRAYSIZE(_cosTables); i++) {
if (i+4 <= _bits)
_cosTables[i] = new Common::CosineTable(i+4);
if (i + 4 <= _bits) {
nPoints = 1 << (i + 4);
_cosTables[i] = new Common::CosineTable(nPoints);
}
else
_cosTables[i] = nullptr;
}

0 comments on commit 53e03aa

Please sign in to comment.