Mercurial > hg > constant-q-cpp
diff src/ConstantQ.cpp @ 150:242bf7bc38ce
Avoid failing if min and max frequency are identical
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Thu, 10 Jul 2014 15:27:19 +0100 |
parents | 1060a19e2334 |
children | b34df30fd7e4 |
line wrap: on
line diff
--- a/src/ConstantQ.cpp Thu Jul 10 15:27:09 2014 +0100 +++ b/src/ConstantQ.cpp Thu Jul 10 15:27:19 2014 +0100 @@ -89,6 +89,12 @@ ConstantQ::initialise() { m_octaves = int(ceil(log2(m_maxFrequency / m_minFrequency))); + + if (m_octaves < 1) { + m_kernel = 0; // incidentally causing isValid() to return false + return; + } + m_kernel = new CQKernel(m_inparams); m_p = m_kernel->getProperties();