comparison Spectrogram.h @ 9:be59b4a73f49

* Added Spectrogram zero padding functionality * Made output bins correspond to BPM * User can now specify a range of output bins to view * Comments added
author Carl Bussey <c.bussey@se10.qmul.ac.uk>
date Tue, 12 Aug 2014 14:40:37 +0100
parents 21147df9cb2d
children 09fb76606b2b
comparison
equal deleted inserted replaced
8:4e429b9f2b4d 9:be59b4a73f49
12 #include <vamp-sdk/FFT.h> 12 #include <vamp-sdk/FFT.h>
13 #include <cmath> 13 #include <cmath>
14 14
15 class Spectrogram{ 15 class Spectrogram{
16 int m_inputLength; 16 int m_inputLength;
17 int m_windowLength;
17 int m_fftLength; 18 int m_fftLength;
18 int m_hopSize; 19 int m_hopSize;
19 int m_numberOfOutputBins; 20 int m_numberOfOutputBins;
20 double * fftInput; 21 double * fftInput;
21 double * fftOutputReal; 22 double * fftOutputReal;
24 25
25 void initialise(); 26 void initialise();
26 void cleanup(); 27 void cleanup();
27 public: 28 public:
28 std::vector< std::vector<float> > audioToMagnitudeSpectrogram(const float * const input, const float * window); 29 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(unsigned int inputLength, unsigned int windowLength, unsigned int fftLength, unsigned int hopSize);
30 ~Spectrogram(); 31 ~Spectrogram();
31 }; 32 };
32 33
33 #endif /* defined(__Tempogram__Spectrogram__) */ 34 #endif /* defined(__Tempogram__Spectrogram__) */