<?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 thanks for posting your in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/FFT-scale-factor-usage-is-inconsistant/m-p/922186#M13112</link>
    <description>&lt;P&gt;Hi thanks for posting your question. Your code snippets have cramped into a big text blob that is very hard to read. Would you please attach a file of your code using the upload button?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 14 Jun 2013 20:37:03 GMT</pubDate>
    <dc:creator>Zhang_Z_Intel</dc:creator>
    <dc:date>2013-06-14T20:37:03Z</dc:date>
    <item>
      <title>FFT scale factor usage is inconsistant</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/FFT-scale-factor-usage-is-inconsistant/m-p/922185#M13111</link>
      <description>&lt;P&gt;I downloaded a 30-day trial of MKL to play around with the 2D FFT and test the speed of the routines. The performance has been exceptional and I plan to purchase a license. But I ran into one issue that looks like a software bug. I am coding in C#. If I use a simple real array input, forward transform, and backward transform, the resulting array, x_normal, contains the same as my inputted array. But if I use a real and imaginary array input, forward transform, and backward transform, the resulting aray, x_normal_real, differs from the inputted array by the scale factor. In my case, I send a image of 1024 x 1024, so the scale factor is 1 / 1024 * 1 / 1024 = .0.0000009536743164. Is there a reason why complex 2D input is not scaled like real 2D input? For more information, I include the relevant portions of my two code cases below. Method 1: Real var desc = new IntPtr(); int precision = DFTI.DOUBLE; int forward_domain = DFTI.REAL; // DFTI.COMPLEX; int dimension = 2; int[] len = {rows, columns}; // Create the new DTFI descriptor int ret = DFTI.DftiCreateDescriptor(ref desc, precision, forward_domain, dimension, len); // Setup the scale factor long transform_size = rows * columns; double scale_factor = 1.0 / transform_size; DFTI.DftiSetValue(desc, DFTI.BACKWARD_SCALE, scale_factor); // Setup the transform parameters DFTI.DftiSetValue(desc, DFTI.PLACEMENT, DFTI.NOT_INPLACE); DFTI.DftiSetValue(desc, DFTI.PACKED_FORMAT, DFTI.PACK_FORMAT); // Commit the descriptor DFTI.DftiCommitDescriptor(desc); // The data to be transformed var x_normal = new double[rows * columns]; var x_transformed = new double[rows * columns]; // Initialize the data array for (int y = 0; y &amp;lt; rows; y++) // actually v for (int x = 0; x &amp;lt; columns; x++) // actually u x_normal[y*rows + x] = ((frameImageData[y, x] &amp;gt; 100.0) ? 100.0 : frameImageData[y, x]) + baseline; // Forward transform DFTI.DftiComputeForward(desc, x_normal, x_transformed); // Backward transform DFTI.DftiComputeBackward(desc, x_transformed, x_normal); DFTI.DftiFreeDescriptor(ref desc); Method 2: Complex var desc = new IntPtr(); int precision = DFTI.DOUBLE; int forward_domain = DFTI.COMPLEX; int dimension = 2; int[] len = {rows, columns}; // Create the new DTFI descriptor int ret = DFTI.DftiCreateDescriptor(ref desc, precision, forward_domain, dimension, len); // Setup the scale factor long transform_size = rows * columns; double scale_factor = 1.0 / transform_size; DFTI.DftiSetValue(desc, DFTI.BACKWARD_SCALE, scale_factor); // Try floating-point and GetValue function double backward_scale = 0.0; DFTI.DftiGetValue(desc, DFTI.BACKWARD_SCALE, ref backward_scale); // Setup the transform parameters DFTI.DftiSetValue(desc, DFTI.PLACEMENT, DFTI.NOT_INPLACE); DFTI.DftiSetValue(desc, DFTI.PACKED_FORMAT, DFTI.PACK_FORMAT); DFTI.DftiSetValue(desc, DFTI.COMPLEX_STORAGE, DFTI.REAL_REAL); // Commit the descriptor DFTI.DftiCommitDescriptor(desc); // The data to be transformed var x_normal_real = new double[rows * columns]; var x_normal_imaginary = new double[rows * columns]; var x_transformed_real = new double[rows * columns]; var x_transformed_imaginary = new double[rows * columns]; // Initialize the data array for (int y = 0; y &amp;lt; rows; y++) // actually v for (int x = 0; x &amp;lt; columns; x++) // actually u x_normal_real[y*rows + x] = ((frameImageData[y, x] &amp;gt; 100.0) ? 100.0 : frameImageData[y, x]) + baseline; for (int z = 0; z &amp;lt; rows * columns; z++) x_normal_imaginary[0] = 0.0; // Forward transform DFTI.DftiComputeForward(desc, x_normal_real, x_normal_imaginary, x_transformed_real, x_transformed_imaginary); // Backward transform DFTI.DftiComputeBackward(desc, x_transformed_real, x_transformed_imaginary, x_normal_real, x_normal_imaginary); DFTI.DftiFreeDescriptor(ref desc);&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2013 20:27:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/FFT-scale-factor-usage-is-inconsistant/m-p/922185#M13111</guid>
      <dc:creator>kingsley_s_</dc:creator>
      <dc:date>2013-06-14T20:27:09Z</dc:date>
    </item>
    <item>
      <title>Hi thanks for posting your</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/FFT-scale-factor-usage-is-inconsistant/m-p/922186#M13112</link>
      <description>&lt;P&gt;Hi thanks for posting your question. Your code snippets have cramped into a big text blob that is very hard to read. Would you please attach a file of your code using the upload button?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2013 20:37:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/FFT-scale-factor-usage-is-inconsistant/m-p/922186#M13112</guid>
      <dc:creator>Zhang_Z_Intel</dc:creator>
      <dc:date>2013-06-14T20:37:03Z</dc:date>
    </item>
    <item>
      <title>Preview showed nice</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/FFT-scale-factor-usage-is-inconsistant/m-p/922187#M13113</link>
      <description>Preview showed nice formatting of code. But after commit, all formatting was lost. Here is attachment.</description>
      <pubDate>Fri, 14 Jun 2013 21:43:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/FFT-scale-factor-usage-is-inconsistant/m-p/922187#M13113</guid>
      <dc:creator>kingsley_s_</dc:creator>
      <dc:date>2013-06-14T21:43:02Z</dc:date>
    </item>
    <item>
      <title>Hi S.,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/FFT-scale-factor-usage-is-inconsistant/m-p/922188#M13114</link>
      <description>&lt;P&gt;Hi S.,&lt;/P&gt;
&lt;P&gt;This is known bug for MKL 11.0.3. It has been fixed in a later release. To workaround this bug, instead of setting BACKWARD_SCALE please scale the image by a separate loop.&lt;/P&gt;
&lt;P&gt;Thanks&lt;BR /&gt;Dima&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2013 06:56:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/FFT-scale-factor-usage-is-inconsistant/m-p/922188#M13114</guid>
      <dc:creator>Dmitry_B_Intel</dc:creator>
      <dc:date>2013-06-18T06:56:02Z</dc:date>
    </item>
  </channel>
</rss>

