# HG changeset patch # User Chris Cannam # Date 1400060480 -3600 # Node ID ef7b8d9363c03b9a86a2310cef01317f6be6c375 # Parent b5ec88e05a658fb369c28f25c6064386987d7b1e Tail padding fix diff -r b5ec88e05a65 -r ef7b8d9363c0 cpp-qm-dsp/CQInverse.cpp --- a/cpp-qm-dsp/CQInverse.cpp Wed May 14 10:30:49 2014 +0100 +++ b/cpp-qm-dsp/CQInverse.cpp Wed May 14 10:41:20 2014 +0100 @@ -286,8 +286,10 @@ CQInverse::RealSequence CQInverse::getRemainingOutput() { - for (int i = 0; i < (m_p.fftSize - m_p.fftHop) / m_p.fftHop; ++i) { - for (int j = 0; j < m_octaves; ++j) { + for (int j = 0; j < m_octaves; ++j) { + int factor = pow(2, j); + int latency = (j > 0 ? m_upsamplers[j]->getLatency() : 0) / factor; + for (int i = 0; i < (latency + m_p.fftSize) / m_p.fftHop; ++i) { overlapAddAndResample(j, RealSequence(m_olaBufs[j].size(), 0)); } }