title: Bug in 2D Fourier Transform implementation
body: <p>I am trying to implement a 2D DFT using a combination of 1D DFT in Matlab. When comparing my results against Matlab's inbuilt function (fft2) I realized that I have the following issues:</p>
  
  <ol>
  <li>The sign of the imaginary part is being inverted. i.e + changed to - and vice versa.</li>
  <li>The rows are being ordered in descending order except for the first one.</li>
  </ol>
  
  <p>This image shows the comparison between the two results. The red numbers on the side are there to indicate the reordering issue.</p>
  
  <p><img src="https://i.stack.imgur.com/OovF8.png" alt=""></p>
  
  <p>My code is as follows:</p>
  
  <pre><code>x = imread('img.png');
  x = double(x);
  x = x(1:12,1:5)
  
  % FFT
  Xw = complex(zeros(size(x)));
  for row = 1:size(x,1)
      Xw(row,:) = fft(x(row,:));
  end
  
  for col = 1:size(x,2)
      Xw(:,col) = fft(Xw(:,col)');
  end
  </code></pre>
  
  <p>Could someone kindly indicate where my problem is please? Thanks</p>