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?