[SciPy-User] fft not giving Hermitian output for real input

Jeff Alstott jeffalstott@gmail....
Thu Feb 23 20:15:33 CST 2012


I have a particular data set, d0, which is real:

In [72]: d0
Out[72]:
array([ 0.00907105,  0.0372916 ,  0.01402867, ..., -0.04779497,
       -0.07054817, -0.0436582 ])

It doesn't produce Hermitian output from numpy.fft.fft.


   In [87]: y0 = fft.fft(d0)
   In [88]: y0
   Out[88]:
   array([  7.77156117e-14 +0.00000000e+00j,
            6.89226454e-13 -1.56319402e-13j,
            1.72140080e-13 +0.00000000e+00j, ...,
           -7.95807864e-13 -1.13686838e-13j,
           -3.41060513e-13 +1.13686838e-13j,   1.25055521e-12
   -3.41060513e-13j])
   In [89]: y0[1].conj()==y0[-1]
   Out[89]: False
   In [90]: y0[1].conj()==y0[-2]
   Out[90]: False
   Just to be double sure, I force d0 to be real. Same result.
   In [91]: y0 = fft.fft(real(d0))
   In [92]: y0
   Out[92]:
   array([  7.77156117e-14 +0.00000000e+00j,
            6.89226454e-13 -1.56319402e-13j,
            1.72140080e-13 +0.00000000e+00j, ...,
           -7.95807864e-13 -1.13686838e-13j,
           -3.41060513e-13 +1.13686838e-13j,   1.25055521e-12
   -3.41060513e-13j])

   In [93]: y0[1].conj()==y0[-1]
   Out[93]: False

   In [94]: y0[1].conj()==y0[-2]
   Out[94]: False

This behavior doesn't occur if I make a simple signal and fft it.

In [63]: x = arange(10000)

In [64]: z = sin(x)

In [65]: q = fft.fft(z)

In [66]: q
Out[66]:
array([ 1.93950541+0.j        ,  1.93950618+0.00020886j,
        1.93950848+0.00041772j, ...,  1.93951232-0.00062658j,
        1.93950848-0.00041772j,  1.93950618-0.00020886j])

   Thoughts?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20120223/d5e6eb01/attachment-0001.html 


More information about the SciPy-User mailing list