CLAM-Development  1.4.0
IFFT_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 _IFFT_fftw3_
24 #define _IFFT_fftw3_
25 
26 #include "IFFT_base.hxx"
27 #include "ErrDynamicType.hxx"
28 #include "SpectrumConfig.hxx"
29 
30 namespace CLAM {
31 
35  class IFFT_fftw3: public IFFT_base
36  {
37  struct Implementation;
38  Implementation * _fftw3;
39 
40  /* IFFT possible execution states.
41  */
42  typedef enum {
43  sComplex, // We just need to read the complex array.
44  sOther // The complex array is not present.
45  } IFFTState;
46 
49  IFFTState mState;
50 
51  void DefaultInit();
52 
53  inline void CheckTypes(const Spectrum& in, const Audio &out) const;
54 
55  // Output conversions
56 
63  inline void ComplexToRIFFTW(const Spectrum &in) const;
64  inline void OtherToRIFFTW(const Spectrum &in) const;
65  void ReleaseMemory();
66  void SetupMemory();
67 
71  bool ConcreteConfigure(const ProcessingConfig&);
72 
73  public:
74 
75  IFFT_fftw3(const IFFTConfig &c=IFFTConfig());
76  ~IFFT_fftw3();
77  const char * GetClassName() const {return "IFFT_fftw3";}
78 
79  bool Do();
80  bool Do(const Spectrum& in, Audio &out) const;
81  bool MayDisableExecution() const {return true;}
82 
83  // Port interfaces.
84  bool SetPrototypes(const Spectrum& in,const Audio &out);
85  bool SetPrototypes();
86  bool UnsetPrototypes();
87 
88  };
89 
90 }
91 
92 #endif // _IFFT_fftw3_
93