title: Discrepancy Between Matlab and Numpy+Python FFT2?
body: <p>So I was doing some homework on diffraction in Python with Numpy. My results simply wouldn't turn out how they should have, and I was confused. </p>
  
  <p>The code I used to generate the FFTs is as follows:</p>
  
  <pre><code>Python:
  aperaturearray = np.array(im) # Turn image into numpy array
  Ta = np.fft.fftshift(np.fft.fft2(aperaturearray))
  ### I did some calculations here ###
  ftfm = Image.fromarray(np.uint8(Utfm)) 
  ftfm.save(("Path"))  
  
  Matlab:
  rect = imread('PATH\pyRectangle.jpg');
  rectfft = fft2(rect);
  imwrite(rectfft, 'C:\Users\Dan\Documents\python\DiffPhotos\matlabRectfft','jpg')
  pyrectmat = ifft2(pyfftrect);
  imwrite(pyrectmat, 'Path','jpg')
  </code></pre>
  
  <p>The images are here ->  <a href="http://imgur.com/a/3Cw81#EdFoA" rel="nofollow">http://imgur.com/a/3Cw81#EdFoA</a></p>
  
  <p>Now what's going on here? Why are the FFT images so different? Different implementations? Why doesn't my homework code work :(</p>