Mercurial > hg > qm-dsp
changeset 162:a2b3fd07d862
Avoid pathological FFT length of 1 in plugin tester
author | Chris Cannam |
---|---|
date | Tue, 03 Dec 2013 10:16:49 +0000 |
parents | fe7552b4f80a |
children | 4f092806782b |
files | dsp/tempotracking/DownBeat.cpp |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
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];