annotate dsp/keydetection/GetKeyMode.h @ 96:88f3cfcff55f

A threshold (delta) is added in the peak picking parameters structure (PPickParams). It is used as an offset when computing the smoothed detection function. A constructor for the structure PPickParams is also added to set the parameters to 0 when a structure instance is created. Hence programmes using the peak picking parameter structure and which do not set the delta parameter (e.g. QM Vamp note onset detector) won't be affected by the modifications. Functions modified: - dsp/onsets/PeakPicking.cpp - dsp/onsets/PeakPicking.h - dsp/signalconditioning/DFProcess.cpp - dsp/signalconditioning/DFProcess.h
author mathieub <mathieu.barthet@eecs.qmul.ac.uk>
date Mon, 20 Jun 2011 19:01:48 +0100
parents b4921bfd2aea
children 715f779d0b4f
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@40 17 #ifndef 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@9 28 GetKeyMode( int sampleRate, float tuningFrequency,
cannam@9 29 double hpcpAverage, double medianAverage );
cannam@7 30
cannam@7 31 virtual ~GetKeyMode();
cannam@7 32
cannam@7 33 int process( double* PCMData );
cannam@7 34
cannam@7 35 double krumCorr( double* pData1, double* pData2, unsigned int length );
cannam@7 36
cannam@7 37 unsigned int getBlockSize() { return m_ChromaFrameSize*m_DecimationFactor; }
cannam@7 38 unsigned int getHopSize() { return m_ChromaHopSize*m_DecimationFactor; }
cannam@7 39
cannam@7 40 double* getChroma() { return m_ChrPointer; }
cannam@7 41 unsigned int getChromaSize() { return m_BPO; }
cannam@7 42
cannam@7 43 double* getMeanHPCP() { return m_MeanHPCP; }
cannam@7 44
cannam@40 45 double *getKeyStrengths() { return m_keyStrengths; }
cannam@40 46
cannam@43 47 bool isModeMinor( int key );
cannam@7 48
cannam@7 49 protected:
cannam@7 50
cannam@7 51 double m_hpcpAverage;
cannam@7 52 double m_medianAverage;
cannam@7 53 unsigned int m_DecimationFactor;
cannam@7 54
cannam@7 55 //Decimator (fixed)
cannam@7 56 Decimator* m_Decimator;
cannam@7 57
cannam@7 58 //chroma configuration
cannam@9 59 ChromaConfig m_ChromaConfig;
cannam@7 60
cannam@7 61 //Chromagram object
cannam@7 62 Chromagram* m_Chroma;
cannam@7 63
cannam@7 64 //Chromagram output pointer
cannam@7 65 double* m_ChrPointer;
cannam@7 66
cannam@7 67 //Framesize
cannam@7 68 unsigned int m_ChromaFrameSize;
cannam@7 69 //Hop
cannam@7 70 unsigned int m_ChromaHopSize;
cannam@7 71 //Bins per octave
cannam@7 72 unsigned int m_BPO;
cannam@7 73
cannam@7 74
cannam@7 75 unsigned int m_ChromaBuffersize;
cannam@7 76 unsigned int m_MedianWinsize;
cannam@7 77
cannam@7 78 unsigned int m_bufferindex;
cannam@7 79 unsigned int m_ChromaBufferFilling;
cannam@7 80 unsigned int m_MedianBufferFilling;
cannam@7 81
cannam@7 82
cannam@7 83 double* m_DecimatedBuffer;
cannam@7 84 double* m_ChromaBuffer;
cannam@7 85 double* m_MeanHPCP;
cannam@7 86
cannam@7 87 double* m_MajCorr;
cannam@7 88 double* m_MinCorr;
cannam@7 89 double* m_Keys;
cannam@7 90 int* m_MedianFilterBuffer;
cannam@7 91 int* m_SortedBuffer;
cannam@40 92
cannam@40 93 double *m_keyStrengths;
cannam@7 94 };
cannam@7 95
cannam@7 96 #endif // !defined GETKEYMODE_H