- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page