Mercurial > hg > drum-timing-analyser
view 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 |
line wrap: on
line source
#ifndef CHROMAGRAM_H #define CHROMAGRAM_H #include "fftw3.h" class Chromagram { public: Chromagram(); // constructor ~Chromagram(); // destructor void chromacalc(float frame[]); void initialise(int framesize,int hsize); void processframe(float frame[]); // void processFrame(float* frame, int length); float rawChroma[12]; float chroma[12]; float chroma_low[12]; int chromaready; float maximumChromaValue; int quantisedChromagram[12]; double getQuantisedDistance(float secondQuantisedChroma[12]); private: void hamming(int N); void makeprofiles(); void getmagspectrum(); void generatechromagram(); void quantiseChromagram();//follows muller's method for quantising //taking L1 norm, normalising to that, then looking at the bins //float euclidean(float v1[],float v2[],int length); float max(float array[],int length); int minindex(float array[],int length); void downsampleframe(float frame[]); int bsize; int count; int hopsize; int fsize; int calcrate; float ratio; float *buffer; // audio buffer float *wbuffer; // windowed audio buffer float *win; // hanning window float *mag; float *d_frame; float *hop; float note[12]; int harmonics; int octaves; int search; fftwf_plan p; // create fft plan fftwf_complex *out; // to hold complex fft values float pi; }; #endif