<?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 Dionisis,  in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Complex-to-real-IFFT-using-MKL/m-p/1044473#M20900</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Dionisis,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;You may refer to the sample, &amp;nbsp;&lt;/SPAN&gt;basic_dp_real_dft_1d.f90. &amp;nbsp;It is exactly sample for&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;&amp;nbsp;DFTI_CONJUGATE_EVEN_STORAGE, DFTI_COMPLEX_COMPLEX &amp;nbsp;and input for &amp;nbsp;IDFT is&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;x_cmplx(N/2+1)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;print *,"Example basic_dp_real_dft_1d"&lt;BR /&gt;
	&amp;nbsp; print *,"Forward-Backward double-precision real-to-complex", &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;amp;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; " out-of-place 1D transform"&lt;BR /&gt;
	&amp;nbsp; print *,"Configuration parameters:"&lt;BR /&gt;
	&amp;nbsp; print *,"DFTI_PRECISION &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= DFTI_DOUBLE"&lt;BR /&gt;
	&amp;nbsp; print *,"DFTI_FORWARD_DOMAIN &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = DFTI_REAL"&lt;BR /&gt;
	&amp;nbsp; print *,"DFTI_DIMENSION &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= 1"&lt;BR /&gt;
	&amp;nbsp; print '(" DFTI_LENGTHS &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= /"I0"/" )', N&lt;BR /&gt;
	&amp;nbsp; print *,"DFTI_PLACEMENT &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= &amp;nbsp;DFTI_NOT_INPLACE"&lt;BR /&gt;
	&amp;nbsp; print *,"DFTI_CONJUGATE_EVEN_STORAGE = DFTI_COMPLEX_COMPLEX"&lt;/P&gt;

&lt;P&gt;&amp;nbsp;allocate(x_real(N))&lt;BR /&gt;
	&amp;nbsp; allocate(x_cmplx(N/2+1))&lt;/P&gt;

