comparison 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
comparison
equal deleted inserted replaced
288:86c70067c723 289:befe5aa6b450
2 2
3 /* 3 /*
4 QM DSP Library 4 QM DSP Library
5 5
6 Centre for Digital Music, Queen Mary, University of London. 6 Centre for Digital Music, Queen Mary, University of London.
7 This file is based on Don Cross's public domain FFT implementation.
8 */ 7 */
9 8
10 #ifndef FFT_H 9 #ifndef FFT_H
11 #define FFT_H 10 #define FFT_H
12 11
13 class FFT 12 class FFT
14 { 13 {
15 public: 14 public:
16 static void process(unsigned int nSamples, bool bInverseTransform, 15 FFT(unsigned int nsamples);
17 const double *lpRealIn, const double *lpImagIn, 16 ~FFT();
18 double *lpRealOut, double *lpImagOut);
19 FFT();
20 virtual ~FFT();
21 17
22 protected: 18 void process(bool inverse,
23 static unsigned int reverseBits(unsigned int nIndex, unsigned int nBits); 19 const double *realIn, const double *imagIn,
24 static unsigned int numberOfBitsNeeded( unsigned int nSamples ); 20 double *realOut, double *imagOut);
25 static bool isPowerOfTwo( unsigned int nX ); 21
22 private:
23 unsigned int m_n;
24 void *m_private;
26 }; 25 };
27 26
27 class FFTReal
28 {
29 public:
30 FFTReal(unsigned int nsamples);
31 ~FFTReal();
32
33 void process(bool inverse,
34 const double *realIn,
35 double *realOut, double *imagOut);
36
37 private:
38 unsigned int m_n;
39 void *m_private;
40 };
41
28 #endif 42 #endif