annotate dsp/keydetection/GetKeyMode.h @ 7:85a9e268a8c4

* Add key mode detector
author cannam
date Mon, 11 Dec 2006 09:48:33 +0000
parents
children 381758cfbe64
rev   line source
cannam@7 1 /*
cannam@7 2 * Author: c.landone
cannam@7 3 * Description:
cannam@7 4 *
cannam@7 5 * Syntax: C++
cannam@7 6 *
cannam@7 7 * Copyright (c) 2005 Centre for Digital Music ( C4DM )
cannam@7 8 * Queen Mary Univesrity of London
cannam@7 9 *
cannam@7 10 *
cannam@7 11 * This program is not free software; you cannot redistribute it
cannam@7 12 * without the explicit authorization from the centre for digital music,
cannam@7 13 * queen mary university of london
cannam@7 14 *
cannam@7 15 */
cannam@7 16
cannam@7 17 #if !defined GETKEYMODE_H
cannam@7 18 #define GETKEYMODE_H
cannam@7 19
cannam@7 20
cannam@7 21 #include "dsp/rateconversion/Decimator.h"
cannam@7 22 #include "dsp/chromagram/Chromagram.h"
cannam@7 23
cannam@7 24
cannam@7 25 class GetKeyMode
cannam@7 26 {
cannam@7 27 public:
cannam@7 28 GetKeyMode( double hpcpAverage, double medianAverage );
cannam@7 29
cannam@7 30 virtual ~GetKeyMode();
cannam@7 31
cannam@7 32 int process( double* PCMData );
cannam@7 33
cannam@7 34 double krumCorr( double* pData1, double* pData2, unsigned int length );
cannam@7 35
cannam@7 36 unsigned int getBlockSize() { return m_ChromaFrameSize*m_DecimationFactor; }
cannam@7 37 unsigned int getHopSize() { return m_ChromaHopSize*m_DecimationFactor; }
cannam@7 38
cannam@7 39 double* getChroma() { return m_ChrPointer; }
cannam@7 40 unsigned int getChromaSize() { return m_BPO; }
cannam@7 41
cannam@7 42 double* getMeanHPCP() { return m_MeanHPCP; }
cannam@7 43
cannam@7 44 int isModeMinor( int key );
cannam@7 45
cannam@7 46 protected:
cannam@7 47
cannam@7 48 double m_hpcpAverage;
cannam@7 49 double m_medianAverage;
cannam@7 50 unsigned int m_DecimationFactor;
cannam@7 51
cannam@7 52 //Decimator (fixed)
cannam@7 53 Decimator* m_Decimator;
cannam@7 54
cannam@7 55 //chroma configuration
cannam@7 56 ChromaConfig m_CromaConfig;
cannam@7 57
cannam@7 58 //Chromagram object
cannam@7 59 Chromagram* m_Chroma;
cannam@7 60
cannam@7 61 //Chromagram output pointer
cannam@7 62 double* m_ChrPointer;
cannam@7 63
cannam@7 64 //Framesize
cannam@7 65 unsigned int m_ChromaFrameSize;
cannam@7 66 //Hop
cannam@7 67 unsigned int m_ChromaHopSize;
cannam@7 68 //Bins per octave
cannam@7 69 unsigned int m_BPO;
cannam@7 70
cannam@7 71
cannam@7 72 unsigned int m_ChromaBuffersize;
cannam@7 73 unsigned int m_MedianWinsize;
cannam@7 74
cannam@7 75 unsigned int m_bufferindex;
cannam@7 76 unsigned int m_ChromaBufferFilling;
cannam@7 77 unsigned int m_MedianBufferFilling;
cannam@7 78
cannam@7 79
cannam@7 80 double* m_DecimatedBuffer;
cannam@7 81 double* m_ChromaBuffer;
cannam@7 82 double* m_MeanHPCP;
cannam@7 83
cannam@7 84 double* m_MajCorr;
cannam@7 85 double* m_MinCorr;
cannam@7 86 double* m_Keys;
cannam@7 87 int* m_MedianFilterBuffer;
cannam@7 88 int* m_SortedBuffer;
cannam@7 89 };
cannam@7 90
cannam@7 91 #endif // !defined GETKEYMODE_H