comparison dsp/transforms/FFT.h @ 357:650bbacf8288

Add forwardMagnitude
author Chris Cannam <c.cannam@qmul.ac.uk>
date Tue, 15 Oct 2013 18:26:38 +0100
parents 3c7338aff6a8
children 857ca50ca25f
comparison
equal deleted inserted replaced
356:42d416af5030 357:650bbacf8288
47 { 47 {
48 public: 48 public:
49 /** 49 /**
50 * Construct an FFT object to carry out real-to-complex transforms 50 * Construct an FFT object to carry out real-to-complex transforms
51 * of size nsamples. nsamples does not have to be a power of two, 51 * of size nsamples. nsamples does not have to be a power of two,
52 * but it does have to be even. (A std::invalid_argument exception 52 * but it does have to be even. (Use the complex-complex FFT above
53 * will be thrown if nsamples is odd.) 53 * if you need an odd FFT size. This constructor will throw
54 * std::invalid_argument if nsamples is odd.)
54 */ 55 */
55 FFTReal(int nsamples); 56 FFTReal(int nsamples);
56 ~FFTReal(); 57 ~FFTReal();
57 58
58 /** 59 /**
64 * compatibility with existing code, the conjugate half of the 65 * compatibility with existing code, the conjugate half of the
65 * output is returned even though it is redundant. 66 * output is returned even though it is redundant.
66 */ 67 */
67 void forward(const double *realIn, 68 void forward(const double *realIn,
68 double *realOut, double *imagOut); 69 double *realOut, double *imagOut);
70
71 /**
72 * Carry out a forward real-to-complex transform of size nsamples,
73 * where nsamples is the value provided to the constructor
74 * above. Return only the magnitudes of the complex output values.
75 *
76 * realIn and magOut must point to (enough space for) nsamples
77 * values. For consistency with the FFT class above, and
78 * compatibility with existing code, the conjugate half of the
79 * output is returned even though it is redundant.
80 */
81 void forwardMagnitude(const double *realIn, double *magOut);
69 82
70 /** 83 /**
71 * Carry out an inverse real transform (i.e. complex-to-real) of 84 * Carry out an inverse real transform (i.e. complex-to-real) of
72 * size nsamples, where nsamples is the value provided to the 85 * size nsamples, where nsamples is the value provided to the
73 * constructor above. 86 * constructor above.