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 authored and sev- committed Aug 16, 2018
1 parent e859a6f commit da57cef0c34162789100ea25eb0f4f3f7a1e90bf
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 da57cef

Please sign in to comment.