Perform forward FFT of real data Accepts: input - pointer to an array of (real) input values, size nfft output_re - pointer to an array of the real part of the output, size nfft/2 + 1 output_im - pointer to an array of the imaginary part of the output, size nfft/2 + 1
| 49 | // output_im - pointer to an array of the imaginary part of the output, |
| 50 | // size nfft/2 + 1 |
| 51 | void FFT::Forward(float* input, float* output_re, float* output_im) |
| 52 | { |
| 53 | int hnfft = mNfft / 2; |
| 54 | |
| 55 | for (int ti = 0; ti < mNfft; ti++) |
| 56 | { |
| 57 | mFft_data[ti] = input[ti]; |
| 58 | } |
| 59 | |
| 60 | mayer_realfft(mNfft, mFft_data); |
| 61 | |
| 62 | output_im[0] = 0; |
| 63 | for (int ti = 0; ti < hnfft; ti++) |
| 64 | { |
| 65 | output_re[ti] = mFft_data[ti]; |
| 66 | output_im[ti] = mFft_data[mNfft - 1 - ti]; |
| 67 | } |
| 68 | output_re[hnfft] = mFft_data[hnfft]; |
| 69 | output_im[hnfft] = 0; |
| 70 | } |
| 71 | |
| 72 | // Perform inverse FFT, returning real data |
| 73 | // Accepts: |