# HG changeset patch # User Chris Cannam # Date 1386065809 0 # Node ID a2b3fd07d8627c4918e2a1d5fef8c19a171725aa # Parent fe7552b4f80ab9ecc58abb395850588c24e37a42 Avoid pathological FFT length of 1 in plugin tester diff -r fe7552b4f80a -r a2b3fd07d862 dsp/tempotracking/DownBeat.cpp --- 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];