title: Do I need to call fftshift before calling fft or ifft?
body: <p>In the book &quot;Computational Fourier Optics, A Matlab Tutorial&quot; by David Voelz, it is written that a call to <code>fftshift</code> is needed before a call to <code>fft</code> or <code>ifft</code>, but in the MATLAB documentation of <code>fftshift</code> it's only written that this command</p>
  <blockquote>
  <p>rearranges the outputs of <code>fft</code>, <code>fft2</code>, and <code>fftn</code> by moving the zero-frequency component to the center of the array.</p>
  </blockquote>
  <p>There is no mention in documentation that this command should be called before the call to <code>fft</code>, and I saw some examples that call <code>fft</code> without a call to <code>fftshift</code> beforehand.</p>
  <p>My question is: Whether or not <code>fftshift</code> needed to be called before a call to <code>fft</code> or <code>ifft</code>?</p>
  <p>If <code>fftshift</code> doesn't need to be called before a call to <code>fft</code>, and only after a call to <code>fft</code>, then when should we use (if at all) the command <code>ifftshift</code> with relation to a calculation of the <code>fft</code> of a data set?</p>