issue while performing fast fourier transform(FFT)

issue while performing fast fourier transform(FFT)

I'm using dft descriptor to perform fft of real input. i am giving real array of some size.

i'm getting half of the size of fft output.


3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi rakesh,

no sure if it is still problem for you. I saw you have tried some example like complex_1d_double_ex1.c. which is do compler 1D FFT. I guess, you can try the 1D Real example too. for example basic_dp_real_dft_1d.c or real_1d_cce_double_ex2.c in older MKL version.

As real FFT input will have conjugate-even complex output, there are all packed to store the half of the output. for example CCE, CCS, Pack, Perm etc. for example, the below (itbasic_dp_real_dft_1d.c) is CCE (same as CCS) format. (Re, Im) whic stores the values of the first half of the output complex conjugate-even signal resulting from the forward FFT. The input is N double data. and output is N/2+1 complex data.

You may refer to the details in MKL Reference manual. in section : DFTI_PACKED_FORMAT. And let us know if any problem.

Best Regards,

printf("Create DFTI descriptor\n");
status = DftiCreateDescriptor(&hand, DFTI_DOUBLE, DFTI_REAL,
1, (MKL_LONG)N);
if (0 != status) goto failed;

printf("Set configuration: out-of-place\n");
status = DftiSetValue(hand, DFTI_PLACEMENT, DFTI_NOT_INPLACE);
if (0 != status) goto failed;

printf("Set configuration: CCE storage\n");
status = DftiSetValue(hand, DFTI_CONJUGATE_EVEN_STORAGE,
if (0 != status) goto failed;

/* This is not needed for DFTI_COMPLEX_COMPLEX storage */
/* status = DftiSetValue(hand, DFTI_PACKED_FORMAT, DFTI_CCE_FORMAT); */
/* if (0 != status) goto failed; */

printf("Commit the descriptor\n");
status = DftiCommitDescriptor(hand);
if (0 != status) goto failed;

printf("Allocate data arrays\n");
x_real = (double*)malloc(N*sizeof(double));
x_cmplx = (MKL_Complex16*)malloc((N/2+1)*sizeof(MKL_Complex16));

thanks Ying

Leave a Comment

Please sign in to add a comment. Not a member? Join today