[Numpy-discussion] numpy.fft, yet again

David Goldsmith d.l.goldsmith at gmail.com
Mon Jul 12 18:28:23 EDT 2010


On Mon, Jul 12, 2010 at 3:04 PM, Eric Firing <efiring at hawaii.edu> wrote:

> On 07/12/2010 11:43 AM, David Goldsmith wrote:
> >  >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?
>
> Bug in the doc.  Good catch.


Thanks.  (In case you hadn't noticed, I'm detail-oriented to a fault.) :-/

DG

> "mean" is correct for the ifft, not for
> the fft.
>

> Eric
>
> >
> > DG
> >
> >
> >
> > _______________________________________________
> > NumPy-Discussion mailing list
> > NumPy-Discussion at scipy.org
> > http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>



-- 
Mathematician: noun, someone who disavows certainty when their uncertainty
set is non-empty, even if that set has measure zero.

Hope: noun, that delusive spirit which escaped Pandora's jar and, with her
lies, prevents mankind from committing a general suicide.  (As interpreted
by Robert Graves)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20100712/eaae98e6/attachment.html>


More information about the NumPy-Discussion mailing list