Mercurial > hg > vamp-tempogram
comparison Spectrogram.h @ 7:21147df9cb2d
* Error when deleting Spectrogram object in Tempogram::getRemainingFeatures().
* Moved Spectrogram computation into own class.
author | Carl Bussey <c.bussey@se10.qmul.ac.uk> |
---|---|
date | Thu, 07 Aug 2014 16:21:21 +0100 |
parents | |
children | be59b4a73f49 |
comparison
equal
deleted
inserted
replaced
6:14a143a2c4c9 | 7:21147df9cb2d |
---|---|
1 // | |
2 // Spectrogram.h | |
3 // Tempogram | |
4 // | |
5 // Created by Carl Bussey on 07/08/2014. | |
6 // Copyright (c) 2014 Carl Bussey. All rights reserved. | |
7 // | |
8 | |
9 #ifndef __Tempogram__Spectrogram__ | |
10 #define __Tempogram__Spectrogram__ | |
11 #include <vector> | |
12 #include <vamp-sdk/FFT.h> | |
13 #include <cmath> | |
14 | |
15 class Spectrogram{ | |
16 int m_inputLength; | |
17 int m_fftLength; | |
18 int m_hopSize; | |
19 int m_numberOfOutputBins; | |
20 double * fftInput; | |
21 double * fftOutputReal; | |
22 double * fftOutputImag; | |
23 std::vector< std::vector <float> > spectrogramOutput; | |
24 | |
25 void initialise(); | |
26 void cleanup(); | |
27 public: | |
28 std::vector< std::vector<float> > audioToMagnitudeSpectrogram(const float * const input, const float * window); | |
29 Spectrogram(unsigned int inputLength, unsigned int fftLength, unsigned int hopSize); | |
30 ~Spectrogram(); | |
31 }; | |
32 | |
33 #endif /* defined(__Tempogram__Spectrogram__) */ |