From 4c878340dfa15d27f9bc6f07af9fb2d05c04f085 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Wed, 25 May 2022 16:24:51 +0100 Subject: [PATCH] This is a little faster, and I can't tell the difference at first listen, nor think of a good reason why it should be worse. To be tested. --- src/finer/PhaseAdvance.h | 36 +++++++----------------------------- 1 file changed, 7 insertions(+), 29 deletions(-) diff --git a/src/finer/PhaseAdvance.h b/src/finer/PhaseAdvance.h index 69e2df8..fc3a479 100644 --- a/src/finer/PhaseAdvance.h +++ b/src/finer/PhaseAdvance.h @@ -127,27 +127,10 @@ public: nullptr); } - m_peakPicker.findNearestAndNextPeaks(m_prevInMag[c], - lowest, highest - lowest + 1, - 2, m_prevPeaks[c], - nullptr); - -/* - static int counter = 0; - if (c == 0) { - if (++counter > 140 && counter < 150) { - std::cout << "Magnitudes and peaks (fftSize = " << m_parameters.fftSize << "):" << std::endl; - for (int i = 0; i < bs; ++i) { - if (m_currentPeaks[c][i] == i) { - std::cout << "*"; - } - std::cout << mag[c][i] << ", "; - } - std::cout << std::endl; - } - } -*/ - +// m_peakPicker.findNearestAndNextPeaks(m_prevInMag[c], +// lowest, highest - lowest + 1, +// 2, m_prevPeaks[c], +// nullptr); } if (channels > 1) { @@ -230,15 +213,10 @@ public: m_prevOutPhase[c][i] = outPhase[c][i]; } } - - //!!! NB in the original we use a different value of p for - //!!! peak-picking the prior magnitudes - this isn't carried - //!!! over here - it is now but I don't think this was the - //!!! full cause of our burbling -// int **tmp = m_prevPeaks; -// m_prevPeaks = m_currentPeaks; -// m_currentPeaks = tmp; + int **tmp = m_prevPeaks; + m_prevPeaks = m_currentPeaks; + m_currentPeaks = tmp; } protected: