diff dsp/chromagram/ConstantQ.cpp @ 466:46375e6d1b54

Apply fix from daschuer/mixxx:b9c6bde3 Extend the number of Q bins always to a full octave
author Chris Cannam <cannam@all-day-breakfast.com>
date Wed, 29 May 2019 14:08:43 +0100
parents d5014ab8b0e5
children a72d98f8baa3
line wrap: on
line diff
--- a/dsp/chromagram/ConstantQ.cpp	Wed May 29 13:55:26 2019 +0100
+++ b/dsp/chromagram/ConstantQ.cpp	Wed May 29 14:08:43 2019 +0100
@@ -293,7 +293,7 @@
     m_CQThresh = Config.CQThresh;// ConstantQ threshold for kernel generation
 
     m_dQ = 1/(pow(2,(1/(double)m_BPO))-1);	// Work out Q value for Filter bank
-    m_uK = (unsigned int) ceil(m_BPO * log(m_FMax/m_FMin)/log(2.0));	// No. of constant Q bins
+    m_uK = m_BPO * int(ceil(log(m_FMax/m_FMin)/log(2.0)));	// No. of constant Q bins, extended to a full octave
 
 //    std::cerr << "ConstantQ::initialise: rate = " << m_FS << ", fmin = " << m_FMin << ", fmax = " << m_FMax << ", bpo = " << m_BPO << ", K = " << m_uK << ", Q = " << m_dQ << std::endl;