Mercurial > hg > audio-file-loader
view chromagramm/Chromagram.h @ 1:ba2a17cf81bf
first working version of audio file loder. Loads bach clip from the apps->audio-file-loader->bin->data->sounds foler. Three classes: SoundFileLoader does the loading and parsing of thefile with libSndFile. audio samples are kept in AudioFile and analysis of features are kept in AudioAnalysis, at this stage just chromagramm and basic energy
author | Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk> |
---|---|
date | Sun, 04 Sep 2011 22:45:35 +0100 |
parents | bcb0d40158f4 |
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[]); float rawChroma[12]; float chroma[12]; float chroma_low[12]; int chromaready; float maximumChromaValue; private: void hamming(int N); void makeprofiles(); void getmagspectrum(); void generatechromagram(); //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