Mercurial > hg > qm-dsp
diff dsp/chromagram/ConstantQ.cpp @ 468:a72d98f8baa3
Revise mechanism for extending chromagram to round number of octaves -
do it only in the chromagram itself, so that we can still create deviant
constant-Q spectrograms if desired
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Thu, 30 May 2019 11:35:35 +0100 |
parents | 46375e6d1b54 |
children | 8d84e5d16314 |
line wrap: on
line diff
--- a/dsp/chromagram/ConstantQ.cpp Wed May 29 15:56:30 2019 +0100 +++ b/dsp/chromagram/ConstantQ.cpp Thu May 30 11:35:35 2019 +0100 @@ -293,14 +293,14 @@ 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 = m_BPO * int(ceil(log(m_FMax/m_FMin)/log(2.0))); // No. of constant Q bins, extended to a full octave + m_uK = (unsigned int) ceil(m_BPO * log(m_FMax/m_FMin)/log(2.0)); // No. of constant Q bins // std::cerr << "ConstantQ::initialise: rate = " << m_FS << ", fmin = " << m_FMin << ", fmax = " << m_FMax << ", bpo = " << m_BPO << ", K = " << m_uK << ", Q = " << m_dQ << std::endl; // work out length of fft required for this constant Q Filter bank m_FFTLength = (int) pow(2, nextpow2(ceil( m_dQ*m_FS/m_FMin ))); - m_hop = m_FFTLength/8; // <------ hop size is window length divided by 32 + m_hop = m_FFTLength/8; // std::cerr << "ConstantQ::initialise: -> fft length = " << m_FFTLength << ", hop = " << m_hop << std::endl;