diff options
Diffstat (limited to 'lib/qm-dsp/dsp/chromagram/Chromagram.cpp')
-rw-r--r-- | lib/qm-dsp/dsp/chromagram/Chromagram.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/qm-dsp/dsp/chromagram/Chromagram.cpp b/lib/qm-dsp/dsp/chromagram/Chromagram.cpp index a8597a5ddd..2d6d8d194f 100644 --- a/lib/qm-dsp/dsp/chromagram/Chromagram.cpp +++ b/lib/qm-dsp/dsp/chromagram/Chromagram.cpp @@ -134,7 +134,7 @@ double* Chromagram::process( const double *data ) m_windowbuf = new double[m_frameSize]; } - for (int i = 0; i < m_frameSize; ++i) { + for (unsigned int i = 0; i < m_frameSize; ++i) { m_windowbuf[i] = data[i]; } m_window->cut(m_windowbuf); @@ -155,8 +155,6 @@ double* Chromagram::process( const double *real, const double *imag ) // initialise chromadata to 0 for (unsigned i = 0; i < m_BPO; i++) m_chromadata[i] = 0; - double cmax = 0.0; - double cval = 0; // Calculate ConstantQ frame m_ConstantQ->process( real, imag, m_CQRe, m_CQIm ); @@ -164,11 +162,11 @@ double* Chromagram::process( const double *real, const double *imag ) const unsigned octaves = (int)floor(double( m_uK/m_BPO))-1; for (unsigned octave = 0; octave <= octaves; octave++) { - unsigned firstBin = octave*m_BPO; - for (unsigned i = 0; i < m_BPO; i++) - { - m_chromadata[i] += kabs( m_CQRe[ firstBin + i ], m_CQIm[ firstBin + i ]); - } + unsigned firstBin = octave * m_BPO; + for (unsigned i = 0; i < m_BPO; i++) + { + m_chromadata[i] += kabs( m_CQRe[ firstBin + i ], m_CQIm[ firstBin + i ]); + } } MathUtilities::normalise(m_chromadata, m_BPO, m_normalise); |