Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
7015 Discussions

Single-to-complex DFT using two double arrays for output

sudoLife
New Contributor I
1,138 Views

Hi,

 

The following scenario:

Input: a signal stored as vector.

Required output: range vector and phase vector.

 

How do I set this kind of output (to two different arrays)? I only saw people output to MKL_Complex16 a.k.a std::complex<double>  and the documentation was a bit beyond me.

 

Thanks!

0 Kudos
6 Replies
ShanmukhS_Intel
Moderator
1,110 Views

Hi,


Thanks for posting on Intel Communities. Please refer the below link which illustrates the use of DFTI_COMPLEX_COMPLEX and DFTI_REAL_REAL if this could help you.


https://www.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-c/top/fourier-transform-functions/fft-functions/configuration-settings/dfti-complex-real-conj-even-storage.html


Best Regards,

Shanmukh.SS


0 Kudos
sudoLife
New Contributor I
1,097 Views

Hi,

 

Thanks for the reply, Shanmukh. I have looked through that documentation.

Here's my descriptor:

status = DftiCreateDescriptor(&descriptor, DFTI_SINGLE, DFTI_REAL, 1, 1024); //Specify size and precision
status = DftiSetValue(descriptor, DFTI_PLACEMENT, DFTI_NOT_INPLACE);
status = DftiCommitDescriptor(descriptor);

So the input is a double array.

With DFTI_REAL_REAL, I only found an example of inplace DFT. Does that mean that if I want an out-of-place DFT, and I have REAL input, I  can specify two double arrays for output? Because that's what I'm trying to do.

 

I appreciate your input.

 

0 Kudos
ShanmukhS_Intel
Moderator
1,050 Views

Hi,


We are working on your issue description. We will get back to you soon with an update.


Best Regards,

Shanmukh.SS



0 Kudos
Khang_N_Intel
Employee
1,042 Views

Hi,


I will provide you with feedback on your issue soon.


Best regards,

Khang


0 Kudos
Khang_N_Intel
Employee
1,037 Views

Hi,


oneMKL FFT does not support complex results as amplitude-phase directly.

Please see: https://www.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-fortran/top/appendix-e-code-examples/fourier-transform-functions-code-examples/auxiliary-data-transformations.html


As for splitting the output, you can use the parameter DFTI_CONJUGATE_EVEN_STORAGE.

https://www.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-fortran/top/fourier-transform-functions/fft-functions/configuration-settings/dfti-complex-real-conj-even-storage.html

Please look at examples config_srtorage.c and basic_sp_real_dft_1d.c that come with the mkl package for reference.

However, the value DFTI_CONJUGATE_EVEN_STORAGE=DFTI_COMPLEX_REAL is deprecated. So, we don't recommend using this option.

I don't have other option to recommend to you.

You can request the mkl team to provide this feature in ututre version of oneMKL.


Bets regards.

Khang


Best regards,

Khang


0 Kudos
Khang_N_Intel
Employee
991 Views

Hi,


Since the answer has been provided, there will be no more communication on this thread.

Should you have any new issues or questions, please do not hesitate to create new threads.


Best regards,

Khang


0 Kudos
Reply