<?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 computing inverser fourier transform when output length is small then input in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/computing-inverser-fourier-transform-when-output-length-is-small/m-p/1579766#M35911</link>
    <description>&lt;P&gt;I have a input matrix whose size is &lt;FONT face="courier new,courier"&gt;(lg_child, lt_parent)&lt;/FONT&gt;and it is defined as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;filterd_fourier_coefficients(lg_child, lt_parent)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;For each &lt;FONT face="courier new,courier"&gt;lg_child &lt;/FONT&gt;I&amp;nbsp; take samples of length &lt;FONT face="courier new,courier"&gt;lt_parent&lt;/FONT&gt; and perform inverse Fourier transformation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The setup is,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;DFTI_DESCRIPTOR_HANDLE ifft = NULL;
status = DftiCreateDescriptor(&amp;amp;ifft, DFTI_DOUBLE, DFTI_COMPLEX, 1, lt_parent);
status = DftiSetValue        ( ifft, DFTI_PLACEMENT, DFTI_NOT_INPLACE);
status = DftiCommitDescriptor( ifft);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The input and output is defined as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;std::complex&amp;lt;double&amp;gt; samples_in[lt_parent];
std::complex&amp;lt;double&amp;gt; samples_out[lt_parent];

for (int l=0; l&amp;lt;lt_parent; l++)
{
   samples_in[l] = filterd_fourier_coefficients(j, l);
}   

status = DftiComputeBackward(ifft, samples_in, samples_out);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output matrix is &lt;FONT face="courier new,courier"&gt;filtered_grid(lt_child, lg_child)&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;(lt_child &amp;lt; lt_parent)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;for (int i=0; i&amp;lt;lt_child; i++)
{
   double phi = trapezoidal_child.get_nodes(i);    
    
   filtered_grid(i, j) = sqrt(2.0 * pi)           * 
                         Internal::expi(-K * phi) *  
                         samples_out[i];
}        &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;results in bad filtering.&lt;BR /&gt;&lt;BR /&gt;Info: The input matrix is normalized with &lt;FONT face="courier new,courier"&gt;(1/lt_parent)&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;What do I have to do when truncating the &lt;FONT face="courier new,courier"&gt;samples_out&lt;/FONT&gt; and what exactly is missing?&lt;/P&gt;</description>
    <pubDate>Tue, 12 Mar 2024 11:20:46 GMT</pubDate>
    <dc:creator>raavi</dc:creator>
    <dc:date>2024-03-12T11:20:46Z</dc:date>
    <item>
      <title>computing inverser fourier transform when output length is small then input</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/computing-inverser-fourier-transform-when-output-length-is-small/m-p/1579766#M35911</link>
      <description>&lt;P&gt;I have a input matrix whose size is &lt;FONT face="courier new,courier"&gt;(lg_child, lt_parent)&lt;/FONT&gt;and it is defined as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;filterd_fourier_coefficients(lg_child, lt_parent)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;For each &lt;FONT face="courier new,courier"&gt;lg_child &lt;/FONT&gt;I&amp;nbsp; take samples of length &lt;FONT face="courier new,courier"&gt;lt_parent&lt;/FONT&gt; and perform inverse Fourier transformation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The setup is,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;DFTI_DESCRIPTOR_HANDLE ifft = NULL;
status = DftiCreateDescriptor(&amp;amp;ifft, DFTI_DOUBLE, DFTI_COMPLEX, 1, lt_parent);
status = DftiSetValue        ( ifft, DFTI_PLACEMENT, DFTI_NOT_INPLACE);
status = DftiCommitDescriptor( ifft);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The input and output is defined as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;std::complex&amp;lt;double&amp;gt; samples_in[lt_parent];
std::complex&amp;lt;double&amp;gt; samples_out[lt_parent];

for (int l=0; l&amp;lt;lt_parent; l++)
{
   samples_in[l] = filterd_fourier_coefficients(j, l);
}   