&lt;P&gt;If you don't need the Forward part, &amp;nbsp;you can delete them. &amp;nbsp;i modify the sample and attach here.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Not sure , how your&amp;nbsp;input look likes &amp;nbsp;(is a complex array with &lt;STRONG&gt;z(1) and z(N/2+1) being real ?&amp;nbsp;&lt;/STRONG&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;where X_in has the conjugate symmetry even described above)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;If you setDFTI_CONJUGATE_EVEN_STORAGE = DFTI_COMPLEX_COMPLEX. &amp;nbsp;Then &amp;nbsp;&lt;STRONG&gt;your X_in should be &amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;&lt;STRONG&gt;&amp;nbsp; (x_cmplx(N/2+1))&lt;/STRONG&gt; here. &amp;nbsp;and I mark it as bold. &amp;nbsp;They are half of the FFT 's result.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;Initialize data for real-to-complex FFT&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;102.000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;55.0000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;89.0000000000000&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;12.0000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3.00000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;45.0000000000000&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;9.00000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8.00000000000000&lt;BR /&gt;
	&amp;nbsp;Compute forward transform&lt;BR /&gt;
	&amp;nbsp;Verify the result&lt;BR /&gt;
	&amp;nbsp;&lt;STRONG&gt;(323.000000000000,0.000000000000000E+000) (103.242640687119,-89.8994949366&lt;BR /&gt;
	&amp;nbsp;(7.00000000000000,-80.0000000000000) (94.7573593128807,70.1005050633883)&lt;BR /&gt;
	&amp;nbsp;(83.0000000000000,0.000000000000000E+000)&lt;/STRONG&gt;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;323.000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;103.242640687119 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7.00000000000000&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;94.7573593128807 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;83.0000000000000&lt;BR /&gt;
	&amp;nbsp;Create DFTI descriptor&lt;BR /&gt;
	&amp;nbsp;Set out-of-place&lt;BR /&gt;
	&amp;nbsp;Set CCE storage&lt;BR /&gt;
	&amp;nbsp;Commit DFTI descriptor&lt;BR /&gt;
	&amp;nbsp;Compute backward transform&lt;BR /&gt;
	&amp;nbsp;Verify the result&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;102.000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;55.0000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;89.0000000000000&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;12.0000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3.00000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;45.0000000000000&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;9.00000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8.00000000000000&lt;BR /&gt;
	&amp;nbsp;Release the DFTI descriptor&lt;BR /&gt;
	&amp;nbsp;Release the DFTI_I descriptor&lt;BR /&gt;
	&amp;nbsp;Deallocate data arrays&lt;BR /&gt;
	&amp;nbsp;TEST PASSED&lt;/P&gt;

&lt;P&gt;If you set&amp;nbsp;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;DFTI_CONJUGATE_EVEN_STORAGE = DFTI_COMPLEX_real, &amp;nbsp;and &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;DFTI_PACKED_FORMAT = DFTI_CCS_FORMAT&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Then the x_in should be N+2. or &amp;nbsp;(&lt;/SPAN&gt;equivalence&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;&amp;nbsp;a complex array with z(1) and z(N/2+1) being real, same above blod ) &amp;nbsp; and output is x_real(N).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Best Regards,&lt;/P&gt;

&lt;P&gt;Ying&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jun 2015 03:00:27 GMT</pubDate>
    <dc:creator>Ying_H_Intel</dc:creator>
    <dc:date>2015-06-24T03:00:27Z</dc:date>
    <item>
      <title>Complex to real IFFT using MKL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Complex-to-real-IFFT-using-MKL/m-p/1044469#M20896</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;

&lt;P&gt;I need to perform an IDFT of some complex data to real in FORTRAN. I have read online a lot of how to do that with MKL but it confused me more. So I need to ask some questions on the configurations I need to make to so some a transformation.&lt;/P&gt;

&lt;P&gt;My complex data come from a simulation of N^3 grid, where N=512. They are all inside a complex array Z and are conjugate symmetric in the sense that each line corresponds to a vector k of coordinates (i,j,l) in such a way that N*N*i+N*j+l is the line number. The very first element of the array is real, I think is the mean value of the field (DC), and Z(N/2) element is again real. After that Z(N/2+l) = conjg(Z(N/2-l)).&amp;nbsp; So in general I have the same packing for all dimensions:&amp;nbsp; Z(N*N*(N/2+i)+N*(N/2+j)+N/2+l) = conjg(Z(N*N*(N/2-i)+N*(N/2-j)+N/2-l)).&lt;/P&gt;

&lt;P&gt;My first question is do I need to perform a 3D or a 1D FFT? Can I specify the structure of my complex input array with a stride so MKL will know where are the other dimensions? If I have understood well how to make the strides I need to do something like this:&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;stat = DftiCreateDescriptor( desc_handle, DFTI_DOUBLE, DFTI_REAL, 1,)&lt;BR /&gt;
	&amp;nbsp;stat = DftiSetValue(desc_handle, DFTI_CONJUGATE_EVEN_STORAGE, DFTI_COMPLEX_COMPLEX)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;stat = DftiSetValue(desc_handle, DFTI_INPUT_STRIDES,(/0,1,N,N**2/))&lt;/P&gt;

&lt;P&gt;&amp;nbsp;Then I need to perform the backward transformation but I do not know in what format should my input complex array should be. In the examples of intel it shows that the default storage scheme is the CCE, where I need to save half of them for each dimension. But then I saw that there is also a CCS storage scheme. In which of the two schemes must my input array be?&lt;/P&gt;

&lt;P&gt;Due to the conjugate symmetry mathematically my output array is expected to be a complex fortran array with zero imaginary part. I have tried a test code out but I dont get that. My code runs perfect but the results are not those expected. What have I've done wrong? Thanks in advance for your help and time.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;

&lt;P&gt;Dionisis&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2015 14:49:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Complex-to-real-IFFT-using-MKL/m-p/1044469#M20896</guid>
      <dc:creator>karagiannis__dionysi</dc:creator>
      <dc:date>2015-06-18T14:49:29Z</dc:date>
    </item>
    <item>
      <title>Hi Dionisis, </title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Complex-to-real-IFFT-using-MKL/m-p/1044470#M20897</link>
      <description>&lt;P&gt;Hi Dionisis,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Just quick comment,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Regarding 3D or 1D FFT, it may depend on what you need to do. &amp;nbsp;3D FFT doesn't equail of several 1D FFTs.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Regarding the IFFT, MKL provide some fortran code. You may build them and see if it can help.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;MKLexample\dftf\source\&lt;/SPAN&gt;basic_dp_real_dft_3d.f90. &amp;nbsp;It include real to complex, complex to real IFFT.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Best Regards,&lt;/P&gt;

&lt;P&gt;Ying&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	&amp;nbsp; print *,"Example basic_dp_real_dft_3d"&lt;BR /&gt;
	&amp;nbsp; print *,"Forward-Backward double-precision real out-of-place 3D FFT"&lt;BR /&gt;
	&amp;nbsp; print *,"Configuration parameters:"&lt;BR /&gt;
	&amp;nbsp; print *,"DFTI_PRECISION &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= DFTI_DOUBLE"&lt;BR /&gt;
	&amp;nbsp; print *,"DFTI_FORWARD_DOMAIN &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = DFTI_REAL"&lt;BR /&gt;
	&amp;nbsp; print *,"DFTI_DIMENSION &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= 3"&lt;BR /&gt;
	&amp;nbsp; print '(" DFTI_LENGTHS &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= /"I0","I0","I0"/" )', N1, N2, N3&lt;BR /&gt;
	&amp;nbsp; print *,"DFTI_PLCEMENT &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = DFTI_NOT_INPLACE"&lt;BR /&gt;
	&amp;nbsp; print *,"DFTI_CONJUGATE_EVEN_STORAGE = DFTI_COMPLEX_COMPLEX"&lt;/P&gt;

&lt;P&gt;&amp;nbsp; print *,"Create DFTI descriptor for real transform"&lt;BR /&gt;
	&amp;nbsp; status = DftiCreateDescriptor(hand, DFTI_DOUBLE, DFTI_REAL, 3, [N1,N2,N3])&lt;BR /&gt;
	&amp;nbsp; if (0 /= status) goto 999&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	&amp;nbsp; print *,"Set out-of-place"&lt;BR /&gt;
	&amp;nbsp; status = DftiSetValue(hand, DFTI_PLACEMENT, DFTI_NOT_INPLACE)&lt;BR /&gt;
	&amp;nbsp; if (0 /= status) goto 999&lt;/P&gt;

&lt;P&gt;&amp;nbsp; print *,"Set CCE storage"&lt;BR /&gt;
	&amp;nbsp; status = DftiSetValue(hand, DFTI_CONJUGATE_EVEN_STORAGE, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;amp;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DFTI_COMPLEX_COMPLEX)&lt;BR /&gt;
	&amp;nbsp; if (0 /= status) goto 999&lt;/P&gt;

&lt;P&gt;&amp;nbsp; cstrides = [0, 1, N1/2+1, N2*(N1/2+1)]&lt;BR /&gt;
	&amp;nbsp; rstrides = [0, 1, N1, &amp;nbsp; &amp;nbsp; N2*N1]&lt;/P&gt;

&lt;P&gt;&amp;nbsp; print '(" Set input &amp;nbsp;strides = "4(I0:", "))', rstrides&lt;BR /&gt;
	&amp;nbsp; status = DftiSetValue(hand, DFTI_INPUT_STRIDES, rstrides)&lt;BR /&gt;
	&amp;nbsp; if (0 /= status) goto 999&lt;/P&gt;

&lt;P&gt;&amp;nbsp; print '(" Set output strides = "4(I0:", "))', cstrides&lt;BR /&gt;
	&amp;nbsp; status = DftiSetValue(hand, DFTI_OUTPUT_STRIDES, cstrides)&lt;BR /&gt;
	&amp;nbsp; if (0 /= status) goto 999&lt;/P&gt;

&lt;P&gt;&amp;nbsp; print *,"Commit DFTI descriptor"&lt;BR /&gt;
	&amp;nbsp; status = DftiCommitDescriptor(hand)&lt;BR /&gt;
	&amp;nbsp; if (0 /= status) goto 999&lt;/P&gt;

&lt;P&gt;&amp;nbsp; print *,"Allocate data arrays"&lt;BR /&gt;
	&amp;nbsp; allocate(x_real(N1, N2, N3))&lt;BR /&gt;
	&amp;nbsp; allocate(x_cmplx(N1/2+1, N2, N3))&lt;/P&gt;

&lt;P&gt;&amp;nbsp; print *,"Initialize data for real-to-complex FFT"&lt;BR /&gt;
	&amp;nbsp; call init_r(x_real, N1, N2, N3, H1, H2, H3)&lt;/P&gt;

&lt;P&gt;&amp;nbsp; print *,"Compute forward transform"&lt;BR /&gt;
	&amp;nbsp; status = DftiComputeForward(hand, x_real(:, 1, 1), x_cmplx(:, 1, 1))&lt;BR /&gt;
	&amp;nbsp; if (0 /= status) goto 999&lt;/P&gt;

&lt;P&gt;&amp;nbsp; print *,"Verify the result"&lt;BR /&gt;
	&amp;nbsp; status = verify_c(x_cmplx, N1, N2, N3, H1, H2, H3)&lt;BR /&gt;
	&amp;nbsp; if (0 /= status) goto 999&lt;/P&gt;

&lt;P&gt;&amp;nbsp; print *,"Reconfigure DFTI descriptor for backward transform"&lt;/P&gt;

&lt;P&gt;&amp;nbsp; print '(" Set input &amp;nbsp;strides = "4(I0:", "))', cstrides&lt;BR /&gt;
	&amp;nbsp; status = DftiSetValue(hand, DFTI_INPUT_STRIDES, cstrides)&lt;BR /&gt;
	&amp;nbsp; if (0 /= status) goto 999&lt;/P&gt;

&lt;P&gt;&amp;nbsp; print '(" Set output strides = "4(I0:", "))', rstrides&lt;BR /&gt;
	&amp;nbsp; status = DftiSetValue(hand, DFTI_OUTPUT_STRIDES, rstrides)&lt;BR /&gt;
	&amp;nbsp; if (0 /= status) goto 999&lt;/P&gt;

&lt;P&gt;&amp;nbsp; print *,"Recommit DFTI descriptor"&lt;BR /&gt;
	&amp;nbsp; status = DftiCommitDescriptor(hand)&lt;BR /&gt;
	&amp;nbsp; if (0 /= status) goto 999&lt;/P&gt;

&lt;P&gt;&amp;nbsp; print *,"Initialize data for complex-to-real FFT"&lt;BR /&gt;
	&amp;nbsp; call init_c(x_cmplx, N1, N2, N3, H1, H2, H3)&lt;/P&gt;

&lt;P&gt;&amp;nbsp; print *,"Compute backward transform"&lt;BR /&gt;
	&amp;nbsp; status = DftiComputeBackward(hand, x_cmplx(:, 1, 1), x_real(:, 1, 1))&lt;BR /&gt;
	&amp;nbsp; if (0 /= status) goto 999&lt;/P&gt;

&lt;P&gt;&amp;nbsp; print *,"Verify the result"&lt;BR /&gt;
	&amp;nbsp; status = verify_r(x_real, N1, N2, N3, H1, H2, H3)&lt;BR /&gt;
	&amp;nbsp; if (0 /= status) goto 999&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jun 2015 08:55:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Complex-to-real-IFFT-using-MKL/m-p/1044470#M20897</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2015-06-19T08:55:05Z</dc:date>
    </item>
    <item>
      <title>Hi Ying,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Complex-to-real-IFFT-using-MKL/m-p/1044471#M20898</link>
      <description>&lt;P&gt;Hi Ying,&lt;/P&gt;

&lt;P&gt;Thank you for your answer and help. I need to do a 3D transformation since the complex coefficients correspond to a 3D Fourier space vector.&lt;/P&gt;

&lt;P&gt;I have seen these examples but they haven't helped much. What I want to know is if I keep the CCE storage format which is the defaults for the DFTI_CONJUGATE_EVEN_STORAGE= DFTI_COMPLEX_COMPLEX how should my input complex data look like?&lt;/P&gt;

&lt;P&gt;My original data are a 1D fortran array which follow this:&lt;/P&gt;

&lt;P&gt;Suppose you have 3D array A of size NxNxN, where​:&lt;/P&gt;

&lt;UL&gt;
	&lt;LI&gt;1st dimension has size N and has stride 1&lt;/LI&gt;
	&lt;LI&gt;2nd dimension has size N and has stride N&lt;/LI&gt;
	&lt;LI&gt;3rd dimension has size N and has stride N*N&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;So element A&lt;K&gt;&lt;J&gt;&lt;I&gt; should be accessed as A[k*N*N + j*N + i].&lt;/I&gt;&lt;/J&gt;&lt;/K&gt;&lt;/P&gt;

&lt;P&gt;So the stride should be: cstride=(/0,1,N,N*N/) right or do I need to put only N/2+1 elements for each dimension since my data have a conjugate symmetry for every dimension. Then how should the stride and the input data should look like so the MKL FFT routines can read and use this symmetry properly and give the real results I need?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Kind Regards,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Dionisis&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jun 2015 11:22:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Complex-to-real-IFFT-using-MKL/m-p/1044471#M20898</guid>
      <dc:creator>karagiannis__dionysi</dc:creator>
      <dc:date>2015-06-19T11:22:56Z</dc:date>
    </item>
    <item>
      <title>Hi again,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Complex-to-real-IFFT-using-MKL/m-p/1044472#M20899</link>
      <description>&lt;P&gt;Hi again,&lt;/P&gt;

&lt;P&gt;I order to simplify my problem I am just testing a 1D IFFT. The input is a complex array with z(1) and z(N/2+1) being real. The total size of the array is N=256. If I prepare the IFFT like the following:&lt;/P&gt;

&lt;P&gt;&amp;nbsp;stat = DftiCreateDescriptor( desc_handle, DFTI_DOUBLE, DFTI_REAL, 1,256)&lt;BR /&gt;
	&amp;nbsp;stat = DftiSetValue(desc_handle, DFTI_CONJUGATE_EVEN_STORAGE, DFTI_COMPLEX_COMPLEX)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;stat = DftiSetValue(desc_handle, DFTI_PLACEMENT, DFTI_NOT_INPLACE)&lt;/P&gt;

&lt;P&gt;stat = DftiComputeBackward(desc_handle, X_in, M_out)&lt;/P&gt;

&lt;P&gt;,where X_in has the conjugate symmetry even described above. That means that M_out is expected to be a real array in the sense that if:&lt;/P&gt;

&lt;P&gt;real(dp) :: M_out(N+2)&lt;/P&gt;

&lt;P&gt;then the expected real fortran array with have every other element equal to zero.&lt;/P&gt;

&lt;P&gt;complex(dp) :: M_out(N/2)&lt;/P&gt;

&lt;P&gt;then the expected complex fortran array will have N/2 size with the imaginary part being zero.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;However the results I get are not real after doing the above. It is like the routines do not understand that the input complex fortran array does not have the conjugate even symmetry. Why is that? Do I have to add any other preference parameters to ensure the structure of the input is read correctly?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Dionisis&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jun 2015 16:37:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Complex-to-real-IFFT-using-MKL/m-p/1044472#M20899</guid>
      <dc:creator>karagiannis__dionysi</dc:creator>
      <dc:date>2015-06-19T16:37:31Z</dc:date>
    </item>
    <item>
      <title>Hi Dionisis, </title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Complex-to-real-IFFT-using-MKL/m-p/1044473#M20900</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Dionisis,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;You may refer to the sample, &amp;nbsp;&lt;/SPAN&gt;basic_dp_real_dft_1d.f90. &amp;nbsp;It is exactly sample for&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;&amp;nbsp;DFTI_CONJUGATE_EVEN_STORAGE, DFTI_COMPLEX_COMPLEX &amp;nbsp;and input for &amp;nbsp;IDFT is&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;x_cmplx(N/2+1)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;print *,"Example basic_dp_real_dft_1d"&lt;BR /&gt;
	&amp;nbsp; print *,"Forward-Backward double-precision real-to-complex", &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;amp;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; " out-of-place 1D transform"&lt;BR /&gt;
	&amp;nbsp; print *,"Configuration parameters:"&lt;BR /&gt;
	&amp;nbsp; print *,"DFTI_PRECISION &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= DFTI_DOUBLE"&lt;BR /&gt;
	&amp;nbsp; print *,"DFTI_FORWARD_DOMAIN &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = DFTI_REAL"&lt;BR /&gt;
	&amp;nbsp; print *,"DFTI_DIMENSION &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= 1"&lt;BR /&gt;
	&amp;nbsp; print '(" DFTI_LENGTHS &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= /"I0"/" )', N&lt;BR /&gt;
	&amp;nbsp; print *,"DFTI_PLACEMENT &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= &amp;nbsp;DFTI_NOT_INPLACE"&lt;BR /&gt;
	&amp;nbsp; print *,"DFTI_CONJUGATE_EVEN_STORAGE = DFTI_COMPLEX_COMPLEX"&lt;/P&gt;

&lt;P&gt;&amp;nbsp;allocate(x_real(N))&lt;BR /&gt;
	&amp;nbsp; allocate(x_cmplx(N/2+1))&lt;/P&gt;

&lt;P&gt;If you don't need the Forward part, &amp;nbsp;you can delete them. &amp;nbsp;i modify the sample and attach here.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Not sure , how your&amp;nbsp;input look likes &amp;nbsp;(is a complex array with &lt;STRONG&gt;z(1) and z(N/2+1) being real ?&amp;nbsp;&lt;/STRONG&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;where X_in has the conjugate symmetry even described above)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;If you setDFTI_CONJUGATE_EVEN_STORAGE = DFTI_COMPLEX_COMPLEX. &amp;nbsp;Then &amp;nbsp;&lt;STRONG&gt;your X_in should be &amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;&lt;STRONG&gt;&amp;nbsp; (x_cmplx(N/2+1))&lt;/STRONG&gt; here. &amp;nbsp;and I mark it as bold. &amp;nbsp;They are half of the FFT 's result.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;Initialize data for real-to-complex FFT&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;102.000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;55.0000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;89.0000000000000&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;12.0000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3.00000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;45.0000000000000&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;9.00000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8.00000000000000&lt;BR /&gt;
	&amp;nbsp;Compute forward transform&lt;BR /&gt;
	&amp;nbsp;Verify the result&lt;BR /&gt;
	&amp;nbsp;&lt;STRONG&gt;(323.000000000000,0.000000000000000E+000) (103.242640687119,-89.8994949366&lt;BR /&gt;
	&amp;nbsp;(7.00000000000000,-80.0000000000000) (94.7573593128807,70.1005050633883)&lt;BR /&gt;
	&amp;nbsp;(83.0000000000000,0.000000000000000E+000)&lt;/STRONG&gt;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;323.000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;103.242640687119 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;7.00000000000000&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;94.7573593128807 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;83.0000000000000&lt;BR /&gt;
	&amp;nbsp;Create DFTI descriptor&lt;BR /&gt;
	&amp;nbsp;Set out-of-place&lt;BR /&gt;
	&amp;nbsp;Set CCE storage&lt;BR /&gt;
	&amp;nbsp;Commit DFTI descriptor&lt;BR /&gt;
	&amp;nbsp;Compute backward transform&lt;BR /&gt;
	&amp;nbsp;Verify the result&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;102.000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;55.0000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;89.0000000000000&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;12.0000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3.00000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;45.0000000000000&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;9.00000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8.00000000000000&lt;BR /&gt;
	&amp;nbsp;Release the DFTI descriptor&lt;BR /&gt;
	&amp;nbsp;Release the DFTI_I descriptor&lt;BR /&gt;
	&amp;nbsp;Deallocate data arrays&lt;BR /&gt;
	&amp;nbsp;TEST PASSED&lt;/P&gt;

&lt;P&gt;If you set&amp;nbsp;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;DFTI_CONJUGATE_EVEN_STORAGE = DFTI_COMPLEX_real, &amp;nbsp;and &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;DFTI_PACKED_FORMAT = DFTI_CCS_FORMAT&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Then the x_in should be N+2. or &amp;nbsp;(&lt;/SPAN&gt;equivalence&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;&amp;nbsp;a complex array with z(1) and z(N/2+1) being real, same above blod ) &amp;nbsp; and output is x_real(N).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Best Regards,&lt;/P&gt;

&lt;P&gt;Ying&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2015 03:00:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Complex-to-real-IFFT-using-MKL/m-p/1044473#M20900</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2015-06-24T03:00:27Z</dc:date>
    </item>
    <item>
      <title>Attach the fortran code file.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Complex-to-real-IFFT-using-MKL/m-p/1044474#M20901</link>
      <description>&lt;P&gt;Attach the fortran code file.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;The packed format like CCS, park, perm are described &amp;nbsp;in MKl reference manual: &amp;nbsp;https://software.intel.com/zh-cn/node/521971 =&amp;gt;DFTI_PACKED_FORMAT .&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;

&lt;P&gt;Ying&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2015 03:04:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Complex-to-real-IFFT-using-MKL/m-p/1044474#M20901</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2015-06-24T03:04:00Z</dc:date>
    </item>
    <item>
      <title>Hi Ying,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Complex-to-real-IFFT-using-MKL/m-p/1044475#M20902</link>
      <description>&lt;P&gt;Hi Ying,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks for your help it did the trick. If I want to perform a 3D IFFT then I have to put half of them again right? So my X_in will be X_in((N/2+1)*N*N) correct?&lt;/P&gt;

&lt;P&gt;Thanks again for your time and help.&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;

&lt;P&gt;Dionisis&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2015 14:44:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Complex-to-real-IFFT-using-MKL/m-p/1044475#M20902</guid>
      <dc:creator>karagiannis__dionysi</dc:creator>
      <dc:date>2015-06-24T14:44:51Z</dc:date>
    </item>
    <item>
      <title>Hi Dionisis, </title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Complex-to-real-IFFT-using-MKL/m-p/1044476#M20903</link>
      <description>&lt;P&gt;Hi Dionisis,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Right, if 3D IFFT, you have to put half of them and your X_in for IDFT will be X_in((N/2+1)*N*N).&amp;nbsp;&lt;/P&gt;

&lt;P&gt;the sample basic_dp_real_dft_3d.f90 code under &amp;lt;MKL install directory&amp;gt;/sample/mkl_core.zip=&amp;gt; unzip, &amp;nbsp;\dftf\source.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Best Regards,&lt;/P&gt;

&lt;P&gt;Ying&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;print *,"Create DFTI descriptor for real transform"&lt;BR /&gt;
	&amp;nbsp; status = DftiCreateDescriptor(hand, DFTI_DOUBLE, DFTI_REAL, 3, [N1,N2,N3])&lt;BR /&gt;
	&amp;nbsp; if (0 /= status) goto 999&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	&amp;nbsp; print *,"Set out-of-place"&lt;BR /&gt;
	&amp;nbsp; status = DftiSetValue(hand, DFTI_PLACEMENT, DFTI_NOT_INPLACE)&lt;BR /&gt;
	&amp;nbsp; if (0 /= status) goto 999&lt;/P&gt;

&lt;P&gt;&amp;nbsp; print *,"Set CCE storage"&lt;BR /&gt;
	&amp;nbsp; status = DftiSetValue(hand, DFTI_CONJUGATE_EVEN_STORAGE, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;amp;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DFTI_COMPLEX_COMPLEX)&lt;BR /&gt;
	&amp;nbsp; if (0 /= status) goto 999&lt;/P&gt;

&lt;P&gt;&amp;nbsp; cstrides = [0, 1, N1/2+1, N2*(N1/2+1)]&lt;BR /&gt;
	&amp;nbsp; rstrides = [0, 1, N1, &amp;nbsp; &amp;nbsp; N2*N1]&lt;/P&gt;

&lt;P&gt;&amp;nbsp; print '(" Set input &amp;nbsp;strides = "4(I0:", "))', rstrides&lt;BR /&gt;
	&amp;nbsp; status = DftiSetValue(hand, DFTI_INPUT_STRIDES, rstrides)&lt;BR /&gt;
	&amp;nbsp; if (0 /= status) goto 999&lt;/P&gt;

&lt;P&gt;&amp;nbsp; print '(" Set output strides = "4(I0:", "))', cstrides&lt;BR /&gt;
	&amp;nbsp; status = DftiSetValue(hand, DFTI_OUTPUT_STRIDES, cstrides)&lt;BR /&gt;
	&amp;nbsp; if (0 /= status) goto 999&lt;/P&gt;

&lt;P&gt;&amp;nbsp; print *,"Commit DFTI descriptor"&lt;BR /&gt;
	&amp;nbsp; status = DftiCommitDescriptor(hand)&lt;BR /&gt;
	&amp;nbsp; if (0 /= status) goto 999&lt;/P&gt;

&lt;P&gt;&amp;nbsp; print *,"Allocate data arrays"&lt;BR /&gt;
	&amp;nbsp; allocate(x_real(N1, N2, N3))&lt;BR /&gt;
	&amp;nbsp; allocate(x_cmplx(N1/2+1, N2, N3))&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2015 03:26:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Complex-to-real-IFFT-using-MKL/m-p/1044476#M20903</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2015-06-25T03:26:04Z</dc:date>
    </item>
  </channel>
</rss>

