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
새로운 기여자 I
1,735 조회수

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 포인트
1 솔루션
Serjio
새로운 기여자 I
1,705 조회수

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 포인트
2 응답
Serjio
새로운 기여자 I
1,706 조회수

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 포인트
VidyalathaB_Intel
중재자
1,696 조회수

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 포인트
응답