title: fftshift / ifftshift in terms of circshift
body: <p>and am trying to relate fftshift/ifftshift to circular shift. </p>
  
  <pre><code>N = 5 
  Y = 0:N-1
  
  X = [0 1 2 3 4] 
  </code></pre>
  
  <p>When I fftshift(X), I get </p>
  
  <pre><code>[3 4 0 1 2] 
  </code></pre>
  
  <p>When I ifftshift(X), I get</p>
  
  <pre><code>[2 3 4 0 1] 
  </code></pre>
  
  <p>How do I relate fftshift/ifftshift to circular shift? Is it simply moving the numbers in X about in different directions? </p>
  
  <p>I need to know this as I'm trying to implement these two functions in terms of circular shift in C++, which is a function I already have done. </p>
  
  <p>Many thanks. </p>