<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Hi Ashutosh, in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Intel-MKL-FFT-for-forward-and-backward-Fourier-transform-of-2D/m-p/1101718#M23927</link>
    <description>&lt;P&gt;&lt;SPAN style="font-size: 12px;"&gt;Hi Ashutosh,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px;"&gt;You created descriptor that&amp;nbsp;&lt;/SPAN&gt;Forward domain of the transform&amp;nbsp;is real not complex. image part would not be calculated. That's the reason you get all values of im with zero. Please refer developer reference:&amp;nbsp;&lt;A href="https://software.intel.com/en-us/node/521976"&gt;https://software.intel.com/en-us/node/521976&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 10 May 2017 05:42:53 GMT</pubDate>
    <dc:creator>Zhen_Z_Intel</dc:creator>
    <dc:date>2017-05-10T05:42:53Z</dc:date>
    <item>
      <title>Intel MKL FFT for forward and backward Fourier transform of 2D data</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Intel-MKL-FFT-for-forward-and-backward-Fourier-transform-of-2D/m-p/1101715#M23924</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am trying to do forward and backward Fourier transform using the FFT routines available in Intel MKL. I have taken help of manual and also website examples to do this but i am getting a segmentation fault. Please help me to resolve it.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I am taking real valued as input to FFT forward and want output in Complex form.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Following is my code which i have implemented so far&lt;/P&gt;

&lt;P&gt;#include &amp;lt;iostream&amp;gt;&lt;/P&gt;

&lt;P&gt;#include "mkl_dfti.h"&lt;/P&gt;

&lt;P&gt;typedef struct {&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; float re;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; float im;&lt;BR /&gt;
	} mkl_float_complex;&lt;/P&gt;

&lt;P&gt;using namespace std;&lt;/P&gt;

&lt;P&gt;int main(int argc, char **argv)&lt;BR /&gt;
	{&lt;/P&gt;

&lt;P&gt;//Read binary file in array xr_in dimension 2001 X 1911&lt;/P&gt;

&lt;P&gt;n2=2001 n1=1911&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; mkl_float_complex **xc_out;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; DFTI_DESCRIPTOR_HANDLE desc_handle_for, desc_handle_back;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; MKL_LONG status;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; MKL_LONG lengths[2];&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; lengths[0] = n2; &amp;nbsp; &amp;nbsp; &amp;nbsp;lengths[1] = n1;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; xc_out = (mkl_float_complex**) malloc(sizeof(mkl_float_complex*)*n2);&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; for(i2 = 0; i2 &amp;lt; n2; i2++)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xc_out[i2] = (mkl_float_complex*) malloc(sizeof(mkl_float_complex)*n1);&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;status = DftiCreateDescriptor(&amp;amp;desc_handle_for, DFTI_SINGLE, DFTI_REAL, 2, lengths);&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;status = DftiSetValue(desc_handle_for, DFTI_CONJUGATE_EVEN_STORAGE, DFTI_COMPLEX_COMPLEX);&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;status = DftiSetValue(desc_handle_for, DFTI_PACKED_FORMAT, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DFTI_CCE_FORMAT);&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;status = DftiSetValue(desc_handle_for, DFTI_PLACEMENT, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DFTI_NOT_INPLACE);&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;status = DftiCommitDescriptor(desc_handle_for);&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;status = DftiComputeForward(desc_handle_for, xr_in, xc_out);&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;status = DftiFreeDescriptor(&amp;amp;desc_handle_for);&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;//Writing real part only to file&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; //Open file&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;for(i2 = 0; i2 &amp;lt; n2; i2++)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for(i1 = 0; i1 &amp;lt; n1; i1++)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fwrite(&amp;amp;(xc_out[i2][i1].re), sizeof(float), 1, fp);&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;//Close file&lt;/P&gt;

&lt;P&gt;}//End of main&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2017 06:03:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Intel-MKL-FFT-for-forward-and-backward-Fourier-transform-of-2D/m-p/1101715#M23924</guid>
      <dc:creator>Londhe__Ashutosh</dc:creator>
      <dc:date>2017-05-09T06:03:08Z</dc:date>
    </item>
    <item>
      <title>Hi Ashutosh,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Intel-MKL-FFT-for-forward-and-backward-Fourier-transform-of-2D/m-p/1101716#M23925</link>
      <description>&lt;P&gt;Hi Ashutosh,&lt;/P&gt;

&lt;P&gt;Please define input/output matrix as two dimentional array to replace using pointer. You must insure data is saved in continuous memory space.&lt;/P&gt;

&lt;P&gt;Like:&lt;/P&gt;

&lt;P&gt;mkl_float_complex xr_in[2001][1191];&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; xr_in&lt;I&gt;&lt;J&gt;.re=...;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; xr_in&lt;I&gt;&lt;J&gt;.im=...;&lt;/J&gt;&lt;/I&gt;&lt;/J&gt;&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2017 08:54:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Intel-MKL-FFT-for-forward-and-backward-Fourier-transform-of-2D/m-p/1101716#M23925</guid>
      <dc:creator>Zhen_Z_Intel</dc:creator>
      <dc:date>2017-05-09T08:54:26Z</dc:date>
    </item>
    <item>
      <title>Dear Fiona Z,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Intel-MKL-FFT-for-forward-and-backward-Fourier-transform-of-2D/m-p/1101717#M23926</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;A href="https://software.intel.com/en-us/user/1400350" style="cursor: pointer; font-size: 11px; background-color: rgb(238, 238, 238);"&gt;Fiona Z&lt;/A&gt;,&lt;/P&gt;

&lt;P&gt;The solution you provided worked.&lt;/P&gt;

&lt;P&gt;Now no error, but i have written the real and imag part to separate file which shows only half of the portion and other half is zero in n1 dimension. Do i need to increase the number of transform. Or do i have to set any other value also apart from which are specified in code snippet.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2017 10:32:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Intel-MKL-FFT-for-forward-and-backward-Fourier-transform-of-2D/m-p/1101717#M23926</guid>
      <dc:creator>Londhe__Ashutosh</dc:creator>
      <dc:date>2017-05-09T10:32:00Z</dc:date>
    </item>
    <item>
      <title>Hi Ashutosh,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Intel-MKL-FFT-for-forward-and-backward-Fourier-transform-of-2D/m-p/1101718#M23927</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 12px;"&gt;Hi Ashutosh,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px;"&gt;You created descriptor that&amp;nbsp;&lt;/SPAN&gt;Forward domain of the transform&amp;nbsp;is real not complex. image part would not be calculated. That's the reason you get all values of im with zero. Please refer developer reference:&amp;nbsp;&lt;A href="https://software.intel.com/en-us/node/521976"&gt;https://software.intel.com/en-us/node/521976&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 05:42:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Intel-MKL-FFT-for-forward-and-backward-Fourier-transform-of-2D/m-p/1101718#M23927</guid>
      <dc:creator>Zhen_Z_Intel</dc:creator>
      <dc:date>2017-05-10T05:42:53Z</dc:date>
    </item>
  </channel>
</rss>

