[Numpy-discussion] numpy.fft, yet again

David Goldsmith d.l.goldsmith@gmail....
Mon Jul 12 16:43:03 CDT 2010


>From the docstring:

"A[0] contains the zero-frequency term (the mean of the signal)"

And yet, consistent w/ the definition given in the docstring (and included
w/ an earlier email), the code gives, e.g.:

>>> import numpy as np
>>> x = np.ones((16,)); x
array([ 1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,
        1.,  1.,  1.])
>>> y = np.fft.fft(x); y
array([ 16.+0.j,   0.+0.j,   0.+0.j,   0.+0.j,   0.+0.j,   0.+0.j,
         0.+0.j,   0.+0.j,   0.+0.j,   0.+0.j,   0.+0.j,   0.+0.j,
         0.+0.j,   0.+0.j,   0.+0.j,   0.+0.j])

i.e., the zero-th term is the sum, not the mean (which, again, is consistent
w/ the stated defining formula).

So, same ol', same ol': bug in the doc (presumably) or bug in the code?

DG
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20100712/280eb27a/attachment.html 


More information about the NumPy-Discussion mailing list