Ardour  8.7-15-gadf511264b
Chromagram.h
Go to the documentation of this file.
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 2005-2006 Christian Landone.
8 
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.
14 */
15 
16 #ifndef CHROMAGRAM_H
17 #define CHROMAGRAM_H
18 
19 #include "dsp/transforms/FFT.h"
20 #include "base/Window.h"
21 #include "ConstantQ.h"
22 
23 struct ChromaConfig{
24  int FS;
25  double min;
26  double max;
27  int BPO;
28  double CQThresh;
30 };
31 
32 class Chromagram
33 {
34 
35 public:
38 
39  double* process( const double *data ); // time domain
40  double* process( const double *real, const double *imag ); // frequency domain
41  void unityNormalise( double* src );
42 
43  // Complex arithmetic
44  double kabs( double real, double imag );
45 
46  // Results
47  int getK() { return m_uK;}
48  int getFrameSize() { return m_frameSize; }
49  int getHopSize() { return m_hopSize; }
50 
51 private:
53  int deInitialise();
54 
56  double *m_windowbuf;
57 
58  double* m_chromadata;
59  double m_FMin;
60  double m_FMax;
61  int m_BPO;
62  int m_uK;
63 
65 
67  int m_hopSize;
68 
71 
72  double* m_FFTRe;
73  double* m_FFTIm;
74  double* m_CQRe;
75  double* m_CQIm;
76 
78 };
79 
80 #endif
Chromagram(ChromaConfig Config)
double * m_FFTIm
Definition: Chromagram.h:73
int getHopSize()
Definition: Chromagram.h:49
double * m_CQRe
Definition: Chromagram.h:74
double m_FMin
Definition: Chromagram.h:59
double * process(const double *real, const double *imag)
double * m_CQIm
Definition: Chromagram.h:75
double kabs(double real, double imag)
int m_hopSize
Definition: Chromagram.h:67
ConstantQ * m_ConstantQ
Definition: Chromagram.h:70
bool m_skGenerated
Definition: Chromagram.h:77
double * m_windowbuf
Definition: Chromagram.h:56
double * m_FFTRe
Definition: Chromagram.h:72
int deInitialise()
double * process(const double *data)
Window< double > * m_window
Definition: Chromagram.h:55
int m_frameSize
Definition: Chromagram.h:66
int getK()
Definition: Chromagram.h:47
FFTReal * m_FFT
Definition: Chromagram.h:69
int initialise(ChromaConfig Config)
double * m_chromadata
Definition: Chromagram.h:58
int getFrameSize()
Definition: Chromagram.h:48
MathUtilities::NormaliseType m_normalise
Definition: Chromagram.h:64
void unityNormalise(double *src)
double m_FMax
Definition: Chromagram.h:60
Definition: FFT.h:53
RCConfiguration * Config
double CQThresh
Definition: Chromagram.h:28
double max
Definition: Chromagram.h:26
MathUtilities::NormaliseType normalise
Definition: Chromagram.h:29
double min
Definition: Chromagram.h:25