CLAM-Development  1.4.0
IFFT_ooura.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_ooura_
24 #define _IFFT_ooura_
25 
26 #include "IFFT_base.hxx"
27 #include "DataTypes.hxx"
28 #include "SpecTypeFlags.hxx"
29 #include "ErrDynamicType.hxx"
30 
31 namespace CLAM {
32 
33  struct IFFTConfig;
34  class Spectrum;
35  class Audio;
36  class ProcessingConfig;
37 
43  class IFFT_ooura: public IFFT_base
44  {
46  int *ip;
47  TData *w;
48 
50  TData* ifftbuffer;
52  SpecTypeFlags mComplexflags;
53 
54  /* IFFT possible execution states.
55  */
56  typedef enum {
57  sComplex, // We just need to read the complex array.
58  sOther // The complex array is not present.
59  } IFFTState;
60 
63  IFFTState mState;
64 
65  bool IFFTConfigure();
66 
69  bool ConcreteConfigure(const ProcessingConfig&);
70 
71  // Memory Management (for work areas and stuff)
72 
73  void ReleaseMemory();
74 
75  void SetupMemory();
76 
77  // Output conversions
78 
79  void ComplexToIFFTOoura(const Spectrum &in) const;
80  void OtherToIFFTOoura(const Spectrum &in) const;
81 
82  inline void CheckTypes(const Spectrum& in, const Audio &out) const;
83 
84  public:
85 
86  IFFT_ooura();
87 
88  IFFT_ooura(const IFFTConfig &c) throw(ErrDynamicType);
89 
90  ~IFFT_ooura();
91 
92  const char * GetClassName() const {return "IFFT_ooura";}
93 
94  // Execution methods
95 
96  bool Do();
97 
98  bool Do(const Spectrum& in, Audio &out) const;
99 
100  // Port interfaces.
101 
102  bool SetPrototypes(const Spectrum& in,const Audio &out);
103 
104  bool SetPrototypes();
105 
106  bool UnsetPrototypes();
107 
108  bool MayDisableExecution() const {return true;}
109 
110  };
111 
112 };//namespace CLAM
113 
114 #endif // _IFFT_numrec_
115