Mercurial > hg > vamp-tempogram
view Spectrogram.h @ 8:4e429b9f2b4d
* Fixed memory leak bug. Issue with calculating size of spectrogram array.
* Fixed bug in Tempogram::reset() where specData wasn't reinitialised.
author | Carl Bussey <c.bussey@se10.qmul.ac.uk> |
---|---|
date | Thu, 07 Aug 2014 17:25:24 +0100 |
parents | 21147df9cb2d |
children | be59b4a73f49 |
line wrap: on
line source
// // Spectrogram.h // Tempogram // // Created by Carl Bussey on 07/08/2014. // Copyright (c) 2014 Carl Bussey. All rights reserved. // #ifndef __Tempogram__Spectrogram__ #define __Tempogram__Spectrogram__ #include <vector> #include <vamp-sdk/FFT.h> #include <cmath> class Spectrogram{ int m_inputLength; int m_fftLength; int m_hopSize; int m_numberOfOutputBins; double * fftInput; double * fftOutputReal; double * fftOutputImag; std::vector< std::vector <float> > spectrogramOutput; void initialise(); void cleanup(); public: std::vector< std::vector<float> > audioToMagnitudeSpectrogram(const float * const input, const float * window); Spectrogram(unsigned int inputLength, unsigned int fftLength, unsigned int hopSize); ~Spectrogram(); }; #endif /* defined(__Tempogram__Spectrogram__) */