annotate FIRFilter.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 |
rev |
line source |
c@0
|
1 //
|
c@0
|
2 // FIRFilter.h
|
c@0
|
3 // Tempogram
|
c@0
|
4 //
|
c@0
|
5 // Created by Carl Bussey on 25/06/2014.
|
c@0
|
6 // Copyright (c) 2014 Carl Bussey. All rights reserved.
|
c@0
|
7 //
|
c@0
|
8
|
c@0
|
9 #ifndef __Tempogram__FIRFilter__
|
c@0
|
10 #define __Tempogram__FIRFilter__
|
c@0
|
11
|
c@7
|
12 #include <cmath>
|
c@7
|
13 #include <vamp-sdk/FFT.h>
|
c@7
|
14 #include <assert.h>
|
c@7
|
15 #include <iostream>
|
c@7
|
16
|
c@0
|
17 class FIRFilter{
|
c@0
|
18 public:
|
c@0
|
19 FIRFilter(const unsigned int lengthInput, const unsigned int numberOfCoefficients);
|
c@0
|
20 ~FIRFilter();
|
c@0
|
21 void process(const float *input, const float *coefficients, float *output);
|
c@0
|
22 private:
|
c@8
|
23 unsigned int m_lengthInput;
|
c@8
|
24 unsigned int m_numberOfCoefficients;
|
c@8
|
25 unsigned int m_lengthFIRFFT;
|
c@0
|
26
|
c@0
|
27 double *fftInput;
|
c@0
|
28 double *fftCoefficients;
|
c@0
|
29 double *fftReal1;
|
c@0
|
30 double *fftImag1;
|
c@0
|
31 double *fftReal2;
|
c@0
|
32 double *fftImag2;
|
c@0
|
33 double *fftFilteredReal;
|
c@0
|
34 double *fftFilteredImag;
|
c@0
|
35 double *fftOutputReal;
|
c@0
|
36 double *fftOutputImag;
|
c@0
|
37
|
c@0
|
38 void initialise();
|
c@0
|
39 void cleanup();
|
c@0
|
40 };
|
c@0
|
41
|
c@0
|
42 #endif /* defined(__Tempogram__FIRFilter__) */
|