comparison dsp/tonal/ChangeDetectionFunction.h @ 505:930b5b0f707d

Merge branch 'codestyle-and-tidy'
author Chris Cannam <cannam@all-day-breakfast.com>
date Wed, 05 Jun 2019 12:55:15 +0100
parents bb78ca3fe7de
children
comparison
equal deleted inserted replaced
471:e3335cb213da 505:930b5b0f707d
11 published by the Free Software Foundation; either version 2 of the 11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file 12 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information. 13 COPYING included with this distribution for more information.
14 */ 14 */
15 15
16 #ifndef _CHANGEDETECTIONFUNCTION_ 16 #ifndef QM_DSP_CHANGEDETECTIONFUNCTION_H
17 #define _CHANGEDETECTIONFUNCTION_ 17 #define QM_DSP_CHANGEDETECTIONFUNCTION_H
18
19 //#define DEBUG_CHANGE_DETECTION_FUNCTION 1
20 18
21 #include "TCSgram.h" 19 #include "TCSgram.h"
22 20
23 #include <valarray> 21 #include <valarray>
24 using std::valarray;
25 22
26 typedef valarray<double> ChangeDistance; 23 typedef std::valarray<double> ChangeDistance;
27 24
28 struct ChangeDFConfig 25 struct ChangeDFConfig
29 { 26 {
30 int smoothingWidth; 27 int smoothingWidth;
31 }; 28 };
32 29
33 class ChangeDetectionFunction 30 class ChangeDetectionFunction
34 { 31 {
35 public: 32 public:
36 ChangeDetectionFunction(ChangeDFConfig); 33 ChangeDetectionFunction(ChangeDFConfig);
37 ~ChangeDetectionFunction(); 34 ~ChangeDetectionFunction();
38 ChangeDistance process(const TCSGram& rTCSGram); 35 ChangeDistance process(const TCSGram& rTCSGram);
39 private: 36 private:
40 void setFilterWidth(const int iWidth); 37 void setFilterWidth(const int iWidth);
41 38
42 private: 39 private:
43 valarray<double> m_vaGaussian; 40 std::valarray<double> m_vaGaussian;
44 double m_dFilterSigma; 41 double m_dFilterSigma;
45 int m_iFilterWidth; 42 int m_iFilterWidth;
46 }; 43 };
47 44
48 #endif // _CHANGDETECTIONFUNCTION_ 45 #endif // _CHANGDETECTIONFUNCTION_