Mercurial > hg > audio-file-loader
comparison chromagramm/Chromagram.h @ 0:bcb0d40158f4
started audio file loader project - using oF_061
author | Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk> |
---|---|
date | Tue, 30 Aug 2011 20:18:34 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:bcb0d40158f4 |
---|---|
1 | |
2 | |
3 #ifndef CHROMAGRAM_H | |
4 #define CHROMAGRAM_H | |
5 | |
6 #include "fftw3.h" | |
7 | |
8 class Chromagram | |
9 { | |
10 public: | |
11 Chromagram(); // constructor | |
12 ~Chromagram(); // destructor | |
13 void chromacalc(float frame[]); | |
14 void initialise(int framesize,int hsize); | |
15 void processframe(float frame[]); | |
16 | |
17 float rawChroma[12]; | |
18 float chroma[12]; | |
19 float chroma_low[12]; | |
20 int chromaready; | |
21 | |
22 float maximumChromaValue; | |
23 | |
24 private: | |
25 void hamming(int N); | |
26 void makeprofiles(); | |
27 void getmagspectrum(); | |
28 void generatechromagram(); | |
29 //float euclidean(float v1[],float v2[],int length); | |
30 float max(float array[],int length); | |
31 int minindex(float array[],int length); | |
32 void downsampleframe(float frame[]); | |
33 | |
34 int bsize; | |
35 int count; | |
36 int hopsize; | |
37 int fsize; | |
38 int calcrate; | |
39 float ratio; | |
40 | |
41 float *buffer; // audio buffer | |
42 float *wbuffer; // windowed audio buffer | |
43 float *win; // hanning window | |
44 float *mag; | |
45 float *d_frame; | |
46 float *hop; | |
47 | |
48 | |
49 float note[12]; | |
50 int harmonics; | |
51 int octaves; | |
52 int search; | |
53 | |
54 fftwf_plan p; // create fft plan | |
55 fftwf_complex *out; // to hold complex fft values | |
56 | |
57 float pi; | |
58 | |
59 | |
60 }; | |
61 | |
62 #endif |