<?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 The FFT adjusts only a half size. in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/The-FFT-adjusts-only-a-half-size/m-p/882774#M9739</link>
    <description>&lt;P&gt;I received below source code from Dima. I adjusted it to image.&lt;/P&gt;
&lt;P&gt;--------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;You probably did the small size on a static array, defined as x[100][40]. The way the dynamic array is arranged in your example is incorrect and it demonstrates typical mistake. For static array '_complex x&lt;M&gt;&lt;N&gt;' expression 'x' has type '_complex *' whereas for dynamic array that one would use with double-subscript notation 'x&lt;I&gt;&lt;J&gt;' the type of 'x' is '_complex**' that is pointer to pointers. In other words, in this example when you call DftiComputeForward(..., x) the input data to the FFT routine is pointers, not the complex numbers!&lt;/J&gt;&lt;/I&gt;&lt;/N&gt;&lt;/M&gt;&lt;/P&gt;
&lt;P&gt;I'd suggest you to refrain from the practice of using double-subscript notation for dynamic arrays, and adopt the following usage instead:&lt;/P&gt;
&lt;P&gt;const int ROWS=3072, COLS=2560;&lt;/P&gt;
&lt;P&gt;const int ROWSIZE=COLS, COLSIZE=ROWS;&lt;/P&gt;
&lt;P&gt;_complex *x = new _complex[ROWS*COLS];&lt;/P&gt;
&lt;P&gt;#define x(r,c) x[*ROWSIZE+(c)] /* explicit row-major indexing */&lt;/P&gt;
&lt;P&gt;memset(x,0,sizeof(x[0])*ROWS*COLS); /* zero fill initialization */&lt;/P&gt;
&lt;P&gt;for (r=0;r&lt;ROWS&gt;
&lt;/ROWS&gt;&lt;/P&gt;&lt;P&gt;The rest of this reply is duplicating your example in the above terms.&lt;/P&gt;
&lt;P&gt;DftiCreateDescriptor(rowfft,DFTI_SINGLE,DFTI_COMPLEX,1,ROWSIZE); /* stride 1 by default */&lt;/P&gt;
&lt;P&gt;DftiSetValue(rowfft,DFTI_NUMBER_OF_TRANSFORMS,(MKL_LONG)ROWS);&lt;/P&gt;
&lt;P&gt;DftiSetValue(rowfft,DFTI_INPUT_DISTANCE,(MKL_LONG)ROWSIZE);&lt;/P&gt;
&lt;P&gt;DftiSetValue(rowfft,DFTI_OUTPUT_DISTANCE,(MKL_LONG)ROWSIZE);&lt;/P&gt;
&lt;P&gt;DftiCreateDescriptor(colfft,DFTI_SINGLE,DFTI_COMPLEX,1,COLSIZE); /* will set strides */&lt;/P&gt;
&lt;P&gt;MKL_LONG colfft_strides[] = { 0, ROWSIZE };&lt;/P&gt;
&lt;P&gt;DftiSetValue(colfft,DFTI_INPUT_STRIDES,colfft_strides);&lt;/P&gt;
&lt;P&gt;DftiSetValue(colfft,DFTI_OUTPUT_STRIDES,colfft_strides);&lt;/P&gt;
&lt;P&gt;DftiSetValue(colfft,DFTI_NUMBER_OF_TRANSFORMS,(MKL_LONG)COLS);&lt;/P&gt;
&lt;P&gt;DftiSetValue(colfft,DFTI_INPUT_DISTANCE,(MKL_LONG)1);&lt;/P&gt;
&lt;P&gt;DftiSetValue(colfft,DFTI_OUTPUT_DISTANCE,(MKL_LONG)1);&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;DftiComputeForward(rowfft,x);&lt;/P&gt;
&lt;P&gt;DftiComputeForward(colfft,x);&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Dima&lt;/P&gt;
&lt;P&gt;--------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;///FFT&lt;/P&gt;
&lt;P&gt;DftiComputeForward(rowfft,x);&lt;/P&gt;
&lt;P&gt;DftiComputeForward(colfft,x);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//Inverse FFT&lt;/P&gt;
&lt;P&gt;DftiComputeBackward(rowfft,x);&lt;/P&gt;
&lt;P&gt;DftiComputeBackward(colfft,x);&lt;/P&gt;
&lt;P&gt;like this...&lt;/P&gt;
&lt;P&gt;but The FFT adjusted only 2560*1536(original image size is 2560*3072)&lt;/P&gt;
&lt;P&gt;Which code should I change?&lt;/P&gt;</description>
    <pubDate>Fri, 26 Feb 2010 01:42:15 GMT</pubDate>
    <dc:creator>siinii</dc:creator>
    <dc:date>2010-02-26T01:42:15Z</dc:date>
    <item>
      <title>The FFT adjusts only a half size.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/The-FFT-adjusts-only-a-half-size/m-p/882774#M9739</link>
      <description>&lt;P&gt;I received below source code from Dima. I adjusted it to image.&lt;/P&gt;
&lt;P&gt;--------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;You probably did the small size on a static array, defined as x[100][40]. The way the dynamic array is arranged in your example is incorrect and it demonstrates typical mistake. For static array '_complex x&lt;M&gt;&lt;N&gt;' expression 'x' has type '_complex *' whereas for dynamic array that one would use with double-subscript notation 'x&lt;I&gt;&lt;J&gt;' the type of 'x' is '_complex**' that is pointer to pointers. In other words, in this example when you call DftiComputeForward(..., x) the input data to the FFT routine is pointers, not the complex numbers!&lt;/J&gt;&lt;/I&gt;&lt;/N&gt;&lt;/M&gt;&lt;/P&gt;
&lt;P&gt;I'd suggest you to refrain from the practice of using double-subscript notation for dynamic arrays, and adopt the following usage instead:&lt;/P&gt;
&lt;P&gt;const int ROWS=3072, COLS=2560;&lt;/P&gt;
&lt;P&gt;const int ROWSIZE=COLS, COLSIZE=ROWS;&lt;/P&gt;
&lt;P&gt;_complex *x = new _complex[ROWS*COLS];&lt;/P&gt;
&lt;P&gt;#define x(r,c) x[*ROWSIZE+(c)] /* explicit row-major indexing */&lt;/P&gt;
&lt;P&gt;memset(x,0,sizeof(x[0])*ROWS*COLS); /* zero fill initialization */&lt;/P&gt;
&lt;P&gt;for (r=0;r&lt;ROWS&gt;
&lt;/ROWS&gt;&lt;/P&gt;&lt;P&gt;The rest of this reply is duplicating your example in the above terms.&lt;/P&gt;
&lt;P&gt;DftiCreateDescriptor(rowfft,DFTI_SINGLE,DFTI_COMPLEX,1,ROWSIZE); /* stride 1 by default */&lt;/P&gt;
&lt;P&gt;DftiSetValue(rowfft,DFTI_NUMBER_OF_TRANSFORMS,(MKL_LONG)ROWS);&lt;/P&gt;
&lt;P&gt;DftiSetValue(rowfft,DFTI_INPUT_DISTANCE,(MKL_LONG)ROWSIZE);&lt;/P&gt;
&lt;P&gt;DftiSetValue(rowfft,DFTI_OUTPUT_DISTANCE,(MKL_LONG)ROWSIZE);&lt;/P&gt;
&lt;P&gt;DftiCreateDescriptor(colfft,DFTI_SINGLE,DFTI_COMPLEX,1,COLSIZE); /* will set strides */&lt;/P&gt;
&lt;P&gt;MKL_LONG colfft_strides[] = { 0, ROWSIZE };&lt;/P&gt;
&lt;P&gt;DftiSetValue(colfft,DFTI_INPUT_STRIDES,colfft_strides);&lt;/P&gt;
&lt;P&gt;DftiSetValue(colfft,DFTI_OUTPUT_STRIDES,colfft_strides);&lt;/P&gt;
&lt;P&gt;DftiSetValue(colfft,DFTI_NUMBER_OF_TRANSFORMS,(MKL_LONG)COLS);&lt;/P&gt;
&lt;P&gt;DftiSetValue(colfft,DFTI_INPUT_DISTANCE,(MKL_LONG)1);&lt;/P&gt;
&lt;P&gt;DftiSetValue(colfft,DFTI_OUTPUT_DISTANCE,(MKL_LONG)1);&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;DftiComputeForward(rowfft,x);&lt;/P&gt;
&lt;P&gt;DftiComputeForward(colfft,x);&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Dima&lt;/P&gt;
&lt;P&gt;--------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;///FFT&lt;/P&gt;
&lt;P&gt;DftiComputeForward(rowfft,x);&lt;/P&gt;
&lt;P&gt;DftiComputeForward(colfft,x);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//Inverse FFT&lt;/P&gt;
&lt;P&gt;DftiComputeBackward(rowfft,x);&lt;/P&gt;
&lt;P&gt;DftiComputeBackward(colfft,x);&lt;/P&gt;
&lt;P&gt;like this...&lt;/P&gt;
&lt;P&gt;but The FFT adjusted only 2560*1536(original image size is 2560*3072)&lt;/P&gt;
&lt;P&gt;Which code should I change?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2010 01:42:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/The-FFT-adjusts-only-a-half-size/m-p/882774#M9739</guid>
      <dc:creator>siinii</dc:creator>
      <dc:date>2010-02-26T01:42:15Z</dc:date>
    </item>
    <item>
      <title>The FFT adjusts only a half size.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/The-FFT-adjusts-only-a-half-size/m-p/882775#M9740</link>
      <description>&lt;P&gt;The excerpt looks good, and it should process whole array.&lt;/P&gt;
&lt;P&gt;Could you provide a self-contained example that shows your problem?&lt;/P&gt;
&lt;P&gt;Thanks&lt;BR /&gt;Dima&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2010 07:23:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/The-FFT-adjusts-only-a-half-size/m-p/882775#M9740</guid>
      <dc:creator>Dmitry_B_Intel</dc:creator>
      <dc:date>2010-02-26T07:23:51Z</dc:date>
    </item>
  </channel>
</rss>

