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  QM DSP Library
4 
5  Centre for Digital Music, Queen Mary, University of London.
6  This file 2005-2006 Christian Landone.
7 
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 2 of the
11  License, or (at your option) any later version. See the file
12  COPYING included with this distribution for more information.
13 */
14 
15 #ifndef QM_DSP_CHROMAGRAM_H
16 #define QM_DSP_CHROMAGRAM_H
17 
18 #include "dsp/transforms/FFT.h"
19 #include "base/Window.h"
20 #include "ConstantQ.h"
21 
22 struct ChromaConfig {
23  double FS;
24  double min;
25  double max;
26  int BPO;
27  double CQThresh;
29 };
30 
31 class Chromagram
32 {
33 public:
34  Chromagram( ChromaConfig Config );
35  ~Chromagram();
36 
47  double *process(const double *data);
48 
62  double *process(const double *real, const double *imag);
63 
64  void unityNormalise(double* src);
65 
66  // Complex arithmetic
67  double kabs( double real, double imag );
68 
69  // Results
70  int getK() { return m_uK;}
71  int getFrameSize() { return m_frameSize; }
72  int getHopSize() { return m_hopSize; }
73 
74 private:
75  int initialise( ChromaConfig Config );
76  int deInitialise();
77 
79  double *m_windowbuf;
80 
81  double* m_chromadata;
82  double m_FMin;
83  double m_FMax;
84  int m_BPO;
85  int m_uK;
86 
88 
90  int m_hopSize;
91 
94 
95  double* m_FFTRe;
96  double* m_FFTIm;
97  double* m_CQRe;
98  double* m_CQIm;
99 
101 };
102 
103 #endif
double CQThresh
Definition: Chromagram.h:27
double min
Definition: Chromagram.h:24
FFTReal * m_FFT
Definition: Chromagram.h:92
int m_hopSize
Definition: Chromagram.h:90
double max
Definition: Chromagram.h:25
MathUtilities::NormaliseType normalise
Definition: Chromagram.h:28
int m_frameSize
Definition: Chromagram.h:89
int getHopSize()
Definition: Chromagram.h:72
bool m_skGenerated
Definition: Chromagram.h:100
MathUtilities::NormaliseType m_normalise
Definition: Chromagram.h:87
double * m_CQRe
Definition: Chromagram.h:97
double * m_chromadata
Definition: Chromagram.h:81
double m_FMin
Definition: Chromagram.h:82
double FS
Definition: Chromagram.h:23
int getK()
Definition: Chromagram.h:70
ConstantQ * m_ConstantQ
Definition: Chromagram.h:93
int getFrameSize()
Definition: Chromagram.h:71
Definition: FFT.h:52
Window< double > * m_window
Definition: Chromagram.h:78
double * m_FFTRe
Definition: Chromagram.h:95
double * m_FFTIm
Definition: Chromagram.h:96
double m_FMax
Definition: Chromagram.h:83
double * m_windowbuf
Definition: Chromagram.h:79
double * m_CQIm
Definition: Chromagram.h:98