FourierTransform.hxx
Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 #ifndef FourierTransform_hxx
00023 #define FourierTransform_hxx
00024 #include <vector>
00025 #if USE_FFTW3
00026 #include <fftw3.h>
00027 #endif
00028 
00029 class FourierTransform {
00030         std::vector<double> _spectrum;
00031         unsigned long mFrameSize;
00032         bool mIsComplex;
00033 #if USE_FFTW3
00034         double * _realInput;
00035         fftw_complex * _complexOutput;
00036         fftw_plan _plan;
00037 #endif
00038 public:
00039         FourierTransform(unsigned long int frameSize, double normalizationFactor, bool isComplex);
00040         ~FourierTransform();
00041 
00042         void doIt(const float * input);
00043         void doIt(const double * input);
00044         const std::vector<double> & spectrum() const {return _spectrum;};
00045 private:
00046         template <typename T> void doItGeneric(const T * input);
00047 };
00048 
00049 #endif//FourierTransform_hxx
00050