DSPEngine: speed optimisation

This commit is contained in:
Christian Daniel 2012-06-05 15:23:43 +02:00
parent 22faf7b354
commit 4ec4449fcc
1 changed files with 1 additions and 1 deletions

View File

@ -177,7 +177,7 @@ void DSPEngine::work()
// extract power spectrum and reorder buckets
for(int i = 0; i < m_fftSize; i++) {
Complex c = m_fftOut[((i + m_fftOut.size() / 2) % m_fftOut.size())];
Complex c = m_fftOut[((i + (m_fftOut.size() >> 1)) & (m_fftOut.size() - 1))];
Real v = sqrt(c.real() * c.real() + c.imag() * c.imag());
v /= (Real)m_fftSize;
v = 20.0 * log10(v);