Mercurial > hg > qm-dsp
diff dsp/transforms/FFT.h @ 289:befe5aa6b450
* Refactor FFT a little bit so as to separate construction and processing
rather than have a single static method -- will make it easier to use a
different implementation
* pull in KissFFT implementation (not hooked up yet)
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Wed, 13 May 2009 09:19:12 +0000 |
parents | 9edaa3ce62e8 |
children | f6ccde089491 |
line wrap: on
line diff
--- a/dsp/transforms/FFT.h Tue May 12 21:04:25 2009 +0000 +++ b/dsp/transforms/FFT.h Wed May 13 09:19:12 2009 +0000 @@ -4,7 +4,6 @@ QM DSP Library Centre for Digital Music, Queen Mary, University of London. - This file is based on Don Cross's public domain FFT implementation. */ #ifndef FFT_H @@ -13,16 +12,31 @@ class FFT { public: - static void process(unsigned int nSamples, bool bInverseTransform, - const double *lpRealIn, const double *lpImagIn, - double *lpRealOut, double *lpImagOut); - FFT(); - virtual ~FFT(); + FFT(unsigned int nsamples); + ~FFT(); -protected: - static unsigned int reverseBits(unsigned int nIndex, unsigned int nBits); - static unsigned int numberOfBitsNeeded( unsigned int nSamples ); - static bool isPowerOfTwo( unsigned int nX ); + void process(bool inverse, + const double *realIn, const double *imagIn, + double *realOut, double *imagOut); + +private: + unsigned int m_n; + void *m_private; }; +class FFTReal +{ +public: + FFTReal(unsigned int nsamples); + ~FFTReal(); + + void process(bool inverse, + const double *realIn, + double *realOut, double *imagOut); + +private: + unsigned int m_n; + void *m_private; +}; + #endif