CLAM-Development
1.1
|
00001 /* 00002 * Copyright (c) 2001-2004 MUSIC TECHNOLOGY GROUP (MTG) 00003 * UNIVERSITAT POMPEU FABRA 00004 * 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 * 00020 */ 00021 00022 00023 #ifndef _IFFT_fftw3_ 00024 #define _IFFT_fftw3_ 00025 00026 #include "IFFT_base.hxx" 00027 #include "ErrDynamicType.hxx" 00028 #include "SpectrumConfig.hxx" 00029 00030 namespace CLAM { 00031 00035 class IFFT_fftw3: public IFFT_base 00036 { 00037 struct Implementation; 00038 Implementation * _fftw3; 00039 00040 /* IFFT possible execution states. 00041 */ 00042 typedef enum { 00043 sComplex, // We just need to read the complex array. 00044 sOther // The complex array is not present. 00045 } IFFTState; 00046 00049 IFFTState mState; 00050 00051 void DefaultInit(); 00052 00053 inline void CheckTypes(const Spectrum& in, const Audio &out) const; 00054 00055 // Output conversions 00056 00063 inline void ComplexToRIFFTW(const Spectrum &in) const; 00064 inline void OtherToRIFFTW(const Spectrum &in) const; 00065 void ReleaseMemory(); 00066 void SetupMemory(); 00067 00071 bool ConcreteConfigure(const ProcessingConfig&); 00072 00073 public: 00074 00075 IFFT_fftw3(const IFFTConfig &c=IFFTConfig()); 00076 ~IFFT_fftw3(); 00077 const char * GetClassName() const {return "IFFT_fftw3";} 00078 00079 bool Do(); 00080 bool Do(const Spectrum& in, Audio &out) const; 00081 bool MayDisableExecution() const {return true;} 00082 00083 // Port interfaces. 00084 bool SetPrototypes(const Spectrum& in,const Audio &out); 00085 bool SetPrototypes(); 00086 bool UnsetPrototypes(); 00087 00088 }; 00089 00090 } 00091 00092 #endif // _IFFT_fftw3_ 00093