topic Thank you, I was able to in IntelĀ® oneAPI Math Kernel Library & IntelĀ® Math Kernel Library
https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-FFT-Real-input-data-to-comples-result/m-p/959745#M15813
<P>Thank you, I was able to somehow solve my problem, by not using my idea I presented here.</P>
<P>However I have one question. Why does MKL FFT do not produce symmetric fft?</P>
<P>Matlab for fftpoint = 4096 creates symmetric fft, but MKL only first half? (2048 samples are result, the rest is mirror image)</P>
<P>One data point in Matlab is represented by two after MKL's fft. Is it possible to change this somewhere?</P>
<P>Regards</P>
<P>Marek</P>Mon, 04 Mar 2013 07:15:39 GMTMarek_C_2013-03-04T07:15:39ZMKL FFT - Real input data to comples result
https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-FFT-Real-input-data-to-comples-result/m-p/959743#M15811
<P>Hello everyone,</P>
<P>I am currently working on doing fft on my wav audio signal. My goal is to recreate Matlab's function called "spectrogram", which does a STFT with moving Hammington window.<BR /><BR />My first attempt was to represent my input data as a vector (size of the window, padded with zeros) and output is vector with same size. It was working nice, I got almost the same result as other function in Matlab using fft.</P>
<P>But since Matlab spectrogram is giving me results represented as complex numbers, I want to do the same with MKL using C.</P>
<P>In user guide manual - page 2708, I can perform the fft by using this procedure:</P>
<BLOCKQUOTE>
<P><STRONG>status= DftiComputeForward(desc_handle, xre_in, xim_in, yre_out, yim_out);</STRONG></P>
</BLOCKQUOTE>
<P>So my thinking was to declare <STRONG> xre_in, xim_in, yre_out, yim_out</STRONG> ad arrays of doubles,where: <STRONG>xre_in</STRONG> is vector of my input data, <STRONG>xim_in</STRONG> is vector with zeros.</P>
<P>FFT part looks like this:</P>
<BLOCKQUOTE>
<P>status = DftiCreateDescriptor(&fft_handle, DFTI_DOUBLE, DFTI_REAL, 1, fftpoint);<BR />status = DftiSetValue(fft_handle, DFTI_PLACEMENT, DFTI_NOT_INPLACE); <BR />status = DftiCommitDescriptor(fft_handle);<BR />status = DftiComputeForward(fft_handle, Fft_input.pVector, input_imag.pVector, Fft_output.pVector, output_imag.pVector);<BR />status = DftiFreeDescriptor(&fft_handle);</P>
<P></P>
</BLOCKQUOTE>
<P>Unfortunately my outputs are all zeros after computing, so I guess my process of thinking was wrong. Where have I done mistake?</P>
<P>I am working with Visual Studio 2010, I don't think I have C99 standard, because I cannot declare complex numbers, and dealing with real ones is easier.</P>
<P></P>
<P>Regards,</P>
<P>Marek</P>Mon, 04 Mar 2013 05:31:39 GMThttps://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-FFT-Real-input-data-to-comples-result/m-p/959743#M15811Marek_C_2013-03-04T05:31:39ZHi Marek,
https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-FFT-Real-input-data-to-comples-result/m-p/959744#M15812
<P>Hi Marek,</P>
<P>Please (1) change DFTI_REAL to DFTI_COMPLEX in DftiCreateDescriptor and (2) add the following line before DftiCommitDescriptor.</P>
<P>status = DftiSetValue(fft_handle, DFTI_COMPLEX_STORAGE, DFTI_REAL_REAL);</P>
<P>If you care about time taken by calls to MKL FFT routines, please look at examples/dftc/source/basic_dp_real_dft_1d.c (I assume that you use MKL 11) which explains how to compute only the first half of the output. The output will be stored in one array of complex numbers, real and imaginary parts interleaved. The second half of the output can be recovered as follows out<K>=conj(out[fftpoint-k]) (k>=1) and out[0]=conj(out[0]), since FFT of real signal has conjugate-even symmetry. Please see the MKL Reference Manual for more detail.</K></P>
<P>Thanks,</P>
<P>Evgueni.</P>Mon, 04 Mar 2013 06:28:10 GMThttps://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-FFT-Real-input-data-to-comples-result/m-p/959744#M15812Evgueni_P_Intel2013-03-04T06:28:10ZThank you, I was able to
https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-FFT-Real-input-data-to-comples-result/m-p/959745#M15813
<P>Thank you, I was able to somehow solve my problem, by not using my idea I presented here.</P>
<P>However I have one question. Why does MKL FFT do not produce symmetric fft?</P>
<P>Matlab for fftpoint = 4096 creates symmetric fft, but MKL only first half? (2048 samples are result, the rest is mirror image)</P>
<P>One data point in Matlab is represented by two after MKL's fft. Is it possible to change this somewhere?</P>
<P>Regards</P>
<P>Marek</P>Mon, 04 Mar 2013 07:15:39 GMThttps://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-FFT-Real-input-data-to-comples-result/m-p/959745#M15813Marek_C_2013-03-04T07:15:39ZComputing only the first half
https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-FFT-Real-input-data-to-comples-result/m-p/959746#M15814
<P>Computing only the first half of the output is the documented behavior of MKL real-to-complex FFTs. It is the applications using MKL real-to-complex FFTs that are expected to restore the second half of the output. For example, you may add to your application a small inline function or a macro to this end.</P>
<P> </P>Mon, 04 Mar 2013 07:41:26 GMThttps://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-FFT-Real-input-data-to-comples-result/m-p/959746#M15814Evgueni_P_Intel2013-03-04T07:41:26Z