1
$\begingroup$

fftw_plan_dft_r2c_1d takes an array for real numbers and produces an array of complex numbers 1/2 the size of input array + 1.

per fftw's website:

As a result of this symmetry, half of the output Y is redundant (being the complex conjugate of the other half), and so the 1d r2c transforms only output elements 0...n/2 of Y (n/2+1 complex numbers), where the division by 2 is rounded down.

When I normalize do I normalize by the size of the fft or the resulting fft_size / 2

    // normalize the fft
    for (unsigned int x = 0; x <(fftSize/2); x++)
        array[x] = array[x] / complex<double>((fftSize/2), 0);   <<<<<

or

    // normalize the fft
    for (unsigned int x = 0; x <(fftSize/2); x++)
        array[x] = array[x] / complex<double>(fftSize, 0);       <<<<<
$\endgroup$
1
$\begingroup$

Reading the manual, even though only half the data is returned, the full length FFT is calculated:

enter image description here

So you should normalize by whatever the full length is normalized to: fft_size.

$\endgroup$
  • 1
    $\begingroup$ Thank you! I'll admit I am much stronger once it's in the frequency domain. Even after having read the above page over and over, I find that the transformation from time to frequency domains is a bit over my head. $\endgroup$ – user438431 Jan 20 '16 at 14:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.