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 _FFT_ooura_ 00024 #define _FFT_ooura_ 00025 00026 #include "FFT_base.hxx" 00027 #include "DataTypes.hxx" 00028 #include "SpecTypeFlags.hxx" 00029 #include "ErrDynamicType.hxx" 00030 00031 namespace CLAM { 00032 00033 struct FFTConfig; 00034 class Spectrum; 00035 class Audio; 00036 class ProcessingConfig; 00037 class IFFT_ooura; 00038 00044 class FFT_ooura: public FFT_base 00045 { 00046 00048 int *ip; 00049 TData *w; 00050 00051 bool FFTConfigure(); 00052 00055 bool ConcreteConfigure(const ProcessingConfig&); 00056 00057 // Memory Management (for work areas and stuff) 00058 00059 void ReleaseMemory(); 00060 00061 void SetupMemory(); 00062 00063 // Output conversions 00064 00065 void ToComplex(Spectrum &out); 00066 void ToOther(Spectrum &out); 00067 00068 public: 00069 // FFTOOURA original functions, modified to accept 00070 // TData instead of double 00071 static void rdft(int n, int isgn, TData *a, int *ip, TData *w); 00072 static void makewt(int nw, int *ip, TData *w); 00073 static void makect(int nc, int *ip, TData *c); 00074 static void bitrv2(int n, int *ip, TData *a); 00075 static void cftfsub(int n, TData *a, TData *w); 00076 static void cftbsub(int n, TData *a, TData *w); 00077 static void rftfsub(int n, TData *a, int nc, TData *c); 00078 static void rftbsub(int n, TData *a, int nc, TData *c); 00079 static void cft1st(int n, TData *a, TData *w); 00080 static void cftmdl(int n, int l, TData *a, TData *w); 00081 00082 00083 00084 FFT_ooura(); 00085 00086 FFT_ooura(const FFTConfig &c) throw(ErrDynamicType); 00087 00088 ~FFT_ooura(); 00089 00090 const char * GetClassName() const {return "FFT_ooura";} 00091 00092 // Execution methods 00093 00094 bool Do(); 00095 00096 bool Do(const Audio& in, Spectrum &out); 00097 00098 00099 bool MayDisableExecution() const {return true;} 00100 00101 }; 00102 00103 };//namespace CLAM 00104 00105 #endif // _FFT_numrec_ 00106