comparison dsp/chromagram/ConstantQ.h @ 495:1bea13b8f951

Style fixes in constant-Q: avoid unsigned, reuse our Window class, fix comments
author Chris Cannam <cannam@all-day-breakfast.com>
date Fri, 31 May 2019 18:25:31 +0100
parents 701233f8ed41
children af5b7ef02aa7
comparison
equal deleted inserted replaced
494:3f649fbb1172 495:1bea13b8f951
29 }; 29 };
30 30
31 class ConstantQ 31 class ConstantQ
32 { 32 {
33 public: 33 public:
34 void process( const double* FFTRe, const double* FFTIm, 34 ConstantQ(CQConfig config);
35 double* CQRe, double* CQIm );
36
37 ConstantQ( CQConfig Config );
38 ~ConstantQ(); 35 ~ConstantQ();
39 36
40 double* process( const double* FFTData ); 37 void process(const double* FFTRe, const double* FFTIm,
38 double* CQRe, double* CQIm);
39
40 double* process(const double* FFTData);
41 41
42 void sparsekernel(); 42 void sparsekernel();
43 43
44 double hamming(int len, int n) { 44 double getQ() { return m_dQ; }
45 double out = 0.54 - 0.46*cos(2*M_PI*n/len); 45 int getK() { return m_uK; }
46 return(out); 46 int getFFTLength() { return m_FFTLength; }
47 } 47 int getHop() { return m_hop; }
48
49 int getnumwin() { return m_numWin;}
50 double getQ() { return m_dQ;}
51 int getK() {return m_uK ;}
52 int getfftlength() { return m_FFTLength;}
53 int gethop() { return m_hop;}
54 48
55 private: 49 private:
56 void initialise( CQConfig Config ); 50 void initialise(CQConfig config);
57 void deInitialise(); 51 void deInitialise();
58 52
59 double* m_CQdata; 53 double* m_CQdata;
60 double m_FS; 54 double m_FS;
61 double m_FMin; 55 double m_FMin;
62 double m_FMax; 56 double m_FMax;
63 double m_dQ; 57 double m_dQ;
64 double m_CQThresh; 58 double m_CQThresh;
65 unsigned int m_numWin; 59 int m_hop;
66 unsigned int m_hop; 60 int m_BPO;
67 unsigned int m_BPO; 61 int m_FFTLength;
68 unsigned int m_FFTLength; 62 int m_uK;
69 unsigned int m_uK;
70 63
71 struct SparseKernel { 64 struct SparseKernel {
72 std::vector<unsigned> is; 65 std::vector<int> is;
73 std::vector<unsigned> js; 66 std::vector<int> js;
74 std::vector<double> imag; 67 std::vector<double> imag;
75 std::vector<double> real; 68 std::vector<double> real;
76 }; 69 };
77 70
78 SparseKernel *m_sparseKernel; 71 SparseKernel *m_sparseKernel;