1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
6 Centre for Digital Music, Queen Mary, University of London.
7 This file 2005-2006 Christian Landone.
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information.
20 #include "maths/MathAliases.h"
21 #include "maths/MathUtilities.h"
24 unsigned int FS
; // samplerate
25 double min
; // minimum frequency
26 double max
; // maximum frequency
27 unsigned int BPO
; // bins per octave
28 double CQThresh
; // threshold
33 //public functions incl. sparsekernel so can keep out of loop in main
35 void process( const double* FFTRe
, const double* FFTIm
,
36 double* CQRe
, double* CQIm
);
38 ConstantQ( CQConfig Config
);
41 double* process( const double* FFTData
);
45 double hamming(int len
, int n
) {
46 double out
= 0.54 - 0.46*cos(2*PI
*n
/len
);
50 int getnumwin() { return m_numWin
;}
51 double getQ() { return m_dQ
;}
52 int getK() {return m_uK
;}
53 int getfftlength() { return m_FFTLength
;}
54 int gethop() { return m_hop
;}
57 void initialise( CQConfig Config
);
66 unsigned int m_numWin
;
69 unsigned int m_FFTLength
;
73 std::vector
<unsigned> is
;
74 std::vector
<unsigned> js
;
75 std::vector
<double> imag
;
76 std::vector
<double> real
;
79 SparseKernel
*m_sparseKernel
;