# HG changeset patch # User cannam # Date 1147705647 0 # Node ID 07ac3de1e53be2122e9eae141225f86e5a458dc5 # Parent c539af5259dabeffe116c4b930bb8f0a7c733840 * Give the chromagram an alternative entry point passing in frequency domain data * Centre the Hamming windows and do an fftshift when calculating sparse kernel diff -r c539af5259da -r 07ac3de1e53b dsp/chromagram/Chromagram.cpp --- a/dsp/chromagram/Chromagram.cpp Mon May 15 11:21:47 2006 +0000 +++ b/dsp/chromagram/Chromagram.cpp Mon May 15 15:07:27 2006 +0000 @@ -113,25 +113,29 @@ double* Chromagram::process( double *data ) { - //initialise chromadata to 0 - for (unsigned i=0; iprocess( m_frameSize, 0, data, NULL, m_FFTRe, m_FFTIm ); + + return process(m_FFTRe, m_FFTIm); +} + +double* Chromagram::process( double *real, 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; - // FFT of current frame - m_FFT->process( m_frameSize, 0, data, NULL, m_FFTRe, m_FFTIm ); - // Calculate ConstantQ frame - m_ConstantQ->process( m_FFTRe, m_FFTIm, m_CQRe, m_CQIm ); + m_ConstantQ->process( real, imag, m_CQRe, m_CQIm ); // add each octave of cq data into Chromagram const unsigned octaves = (int)floor(double( m_uK/m_BPO))-1; - for (unsigned octave=0; octave<=octaves; octave++) + for (unsigned octave = 0; octave <= octaves; octave++) { unsigned firstBin = octave*m_BPO; - for (unsigned i=0; i