Forums

FFTW Forward FFT Gives All Zeros

Started by Unknown September 15, 2005
I have an array of non-zero, somewhat periodic, real data that I put
into the real components of the complex input.  The imaginary
components of the complex input are all zeros.  I then get the FFT with
the following call
for (iInc=0; iInc<dwVectorLength; ++iInc)
{
	in[iInc][0]=cpInputVector[iInc].fReal;
	in[iInc++][1]=cpInputVector[iInc].fImaginary;
}
p = fftw_plan_dft_1d((int)stNumElements, in, out, FFTW_FORWARD,
FFTW_EXHAUSTIVE)

Every component of the output, real and imaginary, is exactly zero.
When I subsequently used, as input, a similar but different array of
reals numbers I got good results.

I would be grateful to anyone who could enlighten me as to why this is
the case.

Many thanks in advance for any help,
Peter.

I believe this is because you are supposed to initialize the input
array *after* creating the plan

That appears to have fixed my problem.

Thanks very much,
Peter.