Mercurial > hg > vamp-tempogram
comparison SpectrogramProcessor.h @ 14:c11367df624d
* Renamed NoveltyCurve.* and Spectrogram.* to $(Name)Processor.*
* Aligned novelty curve with audio - when performing FIRFilter::process(params), take inputLength after group delay.
* Removed trail of Spectrogram.
* General tidying!
author | Carl Bussey <c.bussey@se10.qmul.ac.uk> |
---|---|
date | Thu, 14 Aug 2014 10:31:49 +0100 |
parents | Spectrogram.h@7680cc4c0073 |
children | 3e4ddfbfeb81 |
comparison
equal
deleted
inserted
replaced
13:7680cc4c0073 | 14:c11367df624d |
---|---|
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 typedef std::vector <std::vector<float> > Spectrogram; | |
16 typedef std::vector <std::vector<float> > SpectrogramTransposed; | |
17 | |
18 class SpectrogramProcessor{ | |
19 size_t m_windowLength; | |
20 size_t m_fftLength; | |
21 size_t m_hopSize; | |
22 size_t m_numberOfOutputBins; | |
23 double * m_pFftInput; | |
24 double * m_pFftOutputReal; | |
25 double * m_pFftOutputImag; | |
26 | |
27 void initialise(); | |
28 void cleanup(); | |
29 public: | |
30 SpectrogramProcessor(const size_t &windowLength, const size_t &fftLength, const size_t &hopSize); | |
31 ~SpectrogramProcessor(); | |
32 | |
33 std::vector< std::vector<float> > process(const float * const pInput, const size_t &inputLength, const float * pWindow, const bool &transposeOutput = false) const; | |
34 static SpectrogramTransposed transpose(const Spectrogram &spectrogram); | |
35 }; | |
36 | |
37 #endif /* defined(__Tempogram__Spectrogram__) */ |