Mercurial > hg > tipic
annotate src/Chroma.h @ 60:1ea2aed23d4a tip
Fix version
author | Chris Cannam |
---|---|
date | Thu, 13 Feb 2020 13:37:36 +0000 |
parents | 9eab1b374344 |
children |
rev | line source |
---|---|
Chris@26 | 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ |
Chris@26 | 2 |
Chris@42 | 3 /* |
Chris@42 | 4 Tipic |
Chris@42 | 5 |
Chris@42 | 6 Centre for Digital Music, Queen Mary, University of London. |
Chris@42 | 7 |
Chris@42 | 8 This program is free software; you can redistribute it and/or |
Chris@42 | 9 modify it under the terms of the GNU General Public License as |
Chris@42 | 10 published by the Free Software Foundation; either version 2 of the |
Chris@42 | 11 License, or (at your option) any later version. See the file |
Chris@42 | 12 COPYING included with this distribution for more information. |
Chris@42 | 13 */ |
Chris@42 | 14 |
Chris@26 | 15 #ifndef CHROMA_H |
Chris@26 | 16 #define CHROMA_H |
Chris@26 | 17 |
Chris@26 | 18 #include "Types.h" |
Chris@26 | 19 |
Chris@57 | 20 /** |
Chris@57 | 21 * Turn features obtained from a PitchFilterbank into pitch chroma |
Chris@57 | 22 * features (without the timbre-invariant DCT step used for CRP |
Chris@57 | 23 * features). No downsampling/smoothing is applied. |
Chris@57 | 24 * |
Chris@57 | 25 * This class retains no internal history, so a single instance could |
Chris@57 | 26 * be used for multiple channels at once, interleaved, within a single |
Chris@57 | 27 * thread. It is not thread-safe. |
Chris@57 | 28 */ |
Chris@26 | 29 class Chroma |
Chris@26 | 30 { |
Chris@26 | 31 public: |
Chris@26 | 32 struct Parameters { |
Chris@26 | 33 bool applyLogCompression; |
Chris@26 | 34 double logFactor; |
Chris@26 | 35 double logAddTerm; |
Chris@26 | 36 int normP; // 0 = no normalisation, 1 = L^1, 2 = L^2 |
Chris@26 | 37 double normThresh; |
Chris@26 | 38 Parameters() : |
Chris@26 | 39 applyLogCompression(false), |
Chris@26 | 40 logFactor(100.0), |
Chris@26 | 41 logAddTerm(1.0), |
Chris@26 | 42 normP(2), |
Chris@26 | 43 normThresh(1e-6) |
Chris@26 | 44 { } |
Chris@26 | 45 }; |
Chris@26 | 46 |
Chris@35 | 47 Chroma(Parameters params); |
Chris@26 | 48 ~Chroma(); |
Chris@26 | 49 |
Chris@26 | 50 RealBlock process(const RealBlock &in); |
Chris@26 | 51 |
Chris@26 | 52 private: |
Chris@26 | 53 Parameters m_params; |
Chris@26 | 54 }; |
Chris@26 | 55 |
Chris@26 | 56 #endif |
Chris@26 | 57 |