annotate DrumTimingLoader_OF/chromagramm/Chromagram.h @ 3:303edbbcf1bd tip

updated ofxAubioOnsetDetection file
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Sun, 24 Nov 2013 08:15:17 +0000
parents 82352cfc0b23
children
rev   line source
andrew@0 1
andrew@0 2
andrew@0 3 #ifndef CHROMAGRAM_H
andrew@0 4 #define CHROMAGRAM_H
andrew@0 5
andrew@0 6 #include "fftw3.h"
andrew@0 7
andrew@0 8 class Chromagram
andrew@0 9 {
andrew@0 10 public:
andrew@0 11 Chromagram(); // constructor
andrew@0 12 ~Chromagram(); // destructor
andrew@0 13 void chromacalc(float frame[]);
andrew@0 14 void initialise(int framesize,int hsize);
andrew@0 15 void processframe(float frame[]);
andrew@0 16 // void processFrame(float* frame, int length);
andrew@0 17
andrew@0 18 float rawChroma[12];
andrew@0 19 float chroma[12];
andrew@0 20 float chroma_low[12];
andrew@0 21 int chromaready;
andrew@0 22
andrew@0 23 float maximumChromaValue;
andrew@0 24
andrew@0 25 int quantisedChromagram[12];
andrew@0 26 double getQuantisedDistance(float secondQuantisedChroma[12]);
andrew@0 27
andrew@0 28 private:
andrew@0 29 void hamming(int N);
andrew@0 30 void makeprofiles();
andrew@0 31 void getmagspectrum();
andrew@0 32 void generatechromagram();
andrew@0 33
andrew@0 34 void quantiseChromagram();//follows muller's method for quantising
andrew@0 35 //taking L1 norm, normalising to that, then looking at the bins
andrew@0 36
andrew@0 37 //float euclidean(float v1[],float v2[],int length);
andrew@0 38 float max(float array[],int length);
andrew@0 39 int minindex(float array[],int length);
andrew@0 40 void downsampleframe(float frame[]);
andrew@0 41
andrew@0 42 int bsize;
andrew@0 43 int count;
andrew@0 44 int hopsize;
andrew@0 45 int fsize;
andrew@0 46 int calcrate;
andrew@0 47 float ratio;
andrew@0 48
andrew@0 49 float *buffer; // audio buffer
andrew@0 50 float *wbuffer; // windowed audio buffer
andrew@0 51 float *win; // hanning window
andrew@0 52 float *mag;
andrew@0 53 float *d_frame;
andrew@0 54 float *hop;
andrew@0 55
andrew@0 56
andrew@0 57 float note[12];
andrew@0 58 int harmonics;
andrew@0 59 int octaves;
andrew@0 60 int search;
andrew@0 61
andrew@0 62 fftwf_plan p; // create fft plan
andrew@0 63 fftwf_complex *out; // to hold complex fft values
andrew@0 64
andrew@0 65 float pi;
andrew@0 66
andrew@0 67
andrew@0 68 };
andrew@0 69
andrew@0 70 #endif