Mercurial > hg > qm-dsp
comparison 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 |
comparison
equal
deleted
inserted
replaced
465:50a97c8d52ed | 466:46375e6d1b54 |
---|---|
291 m_FMax = Config.max; // max freq | 291 m_FMax = Config.max; // max freq |
292 m_BPO = Config.BPO; // bins per octave | 292 m_BPO = Config.BPO; // bins per octave |
293 m_CQThresh = Config.CQThresh;// ConstantQ threshold for kernel generation | 293 m_CQThresh = Config.CQThresh;// ConstantQ threshold for kernel generation |
294 | 294 |
295 m_dQ = 1/(pow(2,(1/(double)m_BPO))-1); // Work out Q value for Filter bank | 295 m_dQ = 1/(pow(2,(1/(double)m_BPO))-1); // Work out Q value for Filter bank |
296 m_uK = (unsigned int) ceil(m_BPO * log(m_FMax/m_FMin)/log(2.0)); // No. of constant Q bins | 296 m_uK = m_BPO * int(ceil(log(m_FMax/m_FMin)/log(2.0))); // No. of constant Q bins, extended to a full octave |
297 | 297 |
298 // std::cerr << "ConstantQ::initialise: rate = " << m_FS << ", fmin = " << m_FMin << ", fmax = " << m_FMax << ", bpo = " << m_BPO << ", K = " << m_uK << ", Q = " << m_dQ << std::endl; | 298 // std::cerr << "ConstantQ::initialise: rate = " << m_FS << ", fmin = " << m_FMin << ", fmax = " << m_FMax << ", bpo = " << m_BPO << ", K = " << m_uK << ", Q = " << m_dQ << std::endl; |
299 | 299 |
300 // work out length of fft required for this constant Q Filter bank | 300 // work out length of fft required for this constant Q Filter bank |
301 m_FFTLength = (int) pow(2, nextpow2(ceil( m_dQ*m_FS/m_FMin ))); | 301 m_FFTLength = (int) pow(2, nextpow2(ceil( m_dQ*m_FS/m_FMin ))); |