Chris@26: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@26: Chris@42: /* Chris@42: Tipic Chris@42: Chris@42: Centre for Digital Music, Queen Mary, University of London. Chris@42: Chris@42: This program is free software; you can redistribute it and/or Chris@42: modify it under the terms of the GNU General Public License as Chris@42: published by the Free Software Foundation; either version 2 of the Chris@42: License, or (at your option) any later version. See the file Chris@42: COPYING included with this distribution for more information. Chris@42: */ Chris@42: Chris@26: #ifndef CHROMA_H Chris@26: #define CHROMA_H Chris@26: Chris@26: #include "Types.h" Chris@26: Chris@57: /** Chris@57: * Turn features obtained from a PitchFilterbank into pitch chroma Chris@57: * features (without the timbre-invariant DCT step used for CRP Chris@57: * features). No downsampling/smoothing is applied. Chris@57: * Chris@57: * This class retains no internal history, so a single instance could Chris@57: * be used for multiple channels at once, interleaved, within a single Chris@57: * thread. It is not thread-safe. Chris@57: */ Chris@26: class Chroma Chris@26: { Chris@26: public: Chris@26: struct Parameters { Chris@26: bool applyLogCompression; Chris@26: double logFactor; Chris@26: double logAddTerm; Chris@26: int normP; // 0 = no normalisation, 1 = L^1, 2 = L^2 Chris@26: double normThresh; Chris@26: Parameters() : Chris@26: applyLogCompression(false), Chris@26: logFactor(100.0), Chris@26: logAddTerm(1.0), Chris@26: normP(2), Chris@26: normThresh(1e-6) Chris@26: { } Chris@26: }; Chris@26: Chris@35: Chroma(Parameters params); Chris@26: ~Chroma(); Chris@26: Chris@26: RealBlock process(const RealBlock &in); Chris@26: Chris@26: private: Chris@26: Parameters m_params; Chris@26: }; Chris@26: Chris@26: #endif Chris@26: