Numeric:FFT inverse_real_fft doesn't trevni!

Christian Tismer tismer at appliedbiometrics.com
Tue May 18 13:47:12 EDT 1999


Michael Huster wrote:
...
> >Providing an inverse function
> >would be useless, since after any modifications of your
> >complex result, you will usually not expect a real result.
> Not, true. Since the returned coeficients are only the positive frequencies,
> I should be able to do operations such as bandpass, correlate, etc just on
> these coefficients then call a *proper* inverse_real_fft and get back a
> purely real timeseries.

Yes, sure. Sorry that I forgot about these, after I used
FFT for many years (but also many years ago).

> This is the way we have implemented it in C using FFTPACK. FFTPACK has such
> a routine which will take the results of real_fft, and invert them. The
> wrapped FFTPACK routine in the FFT module just is not the one I've used in
> the past.

Well, can you provide the call which you use now?
I think this is useful for others.

As a remark, the Hartley transform can be used for exactly the
operations which you mentioned above, with the same efficiency 
as real fft, but in a more symmetric manner. No need to have
inverse versions at all to mimick the symmetry which exists
in the complex transform only.

While the DFT is based upon terms like

F(v) = (1/N) sum over f(t) exp(-J 2pi v t /N)
  and
f(t) = sum over F(v) exp(2 pi v t /N)

the discrete Hartley transform (DHT) uses the cas function:

H(v) = (1/N) sum over f(t) cas(2 pi v t /N)
  and
f(v) = sum over H(v) cas(2 pi v t /N)

where cas is defined as cas(phi) = cos(phi)+sin(phi)

DHT can be implemented directly or in terms of DFT.
Many properties match each others, and you always
just deal with real numbers and minimzed brain convolution.

For further reading, see 
Ronald N. Bracewell, "The Hartley Transform",
Oxford Press 1986.

Maybe I try to add that to FFT.py in some future.

ciao - chris

-- 
Christian Tismer             :^)   <mailto:tismer at appliedbiometrics.com>
Applied Biometrics GmbH      :     Have a break! Take a ride on Python's
Kaiserin-Augusta-Allee 101   :    *Starship* http://starship.python.net
10553 Berlin                 :     PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
     we're tired of banana software - shipped green, ripens at home




More information about the Python-list mailing list