title: DFT of 2D double array using fftw3 r2c comparing to c2c
body: <p>I am trying to understand how to use the &quot;fftw_plan_dft_r2c_2d&quot;. First, I generate a matrix with a non symmetric gaussian (<code>sigma_x != sigma_y</code>) and I make the fft using <code>fftw_plan_dft_c2c_2D</code>. But it requires a temporary fftw_complexe array where I just copy the gaussian matrix and set the imaginary part to 0.0.</p>
  <p><a href="https://i.stack.imgur.com/YvVHB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YvVHB.png" alt="gaussian matrix" /></a> <a href="https://i.stack.imgur.com/1zBJl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1zBJl.png" alt="resulting c2c 2D fft " /></a></p>
  <p>In order to save some memory, I am trying to avoid the temporary fftw_complexe and use directly the &quot;fftw_plan_dft_r2c_2D&quot; expecting the same &quot;half&quot; result.
  <a href="https://i.stack.imgur.com/6wi4g.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6wi4g.png" alt="2D fft of gaussian using r2c" /></a></p>
  <p>It looks like I missing something.. can anyone help please ?</p>
  <p>thanks,</p>