annotate Spectrogram.h @ 11:09fb76606b2b
* Removed many unnecessary heap allocations with objects
author |
Carl Bussey <c.bussey@se10.qmul.ac.uk> |
date |
Wed, 13 Aug 2014 10:45:46 +0100 |
parents |
be59b4a73f49 |
children |
7680cc4c0073 |
rev |
line source |
c@7
|
1 //
|
c@7
|
2 // Spectrogram.h
|
c@7
|
3 // Tempogram
|
c@7
|
4 //
|
c@7
|
5 // Created by Carl Bussey on 07/08/2014.
|
c@7
|
6 // Copyright (c) 2014 Carl Bussey. All rights reserved.
|
c@7
|
7 //
|
c@7
|
8
|
c@7
|
9 #ifndef __Tempogram__Spectrogram__
|
c@7
|
10 #define __Tempogram__Spectrogram__
|
c@7
|
11 #include <vector>
|
c@7
|
12 #include <vamp-sdk/FFT.h>
|
c@7
|
13 #include <cmath>
|
c@7
|
14
|
c@11
|
15 class SpectrogramProcessor{
|
c@7
|
16 int m_inputLength;
|
c@9
|
17 int m_windowLength;
|
c@7
|
18 int m_fftLength;
|
c@7
|
19 int m_hopSize;
|
c@7
|
20 int m_numberOfOutputBins;
|
c@7
|
21 double * fftInput;
|
c@7
|
22 double * fftOutputReal;
|
c@7
|
23 double * fftOutputImag;
|
c@7
|
24 std::vector< std::vector <float> > spectrogramOutput;
|
c@7
|
25
|
c@7
|
26 void initialise();
|
c@7
|
27 void cleanup();
|
c@7
|
28 public:
|
c@11
|
29 std::vector< std::vector<float> > process(const float * const input, const float * window);
|
c@11
|
30 SpectrogramProcessor(unsigned int inputLength, unsigned int windowLength, unsigned int fftLength, unsigned int hopSize);
|
c@11
|
31 ~SpectrogramProcessor();
|
c@7
|
32 };
|
c@7
|
33
|
c@7
|
34 #endif /* defined(__Tempogram__Spectrogram__) */
|