diff dsp/tempotracking/DownBeat.cpp @ 387:00f66226db5b

Avoid pathological FFT length of 1 in plugin tester
author Chris Cannam <c.cannam@qmul.ac.uk>
date Tue, 03 Dec 2013 10:16:49 +0000
parents 9c8ee77db9de
children 7e52c034cf62
line wrap: on
line diff
--- a/dsp/tempotracking/DownBeat.cpp	Tue Dec 03 10:02:46 2013 +0000
+++ b/dsp/tempotracking/DownBeat.cpp	Tue Dec 03 10:16:49 2013 +0000
@@ -44,7 +44,10 @@
     // 16x decimation, which is our expected normal situation)
     m_beatframesize = MathUtilities::nextPowerOfTwo
         (int((m_rate / decimationFactor) * 1.3));
-//    std::cerr << "rate = " << m_rate << ", bfs = " << m_beatframesize << std::endl;
+    if (m_beatframesize < 2) {
+        m_beatframesize = 2;
+    }
+//    std::cerr << "rate = " << m_rate << ", dec = " << decimationFactor << ", bfs = " << m_beatframesize << std::endl;
     m_beatframe = new double[m_beatframesize];
     m_fftRealOut = new double[m_beatframesize];
     m_fftImagOut = new double[m_beatframesize];