472,337 Members | 1,536 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,337 software developers and data experts.

Computing FFT with Python NumPy 1.0

I recently installed Python 2.5 on Windows and also installed numpy
1.0. I'd like to compute an FFT on an array of numbers but I can't
seem to access the FFT function. I'm fairly new to Python (obviously)
and I can't seem to find documentation to match my distribution of
numpy and I can't figure out how to access the FFT function.

Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit
(Intel)] on win32
Type "copyright", "credits" or "license()" for more information.

IDLE 1.2
>>from numpy import *
a=array((1,2,3,2,1,2,3,2,1))
fft(a)
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
fft(a)
TypeError: 'module' object is not callable
>>>
Help appreciated thanks.

Nov 1 '06 #1
2 22223
On 1 Nov 2006 16:04:59 -0800, mc****@gmail.com <mc****@gmail.comwrote:
I recently installed Python 2.5 on Windows and also installed numpy
1.0. I'd like to compute an FFT on an array of numbers but I can't
seem to access the FFT function. I'm fairly new to Python (obviously)
and I can't seem to find documentation to match my distribution of
numpy and I can't figure out how to access the FFT function.

Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit
(Intel)] on win32
Type "copyright", "credits" or "license()" for more information.

IDLE 1.2
>from numpy import *
a=array((1,2,3,2,1,2,3,2,1))
fft(a)

Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
fft(a)
TypeError: 'module' object is not callable
>>

Help appreciated thanks.
The fft routines now live in numpy.fft.
>>from numpy.fft import fft
from numpy import array
a=array((1,2,3,2,1,2,3,2,1))
fft(a)
array([ 17. +0.j , -1.15270364-0.41954982j,
-3.37938524-2.83564091j, 0.5 +0.8660254j ,
0.03208889+0.18198512j, 0.03208889-0.18198512j,
0.5 -0.8660254j , -3.37938524+2.83564091j,
-1.15270364+0.41954982j])

>
--
http://mail.python.org/mailman/listinfo/python-list
Nov 1 '06 #2
mc****@gmail.com wrote:
I recently installed Python 2.5 on Windows and also installed numpy
1.0.
You will want to ask numpy questions on the numpy mailing list.

http://www.scipy.org/Mailing_Lists
I'd like to compute an FFT on an array of numbers but I can't
seem to access the FFT function. I'm fairly new to Python (obviously)
and I can't seem to find documentation to match my distribution of
numpy and I can't figure out how to access the FFT function.

Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit
(Intel)] on win32
Type "copyright", "credits" or "license()" for more information.

IDLE 1.2
>>>from numpy import *
a=array((1,2,3,2,1,2,3,2,1))
fft(a)

Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
fft(a)
TypeError: 'module' object is not callable
All of the fft functions are in the numpy.fft module.
>>from numpy import *
a=array((1,2,3,2,1,2,3,2,1))
fft.fft(a)
array([ 1.70000000e+01+0.j , -1.15270364e+00-0.41954982j,
-3.37938524e+00-2.83564091j, 5.00000000e-01+0.8660254j ,
3.20888862e-02+0.18198512j, 3.20888862e-02-0.18198512j,
5.00000000e-01-0.8660254j , -3.37938524e+00+2.83564091j,
-1.15270364e+00+0.41954982j])

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

Nov 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: mclaugb | last post by:
Has anyone recompiled the Scientific Computing package using NumPy instead of Numeric? I need a least squares algorithm and a Newton Rhaphson...
11
by: Fie Pye | last post by:
Hallo I would like to have a high class open source tools for scientific computing and powerful 2D and 3D data visualisation. Therefore I...
3
by: jefishman | last post by:
I have a Python (2.3.x) interpreter running embedded in a C++ application on a host machine. I would like to run a specific package on that host...
3
by: sam | last post by:
hello all, i am currently in the process of planning a piece of software to model polymerisation kinetics, and intend to use python for all the...
5
by: robert | last post by:
Turning algs for old NumPy modules into numpy code I suffer from this: Upon further processing of returns of numpy calculations, lots of data in an...
2
by: Christian | last post by:
Hi, I'm having problems with python 2.4.4 built on a Celeron D. I had problems earlier with that processor which I think has understands some 64...
6
by: jadamwilson2 | last post by:
Hello, I have recently become interested in using python for scientific computing, and came across both sage and enthought. I am curious if anyone...
4
by: Robert LaMarca | last post by:
Hi, I am using numpy and wish to create very large arrays. My system is AMD 64 x 2 Ubuntu 8.04. Ubuntu should be 64 bit. I have 3gb RAM and a...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.