<?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 How to compute1D FFT of 2D array in another dimension without reshaping the array. in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-compute1D-FFT-of-2D-array-in-another-dimension-without/m-p/1165032#M28175</link>
    <description>&lt;P&gt;I want to compute 1D FFT of a 2D array stored as a 1D array in another dimension. For example the 2D array is stored as:&lt;/P&gt;
&lt;PRE class="brush:cpp; class-name:dark;"&gt;for(int j=0; j&amp;lt;NJ; j++) //rows
{
    for(int i=0; i&amp;lt;NI; i++) //colums
        {
            Ori_2D_array[i+j*NI]=1.0;
        }
}&lt;/PRE&gt;

&lt;P&gt;Now I want to compute the 1D FFT of the&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;Ori_2D_array &lt;/STRONG&gt;in the row dimension. The only way I can think out is reshaping the&amp;nbsp;&lt;STRONG&gt;Ori_2D_array &lt;/STRONG&gt;then doing the fft:&lt;/P&gt;

&lt;PRE class="brush:cpp; class-name:dark;"&gt;for (int i=0; i&amp;lt;NI; i++)
{
  for (int j=0; j&amp;lt;NJ; j++)
    {
      2D_array[j+i*NJ]=Ori_2D_array[i+j*NI];
    }
}


DFTI_DESCRIPTOR_HANDLE desc_x = 0;
DftiCreateDescriptor(&amp;amp;desc_x, DFTI_PREC, DFTI_COMPLEX, 1, NJ);
DftiSetValue(desc_x, DFTI_NUMBER_OF_TRANSFORMS, NI);
DftiSetValue(desc_x, DFTI_INPUT_DISTANCE,  NJ);
DftiCommitDescriptor(desc_x);
DftiComputeForward(desc_x, 2D_array);&lt;/PRE&gt;

&lt;P&gt;Reshaping&amp;nbsp;&lt;STRONG&gt;Ori_2D_array &lt;/STRONG&gt;wasting too much time. Is there anyway to do the FFT without reshaping&amp;nbsp;&lt;STRONG&gt;Ori_2D_arra.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Please advise!&lt;/P&gt;</description>
    <pubDate>Thu, 07 Mar 2019 02:12:52 GMT</pubDate>
    <dc:creator>Jie__Chen</dc:creator>
    <dc:date>2019-03-07T02:12:52Z</dc:date>
    <item>
      <title>How to compute1D FFT of 2D array in another dimension without reshaping the array.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-compute1D-FFT-of-2D-array-in-another-dimension-without/m-p/1165032#M28175</link>
      <description>&lt;P&gt;I want to compute 1D FFT of a 2D array stored as a 1D array in another dimension. For example the 2D array is stored as:&lt;/P&gt;
&lt;PRE class="brush:cpp; class-name:dark;"&gt;for(int j=0; j&amp;lt;NJ; j++) //rows
{
    for(int i=0; i&amp;lt;NI; i++) //colums
        {
            Ori_2D_array[i+j*NI]=1.0;
        }
}&lt;/PRE&gt;

&lt;P&gt;Now I want to compute the 1D FFT of the&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;Ori_2D_array &lt;/STRONG&gt;in the row dimension. The only way I can think out is reshaping the&amp;nbsp;&lt;STRONG&gt;Ori_2D_array &lt;/STRONG&gt;then doing the fft:&lt;/P&gt;

&lt;PRE class="brush:cpp; class-name:dark;"&gt;for (int i=0; i&amp;lt;NI; i++)
{
  for (int j=0; j&amp;lt;NJ; j++)
    {
      2D_array[j+i*NJ]=Ori_2D_array[i+j*NI];
    }
}


DFTI_DESCRIPTOR_HANDLE desc_x = 0;
DftiCreateDescriptor(&amp;amp;desc_x, DFTI_PREC, DFTI_COMPLEX, 1, NJ);
DftiSetValue(desc_x, DFTI_NUMBER_OF_TRANSFORMS, NI);
DftiSetValue(desc_x, DFTI_INPUT_DISTANCE,  NJ);
DftiCommitDescriptor(desc_x);
DftiComputeForward(desc_x, 2D_array);&lt;/PRE&gt;

&lt;P&gt;Reshaping&amp;nbsp;&lt;STRONG&gt;Ori_2D_array &lt;/STRONG&gt;wasting too much time. Is there anyway to do the FFT without reshaping&amp;nbsp;&lt;STRONG&gt;Ori_2D_arra.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Please advise!&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2019 02:12:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/How-to-compute1D-FFT-of-2D-array-in-another-dimension-without/m-p/1165032#M28175</guid>
      <dc:creator>Jie__Chen</dc:creator>
      <dc:date>2019-03-07T02:12:52Z</dc:date>
    </item>
  </channel>
</rss>

