[MATRIX-SIG] real_fft

David Buscher David.Buscher@durham.ac.uk
Thu, 12 Mar 1998 20:19:37 +0000 (GMT)


There appears to be an off-by-one error in the real_fft() function in the
FFT module.  The following is the output from a python session, with spacing
inserted for clarity:

Python 1.5 (#1, Mar 10 1998, 16:43:31)  [GCC 2.7.2] on sunos5
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> from Numeric import *
>>> from FFT import *

>>> fft([1,0,0,0])
array([ 1.+0.j,  1.+0.j,  1.+0.j,  1.+0.j])

>>> real_fft([1,0,0,0])
array([ 0.+0.j,  0.+0.j,  0.+0.j])

>>> real_fft([1,1,0,0])
array([ 1.+0.j,  1.+0.j,  1.+0.j])

>>> real_fft([0,1,0,0])
array([ 1.+0.j,  1.+0.j,  1.+0.j])

The first expression is just to check that the fft() function works as
expected. Note that the last two expressions show that the real_fft()
function is ignoring the first element of the array. Does anyone else see
this happening, or is it just a function of my installation? Or do I not
understand what the real_fft() function is supposed to do? I am using
python-1.5 with Konrad Hinsen's numpy.tar.gz. 

David
----------------------------------------+-------------------------------------
 David Buscher                          |  Phone  +44 191 374 7462
 Dept of Physics, University of Durham, |  Fax    +44 191 374 3709
 South Road, Durham DH1 3LE, UK         |  Email  david.buscher@durham.ac.uk
----------------------------------------+-------------------------------------


_______________
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________