c@225: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ c@225: c@225: /* c@225: QM DSP Library c@225: c@225: Centre for Digital Music, Queen Mary, University of London. c@225: This file copyright 2005-2006 Christian Landone. c@225: All rights reserved. c@225: */ c@225: c@225: #ifndef CHROMAGRAM_H c@225: #define CHROMAGRAM_H c@225: c@225: #include "dsp/transforms/FFT.h" c@225: #include "ConstantQ.h" c@225: c@225: struct ChromaConfig{ c@225: unsigned int FS; c@225: double min; c@225: double max; c@225: unsigned int BPO; c@225: double CQThresh; c@225: bool isNormalised; c@225: }; c@225: c@225: class Chromagram c@225: { c@225: c@225: public: c@225: Chromagram( ChromaConfig Config ); c@225: ~Chromagram(); c@225: c@225: double* process( double *data ); c@225: void unityNormalise( double* src ); c@225: c@225: // Complex arithmetic c@225: double kabs( double real, double imag ); c@225: c@225: // Results c@225: unsigned int getK() { return m_uK;} c@225: unsigned int getFrameSize() { return m_frameSize; } c@225: unsigned int getHopSize() { return m_hopSize; } c@225: c@225: private: c@225: int initialise( ChromaConfig Config ); c@225: int deInitialise(); c@225: c@225: double* m_chromadata; c@225: double m_FMin; c@225: double m_FMax; c@225: unsigned int m_BPO; c@225: unsigned int m_uK; c@225: c@225: bool isNormalised; c@225: c@225: unsigned int m_frameSize; c@225: unsigned int m_hopSize; c@225: c@225: FFT* m_FFT; c@225: ConstantQ* m_ConstantQ; c@225: c@225: double* m_FFTRe; c@225: double* m_FFTIm; c@225: double* m_CQRe; c@225: double* m_CQIm; c@225: c@225: }; c@225: c@225: #endif