comparison dsp/chromagram/ConstantQ.h @ 225:49844bc8a895

* Queen Mary C++ DSP library
author Chris Cannam <c.cannam@qmul.ac.uk>
date Wed, 05 Apr 2006 17:35:59 +0000
parents
children 2e3f5d2d62c1
comparison
equal deleted inserted replaced
-1:000000000000 225:49844bc8a895
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 QM DSP Library
5
6 Centre for Digital Music, Queen Mary, University of London.
7 This file copyright 2005-2006 Christian Landone.
8 All rights reserved.
9 */
10
11 #ifndef CONSTANTQ_H
12 #define CONSTANTQ_H
13
14 #include <vector>
15 #include "dsp/maths/MathAliases.h"
16 #include "dsp/maths/MathUtilities.h"
17
18 struct CQConfig{
19 unsigned int FS;
20 double min;
21 double max;
22 unsigned int BPO;
23 double CQThresh;
24 };
25
26 class ConstantQ {
27
28 //public functions incl. sparsekernel so can keep out of loop in main
29 public:
30 void process( double* FFTRe, double* FFTIm, double* CQRe, double* CQIm );
31
32 ConstantQ( CQConfig Config );
33 ~ConstantQ();
34
35 double* process( double* FFTData );
36
37 void sparsekernel();
38
39 double hamming(int len, int n) {
40 double out = 0.54 - 0.46*cos(2*PI*n/len);
41 return(out);
42 }
43
44 int getnumwin() { return m_numWin;}
45 double getQ() { return m_dQ;}
46 int getK() {return m_uK ;}
47 int getfftlength() { return m_FFTLength;}
48 int gethop() { return m_hop;}
49
50 private:
51 void initialise( CQConfig Config );
52 void deInitialise();
53
54 double* m_CQdata;
55 unsigned int m_FS;
56 double m_FMin;
57 double m_FMax;
58 double m_dQ;
59 double m_CQThresh;
60 unsigned int m_numWin;
61 unsigned int m_hop;
62 unsigned int m_BPO;
63 unsigned int m_FFTLength;
64 unsigned int m_uK;
65 std::vector<unsigned> m_sparseKernelIs;
66 std::vector<unsigned> m_sparseKernelJs;
67 std::vector<double> m_sparseKernelImagValues;
68 std::vector<double> m_sparseKernelRealValues;
69 };
70
71
72 #endif//CONSTANTQ_H
73