PageRenderTime 29ms CodeModel.GetById 23ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/thirdparty/liblastfm2/src/fingerprint/fplib/OptFFT.h

http://github.com/tomahawk-player/tomahawk
C++ Header | 63 lines | 28 code | 16 blank | 19 comment | 0 complexity | 5a4fc0e9926a77a18490d4786979e650 MD5 | raw file
 1/*
 2   Copyright 2005-2009 Last.fm Ltd. <mir@last.fm>
 3
 4   This file is part of liblastfm.
 5
 6   liblastfm is free software: you can redistribute it and/or modify
 7   it under the terms of the GNU General Public License as published by
 8   the Free Software Foundation, either version 3 of the License, or
 9   (at your option) any later version.
10
11   liblastfm is distributed in the hope that it will be useful,
12   but WITHOUT ANY WARRANTY; without even the implied warranty of
13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   GNU General Public License for more details.
15
16   You should have received a copy of the GNU General Public License
17   along with liblastfm.  If not, see <http://www.gnu.org/licenses/>.
18*/
19#ifndef __OPT_FFT_H
20#define __OPT_FFT_H
21
22#include <fftw3.h>
23#include <vector>
24
25namespace fingerprint
26{
27
28class OptFFT
29{
30public:
31
32   OptFFT(const size_t maxDataSize);
33   ~OptFFT();
34
35   int 
36   process(float* pInData, const size_t dataSize);
37   
38   float** 
39   getFrames()    { return m_pFrames; }
40
41private:
42
43   void applyHann(float* pInData, const size_t dataSize);
44
45    fftwf_plan        m_p;
46    fftwf_complex *   m_pOut;
47    float*            m_pIn;
48
49   //float   m_base;
50
51   int     m_numSamples;
52   int     m_numOutSamples;
53
54   float** m_pFrames;
55   int     m_maxFrames;
56
57   std::vector<int> m_powTable;
58
59};
60
61} // end of namespace
62
63#endif // OPT_FFT