Gamma  0.9.5
Generic Synthesis Library
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
/Users/ljp/code/gamma/trunk/Gamma/FFT.h
00001 #ifndef GAMMA_FFT_H_INC
00002 #define GAMMA_FFT_H_INC
00003 
00004 
00005 namespace gam{
00006 
00007 
00009 
00012 template <class T>
00013 class CFFT{
00014 public:
00015 
00018     CFFT(int size=0);
00019     
00020     ~CFFT();
00021 
00023     int size() const;
00024 
00026     
00029     void forward(T * buf, bool normalize=true);
00030 
00031     template <template <class> class ComplexType>
00032     void forward(ComplexType<T> * buf, bool normalize=true){
00033         forward((T*)buf, normalize);
00034     }
00035 
00037     void inverse(T * buf);
00038 
00039     template <template <class> class ComplexType>
00040     void inverse(ComplexType<T> * buf){ inverse((T*)buf); }
00041 
00043     void resize(int n);
00044 
00045 private:
00046     class Impl; Impl * mImpl;
00047 };
00048 
00049 
00050 
00052 
00055 template <class T>
00056 class RFFT{
00057 public:
00058 
00061     RFFT(int size=0);
00062     
00063     ~RFFT();
00064 
00066     int size() const;
00067     
00069     
00078     void forward(T * buf, bool complexBuf=false, bool normalize=true);
00079     
00081 
00089     void inverse(T * buf, bool complexBuf=false);
00090 
00092     void resize(int n);
00093     
00094 
00095 private:
00096     class Impl; Impl * mImpl;
00097 };
00098 
00099 } // gam::
00100 
00101 #endif