1
votes

I am trying to do a 1D IFFT transformation of a complex input array with a conjugate even symmetry, with z(1) and z(N/2+1) being real. The total size of the array is N=256. If I prepare the IFFT like the following:

stat = DftiCreateDescriptor( desc_handle, DFTI_DOUBLE, DFTI_REAL, 1,256)
stat = DftiSetValue(desc_handle, DFTI_CONJUGATE_EVEN_STORAGE, DFTI_COMPLEX_COMPLEX)

stat = DftiSetValue(desc_handle, DFTI_PLACEMENT, DFTI_NOT_INPLACE)

stat = DftiComputeBackward(desc_handle, X_in, M_out)

... where X_in has the conjugate symmetry even described above. That means that M_out is expected to be a mathematical real array in the sense that if:

real(dp) :: M_out(N+2)

then the expected real fortran array with have every other element equal to zero.

complex(dp) :: M_out(N/2)

then the expected complex fortran array will have N/2 size with the imaginary part being zero.

However the results I get are not real after doing the above. It is like the routines do not understand that the input complex fortran array does not have the conjugate even symmetry. Why is that? Do I have to add any other preference parameters to ensure the structure of the input is read correctly?

1
Pretty good question, dakarot! Though I don't know the answer, I made some edits to your formatting to help keep it readable. If you click "edit" you'll be able to see the changes I made, and be able to do them yourself when you ask more questions or provide answers. - Dawson Toth
Thank you very much on the changes. Sorry I am new in the forum so I didn't knew how to do all these. I will learn them so I can make my questions more readable. Thanks again!! - dakarot
How do the results look like then? For which input? Try to produce a simple test program we can try (and use a smaller vector). - Vladimir F
The input is a fortran complex array of size 256 and has a conjugate symmetric even property. Mathematically that means that the result of an IFFT must be real. So in my above example the X_in is the input. I should get M_out to be real (zero imaginary part) but I don't. It is like the MKL FFT library does not understand that the input matrix does not have this property. Must I add something more to specify that the input array has such a structure? Thanks!! - dakarot
Sometimes one uses N/2+1 - Zeus

1 Answers

0
votes

In this example forward domain is real and backward domain is conjugate even with complex storage. Therefore MKL expects that X_in is of type Complex[] and M_out is of type Real[]. Results are real.

I suspect, that you supplied a complex array as M_out. Then this array is interpreted as Real[] and contains real results of the backward transform. No zeroes for imaginary part are inserted.