status = DftiComputeBackward(ifft, samples_in, samples_out);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output matrix is &lt;FONT face="courier new,courier"&gt;filtered_grid(lt_child, lg_child)&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;(lt_child &amp;lt; lt_parent)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;for (int i=0; i&amp;lt;lt_child; i++)
{
   double phi = trapezoidal_child.get_nodes(i);    
    
   filtered_grid(i, j) = sqrt(2.0 * pi)           * 
                         Internal::expi(-K * phi) *  
                         samples_out[i];
}        &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;results in bad filtering.&lt;BR /&gt;&lt;BR /&gt;Info: The input matrix is normalized with &lt;FONT face="courier new,courier"&gt;(1/lt_parent)&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;What do I have to do when truncating the &lt;FONT face="courier new,courier"&gt;samples_out&lt;/FONT&gt; and what exactly is missing?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 11:20:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/computing-inverser-fourier-transform-when-output-length-is-small/m-p/1579766#M35911</guid>
      <dc:creator>raavi</dc:creator>
      <dc:date>2024-03-12T11:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: computing inverser fourier transform when output length is small then input</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/computing-inverser-fourier-transform-when-output-length-is-small/m-p/1580193#M35920</link>
      <description>&lt;P&gt;Fixed: Rather a trivial one but there is one more problem.&lt;BR /&gt;&lt;BR /&gt;Its the part of the implementation of Fast Spherical Filter to interpolate or filter the samples on the sphere.&lt;/P&gt;&lt;P&gt;The steps involve&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Compute the Fourier co-efficients of samples the latitude&lt;/LI&gt;&lt;LI&gt;Compute the spherical co-efficients from 1.&lt;/LI&gt;&lt;LI&gt;Compute the filtered Fourier co-efficients from 2.&lt;/LI&gt;&lt;LI&gt;Finally the filtered grid where the inverse Fourier transformation is performed on filtered Fourier co-efficients&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Before attempt to use APIs from Intel, I manually computed the DFT and IDFT in step 1 and 4. Nevertheless the bug is rather trivial and nothing to do with Intel APIs at all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the bug where I miss-allocated the longitude and&amp;nbsp;latitude samples of the sphere.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;filtered_grid(lg_child, lt_child)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;it should be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;filtered_grid(lt_child, lg_child)&lt;/LI-CODE&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>Thu, 14 Mar 2024 10:55:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/computing-inverser-fourier-transform-when-output-length-is-small/m-p/1580193#M35920</guid>
      <dc:creator>raavi</dc:creator>
      <dc:date>2024-03-14T10:55:16Z</dc:date>
    </item>
    <item>
      <title>Re:computing inverser fourier transform when output length is small then input</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/computing-inverser-fourier-transform-when-output-length-is-small/m-p/1580404#M35922</link>
      <description>&lt;P&gt;I'm just interested,&amp;nbsp;what fix did you apply?&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 14 Mar 2024 07:32:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/computing-inverser-fourier-transform-when-output-length-is-small/m-p/1580404#M35922</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2024-03-14T07:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: computing inverser fourier transform when output length is small then input</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/computing-inverser-fourier-transform-when-output-length-is-small/m-p/1580446#M35924</link>
      <description>&lt;P&gt;Any help in computing the truncation will be much appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 10:56:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/computing-inverser-fourier-transform-when-output-length-is-small/m-p/1580446#M35924</guid>
      <dc:creator>raavi</dc:creator>
      <dc:date>2024-03-14T10:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: Re:computing inverser fourier transform when output length is small then input</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/computing-inverser-fourier-transform-when-output-length-is-small/m-p/1580450#M35925</link>
      <description>&lt;P&gt;Though it works with manual computation of Inverse Fourier Transform, I still have a difficulty in using the API to get the correct truncated values.&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;DFTI_DESCRIPTOR_HANDLE ifft_handle = NULL;
status = DftiCreateDescriptor(&amp;amp;ifft_handle, DFTI_DOUBLE,    DFTI_COMPLEX, 1, lt_parent);
status = DftiSetValue        ( ifft_handle, DFTI_PLACEMENT, DFTI_NOT_INPLACE);
status = DftiCommitDescriptor( ifft_handle);

for (int j=0; j&amp;lt;lg_child; j++)                
{                            
    std::complex&amp;lt;double&amp;gt; x_coefficients_in[lt_parent];
    std::complex&amp;lt;double&amp;gt; x_coefficients_out[lt_parent];

    for (int l=0; l&amp;lt;lt_parent; l++)
    {
        x_coefficients_in[l] = filterd_fourier_coefficients(j, l);
    }   
                
    status = DftiComputeBackward(ifft_handle, x_coefficients_in, x_coefficients_out);

    for (int i=0; i&amp;lt;lt_child; i++)
    {
        double phi          = trapezoidal_child.get_nodes(i);        
        filtered_grid(i, j) = sqrt(2.0 * pi) * Internal::expi(-K * phi) * x_coefficients_out[i];
    }        
}
    
status = DftiFreeDescriptor(&amp;amp;ifft_handle);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I have an input &lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;x_coefficients_in&lt;/STRONG&gt;&lt;/FONT&gt; whose length is &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;lt_parent &lt;/FONT&gt;&lt;/STRONG&gt;and after transformation how do I truncate to length &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;lt_child&lt;/FONT&gt;&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Info: &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;lt_parent&lt;/FONT&gt;&lt;/STRONG&gt; &amp;gt; &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;lt_child&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code which I have posted does not give the correct results.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 10:52:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/computing-inverser-fourier-transform-when-output-length-is-small/m-p/1580450#M35925</guid>
      <dc:creator>raavi</dc:creator>
      <dc:date>2024-03-14T10:52:18Z</dc:date>
    </item>
  </channel>
</rss>

