CLAM-Development  1.4.0
FFT_fftw3.hxx
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2001-2004 MUSIC TECHNOLOGY GROUP (MTG)
3  * UNIVERSITAT POMPEU FABRA
4  *
5  *
6  * This program 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 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program 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 this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  */
21 
22 
23 #ifndef FFT_fftw3_hxx
24 #define FFT_fftw3_hxx
25 
26 #ifndef USE_FFTW3
27 #error This header should not be used without the USE_FFTW3 macro defined
28 #endif
29 
30 #include "FFT_base.hxx"
31 #include "DataTypes.hxx"
32 #include "SpecTypeFlags.hxx"
33 #include "ErrDynamicType.hxx"
34 
35 namespace CLAM
36 {
37 
38  class FFTConfig;
39  class Spectrum;
40  class Audio;
41  namespace Hidden { struct FFT_fftw3_Implementation; }
42 
45  class FFT_fftw3: public FFT_base
46  {
47  public:
48  FFT_fftw3(const FFTConfig &c=FFTConfig());
49  ~FFT_fftw3();
50  const char * GetClassName() const {return "FFT_fftw3";}
51 
52  // Execution methods
53  bool Do();
54  bool Do(const Audio& in, Spectrum &out);
55  protected:
57 
58  private:
59  Hidden::FFT_fftw3_Implementation * _fftw3;
60  private:
61  // Memory Management (for work areas and stuff)
62  void ReleaseMemory();
63  void SetupMemory();
64 
65  // Output conversions
66  void ToComplex(Spectrum &out);
67  };
68 
69 }//namespace CLAM
70 
71 #endif//FFT_fftw3_hxx
72