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

Output data format of FFT(abs)

Serjio
New Contributor I
843 Views

I need to perform Fourier transform on an array of real numbers. Next, I need to do the inverse Fourier transform. In the end, I have to get an array of real numbers.

Problem. When I do an FFT on an array of real numbers of length 16384, I get an array with a length of 8192 elements. Moreover, the values do not coincide with the values in Matlab.
How can I FFT over an array of real numbers of 16384 length in order to get an array of 16384 length in response? Just tell me the settings for MKL FFT to do the same as in Matlab but in C++

// Matlab
// Sig - complex double
// Sig_amp_fft - real double
// Sig_amp_ifft - real double

Sig_amp_fft = fft(abs(Sig));           // Sig_amp_fft length = 16383
Sig_amp_ifft = ifft(Sig_amp_fft); // Sig_amp_ifft length = 16383


And now in MKL:
std::vector<std::complex<double>> Sig(16384);
std::vector<double>Sig_amp_ifft(16384);
// Settings for FFT:

0 Kudos
1 Solution
Serjio
New Contributor I
813 Views

the right way is:

set DFTI_CONJUGATE_EVEN_STORAGE = DFTI_COMPLEX_COMPLEX

and after the FFT make data mirroring relative to the last element in the array after FFT

View solution in original post

0 Kudos
2 Replies
Serjio
New Contributor I
814 Views

the right way is:

set DFTI_CONJUGATE_EVEN_STORAGE = DFTI_COMPLEX_COMPLEX

and after the FFT make data mirroring relative to the last element in the array after FFT

0 Kudos
VidyalathaB_Intel
Moderator
804 Views

Hi,

Glad to know that your issue is resolved and thanks for letting us know the solution.

If you need any additional information, please submit a new question as this thread will no longer be monitored.

Regards,

Vidya.



0 Kudos
Reply