Mercurial > hg > qm-dsp
comparison dsp/transforms/FFT.h @ 129:6ec45e85ed81 kissfft
Drop in kissfft to replace the "old" fft, and add tests for newly-supported sizes
author | Chris Cannam |
---|---|
date | Tue, 15 Oct 2013 11:38:18 +0100 |
parents | f6ccde089491 |
children | a586888bc06c |
comparison
equal
deleted
inserted
replaced
128:5023f521732c | 129:6ec45e85ed81 |
---|---|
12 class FFT | 12 class FFT |
13 { | 13 { |
14 public: | 14 public: |
15 /** | 15 /** |
16 * Construct an FFT object to carry out complex-to-complex | 16 * Construct an FFT object to carry out complex-to-complex |
17 * transforms of size nsamples. nsamples must be a power of two in | 17 * transforms of size nsamples. nsamples does not have to be a |
18 * this implementation. | 18 * power of two. |
19 */ | 19 */ |
20 FFT(int nsamples); | 20 FFT(int nsamples); |
21 ~FFT(); | 21 ~FFT(); |
22 | 22 |
23 /** | 23 /** |
37 void process(bool inverse, | 37 void process(bool inverse, |
38 const double *realIn, const double *imagIn, | 38 const double *realIn, const double *imagIn, |
39 double *realOut, double *imagOut); | 39 double *realOut, double *imagOut); |
40 | 40 |
41 private: | 41 private: |
42 int m_n; | 42 class D; |
43 D *m_d; | |
43 }; | 44 }; |
44 | 45 |
45 class FFTReal | 46 class FFTReal |
46 { | 47 { |
47 public: | 48 public: |
48 /** | 49 /** |
49 * Construct an FFT object to carry out real-to-complex transforms | 50 * Construct an FFT object to carry out real-to-complex transforms |
50 * of size nsamples. nsamples must be a power of two in this | 51 * of size nsamples. nsamples does not have to be a power of two, |
51 * implementation. | 52 * but it does have to be even. (A std::invalid_argument exception |
53 * will be thrown if nsamples is odd.) | |
52 */ | 54 */ |
53 FFTReal(int nsamples); | 55 FFTReal(int nsamples); |
54 ~FFTReal(); | 56 ~FFTReal(); |
55 | 57 |
56 /** | 58 /** |
81 */ | 83 */ |
82 void inverse(const double *realIn, const double *imagIn, | 84 void inverse(const double *realIn, const double *imagIn, |
83 double *realOut); | 85 double *realOut); |
84 | 86 |
85 private: | 87 private: |
86 int m_n; | 88 class D; |
87 FFT *m_fft; | 89 D *m_d; |
88 double *m_r; | |
89 double *m_i; | |
90 double *m_discard; | |
91 }; | 90 }; |
92 | 91 |
93 #endif | 92 #endif |