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@309: This file 2005-2006 Christian Landone. c@309: c@309: This program is free software; you can redistribute it and/or c@309: modify it under the terms of the GNU General Public License as c@309: published by the Free Software Foundation; either version 2 of the c@309: License, or (at your option) any later version. See the file c@309: COPYING included with this distribution for more information. c@225: */ c@225: cannam@489: #ifndef QM_DSP_CONSTANTQ_H cannam@489: #define QM_DSP_CONSTANTQ_H c@225: c@225: #include c@241: #include "maths/MathAliases.h" c@241: #include "maths/MathUtilities.h" c@225: cannam@465: struct CQConfig { cannam@465: double FS; // samplerate c@245: double min; // minimum frequency c@245: double max; // maximum frequency c@245: unsigned int BPO; // bins per octave c@245: double CQThresh; // threshold c@225: }; c@225: cannam@483: class ConstantQ cannam@483: { c@225: public: cannam@495: ConstantQ(CQConfig config); c@225: ~ConstantQ(); c@225: cannam@495: void process(const double* FFTRe, const double* FFTIm, cannam@495: double* CQRe, double* CQIm); cannam@495: cannam@495: double* process(const double* FFTData); c@225: c@225: void sparsekernel(); c@225: cannam@495: double getQ() { return m_dQ; } cannam@495: int getK() { return m_uK; } cannam@495: int getFFTLength() { return m_FFTLength; } cannam@495: int getHop() { return m_hop; } c@225: c@225: private: cannam@495: void initialise(CQConfig config); c@225: void deInitialise(); cannam@483: c@225: double* m_CQdata; cannam@465: double m_FS; c@225: double m_FMin; c@225: double m_FMax; c@225: double m_dQ; c@225: double m_CQThresh; cannam@495: int m_hop; cannam@495: int m_BPO; cannam@495: int m_FFTLength; cannam@495: int m_uK; c@276: c@276: struct SparseKernel { cannam@495: std::vector is; cannam@495: std::vector js; c@276: std::vector imag; c@276: std::vector real; c@276: }; c@276: c@276: SparseKernel *m_sparseKernel; c@225: }; c@225: c@225: c@225: #endif//CONSTANTQ_H c@225: