comparison dsp/keydetection/GetKeyMode.h @ 505:930b5b0f707d

Merge branch 'codestyle-and-tidy'
author Chris Cannam <cannam@all-day-breakfast.com>
date Wed, 05 Jun 2019 12:55:15 +0100
parents af5b7ef02aa7
children 3f0a96460c33
comparison
equal deleted inserted replaced
471:e3335cb213da 505:930b5b0f707d
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
1 /* 2 /*
2 Copyright (c) 2005 Centre for Digital Music ( C4DM ) 3 Copyright (c) 2005 Centre for Digital Music ( C4DM )
3 Queen Mary Univesrity of London 4 Queen Mary Univesrity of London
4 5
5 This program is free software; you can redistribute it and/or 6 This program is free software; you can redistribute it and/or
7 published by the Free Software Foundation; either version 2 of the 8 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version. See the file 9 License, or (at your option) any later version. See the file
9 COPYING included with this distribution for more information. 10 COPYING included with this distribution for more information.
10 */ 11 */
11 12
12 #ifndef GETKEYMODE_H 13 #ifndef QM_DSP_GETKEYMODE_H
13 #define GETKEYMODE_H 14 #define QM_DSP_GETKEYMODE_H
14 15
15 16
16 #include "dsp/rateconversion/Decimator.h" 17 #include "dsp/rateconversion/Decimator.h"
17 #include "dsp/chromagram/Chromagram.h" 18 #include "dsp/chromagram/Chromagram.h"
18 19
19 20
20 class GetKeyMode 21 class GetKeyMode
21 { 22 {
22 public: 23 public:
23 GetKeyMode( int sampleRate, float tuningFrequency, 24 GetKeyMode( int sampleRate, float tuningFrequency,
24 double hpcpAverage, double medianAverage ); 25 double hpcpAverage, double medianAverage );
25 26
26 virtual ~GetKeyMode(); 27 virtual ~GetKeyMode();
27 28
28 int process( double* PCMData ); 29 int process( double* PCMData );
29 30
30 double krumCorr( const double *pDataNorm, const double *pProfileNorm, 31 double krumCorr( const double *pDataNorm, const double *pProfileNorm,
31 int shiftProfile, unsigned int length ); 32 int shiftProfile, int length );
32 33
33 unsigned int getBlockSize() { return m_ChromaFrameSize*m_DecimationFactor; } 34 int getBlockSize() { return m_chromaFrameSize * m_decimationFactor; }
34 unsigned int getHopSize() { return m_ChromaHopSize*m_DecimationFactor; } 35 int getHopSize() { return m_chromaHopSize * m_decimationFactor; }
35 36
36 double* getChroma() { return m_ChrPointer; } 37 double* getChroma() { return m_chrPointer; }
37 unsigned int getChromaSize(); 38 int getChromaSize();
38 39
39 double* getMeanHPCP() { return m_MeanHPCP; } 40 double* getMeanHPCP() { return m_meanHPCP; }
40 41
41 double* getKeyStrengths(); 42 double* getKeyStrengths();
42 43
43 bool isModeMinor( int key ); 44 bool isModeMinor( int key );
44 45
45 protected: 46 protected:
46 47
47 double m_hpcpAverage; 48 double m_hpcpAverage;
48 double m_medianAverage; 49 double m_medianAverage;
49 unsigned int m_DecimationFactor; 50 int m_decimationFactor;
50 51
51 //Decimator (fixed) 52 // Decimator (fixed)
52 Decimator* m_Decimator; 53 Decimator* m_decimator;
53 54
54 //chroma configuration 55 // Chroma configuration
55 ChromaConfig m_ChromaConfig; 56 ChromaConfig m_chromaConfig;
56 57
57 //Chromagram object 58 // Chromagram object
58 Chromagram* m_Chroma; 59 Chromagram* m_chroma;
59 60
60 //Chromagram output pointer 61 // Chromagram output pointer
61 double* m_ChrPointer; 62 double* m_chrPointer;
62 63
63 //Framesize 64 // Framesize
64 unsigned int m_ChromaFrameSize; 65 int m_chromaFrameSize;
65 //Hop
66 unsigned int m_ChromaHopSize;
67 66
67 // Hop
68 int m_chromaHopSize;
68 69
69 unsigned int m_ChromaBuffersize; 70 int m_chromaBufferSize;
70 unsigned int m_MedianWinsize; 71 int m_medianWinSize;
71 72
72 unsigned int m_bufferindex; 73 int m_bufferIndex;
73 unsigned int m_ChromaBufferFilling; 74 int m_chromaBufferFilling;
74 unsigned int m_MedianBufferFilling; 75 int m_medianBufferFilling;
75
76 76
77 double* m_DecimatedBuffer; 77 double* m_decimatedBuffer;
78 double* m_ChromaBuffer; 78 double* m_chromaBuffer;
79 double* m_MeanHPCP; 79 double* m_meanHPCP;
80 80
81 double* m_MajProfileNorm; 81 double* m_majProfileNorm;
82 double* m_MinProfileNorm; 82 double* m_minProfileNorm;
83 double* m_MajCorr; 83 double* m_majCorr;
84 double* m_MinCorr; 84 double* m_minCorr;
85 int* m_MedianFilterBuffer; 85 int* m_medianFilterBuffer;
86 int* m_SortedBuffer; 86 int* m_sortedBuffer;
87 87
88 double *m_keyStrengths; 88 double *m_keyStrengths;
89 }; 89 };
90 90
91 #endif // !defined GETKEYMODE_H 91 #endif // !defined QM_DSP_GETKEYMODE_H