Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

Output data format of FFT(abs)

Serjio
New Contributor I
323 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
293 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

2 Replies
Serjio
New Contributor I
294 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

VidyalathaB_Intel
Moderator
284 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.



Reply