[NumPy-Tickets] [NumPy] #1077: fftshift incompatible with fft for even n

NumPy Trac numpy-tickets@scipy....
Mon Jul 26 09:27:13 CDT 2010


#1077: fftshift incompatible with fft for even n
------------------------+---------------------------------------------------
  Reporter:  alk        |       Owner:  somebody
      Type:  defect     |      Status:  closed  
  Priority:  normal     |   Milestone:  1.4.1   
 Component:  numpy.fft  |     Version:  1.0.4   
Resolution:  invalid    |    Keywords:          
------------------------+---------------------------------------------------
Changes (by rgommers):

  * status:  new => closed
  * resolution:  => invalid


Comment:

 If n is even, there is one more negative than positive value. This is a
 choice, and consistently done in numpy as far as I'm aware.
 {{{
 In [27]: np.fft.fftshift(np.array([0,1,2,3,-4,-3,-2,-1]))
 Out[27]: array([-4, -3, -2, -1,  0,  1,  2,  3])
 }}}
 From docstring:
 {{{
     >>> freqs = np.fft.fftfreq(10, 0.1)
     >>> freqs
     array([ 0.,  1.,  2.,  3.,  4., -5., -4., -3., -2., -1.])
     >>> np.fft.fftshift(freqs)
     array([-5., -4., -3., -2., -1.,  0.,  1.,  2.,  3.,  4.])
 }}}

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1077#comment:3>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list