annotate NoveltyCurve.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 |
8d7e336b41e9 |
children |
be59b4a73f49 |
rev |
line source |
c@5
|
1 //
|
c@5
|
2 // NoveltyCurve.h
|
c@5
|
3 // Tempogram
|
c@5
|
4 //
|
c@5
|
5 // Created by Carl Bussey on 10/07/2014.
|
c@5
|
6 // Copyright (c) 2014 Carl Bussey. All rights reserved.
|
c@5
|
7 //
|
c@5
|
8
|
c@5
|
9 #ifndef __Tempogram__NoveltyCurve__
|
c@5
|
10 #define __Tempogram__NoveltyCurve__
|
c@5
|
11
|
c@5
|
12 #include <iostream>
|
c@7
|
13 #include <cmath>
|
c@7
|
14 #include <vector>
|
c@7
|
15 #include <iostream>
|
c@7
|
16 #include "FIRFilter.h"
|
c@7
|
17 #include "WindowFunction.h"
|
c@7
|
18 #include <cassert>
|
c@5
|
19
|
c@5
|
20 class NoveltyCurve{
|
c@5
|
21 float m_samplingFrequency;
|
c@7
|
22 int m_fftLength;
|
c@5
|
23 int m_blockSize;
|
c@5
|
24 int m_numberOfBlocks;
|
c@5
|
25 int m_compressionConstant;
|
c@5
|
26 int m_numberOfBands;
|
c@5
|
27 int * m_bandBoundaries;
|
c@5
|
28 int m_hannLength;
|
c@5
|
29 float * m_hannWindow;
|
c@7
|
30 float * m_bandSum;
|
c@5
|
31
|
c@5
|
32 void initialise();
|
c@5
|
33 void cleanup();
|
c@7
|
34 float calculateMax(std::vector< std::vector<float> > &spectrogram);
|
c@7
|
35 void subtractLocalAverage(std::vector<float> &noveltyCurve);
|
c@7
|
36 void smoothedDifferentiator(std::vector< std::vector<float> > &spectrogram, int smoothLength);
|
c@7
|
37 void halfWaveRectify(std::vector< std::vector<float> > &spectrogram);
|
c@5
|
38
|
c@5
|
39 public:
|
c@7
|
40 std::vector<float> data;
|
c@5
|
41
|
c@7
|
42 NoveltyCurve(float samplingFrequency, int fftLength, int numberOfBlocks, int compressionConstant);
|
c@5
|
43 ~NoveltyCurve();
|
c@7
|
44 std::vector<float> spectrogramToNoveltyCurve(std::vector< std::vector<float> > &spectrogram);
|
c@5
|
45 };
|
c@5
|
46
|
c@5
|
47 #endif /* defined(__Tempogram__NoveltyCurve__) */
|