[Numpy-discussion] What does fftn take as parameters?

Roger Binns rogerb at rogerbinns.com
Mon Dec 5 16:28:06 EST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

(Note I'm a programmer type, not a math type and am doing coding directed
by a matlab user.)

I'm trying to do an fft on multiple columns of data at once (ultimately
feeding into a correlation calculation).  I can use fft() to work on one
column:

  data=[23, 43, 53, 54, 0, 10]
  powtwo=8 # nearest power of two size
  numpy.fft.fft(data, powtwo)

I want to do that but using fftn (the matlab user said it is the right
function) but I can't work out from the docs or experimentation how the
input data should be formatted.  eg is it row major or column major.  For
example the above could be:

  data=[ [23, 43, 53, 54, 0, 10] ]

     or

  data=[ [23], [43], [53], [54], [0], [10] ]

All the examples in the docs use square inputs (ie x and y axes are the
same length) so that doesn't help.  The documentation shows examples of
the output, but not the input.  I found code passing in a single int (not
a list of int) as the s parameter, but that also gives me an error.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk7dN2YACgkQmOOfHg372QQ4YQCg4sKmtx8UAoEOuosWzUofw/KZ
B5AAoKeHzP8HgpvDrXDANj0wqll5L9MO
=iRAX
-----END PGP SIGNATURE-----



More information about the NumPy-Discussion mailing list