Numeric:FFT inverse_real_fft doesn't trevni!

mhuster at hotmail.com mhuster at hotmail.com
Thu May 13 15:28:18 EDT 1999


The FFT module with the LLNL Numeric stuff does not seem to perform an
inverse on the result of real_fft. (At least not in an intuitive
manner.) An N point real_fft returns N/2 +1 complex numbers. From
experience, not documentation, I guess that element 0 is real and the DC
component, and element N/2 is real and the Nyquist value.

But, trying inverse_real_fft does not seem to give the number of values
or the values I expect. I thought that calling inverse_real_fft on the
same array as real_fft produced would give back the original array,
possibly scaled by N. Not so. I pasted in a sample of a session.

Por favor, how can I invert the real_fft call?

% python
Python 1.5.1 (#1, Sep  3 1998, 22:51:17)  [GCC 2.7.2.3] on linux-i386
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> from Numeric import *
>>> import FFT
>>> a = arange(8)
>>> fra = FFT.real_fft(a)
>>> fra
array([ 28.        +0.j,  -9.65685425+4.j,  -4.        -4.j,
              1.65685425-4.j,   4.        +0.j])
>>> fra = FFT.real_fft(a,8)
>>> fra
array([ 28.        +0.j,  -9.65685425+4.j,  -4.        -4.j,
              1.65685425-4.j,   4.        +0.j])
>>> aa = FFT.inverse_real_fft(fra)
>>> aa
array([-1.93137085+0.j        , -4.35053004-0.53206627j,
             0.24703333-3.08992042j])
>>> aa = FFT.inverse_real_fft(fra,8)
>>> aa
array([-1.20710678+0.j        , -2.20710678-2.62132034j,
            -0.79289322+0.79289322j, -0.20710678-1.79289322j,
            -1.62132034+0.j        ])
>>>

undocumented-dementedly yours,
Michael Huster
mhuster at hotmail.com


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---




More information about the Python-list mailing list