473,769 Members | 3,102 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 22364
On 1 Nov 2006 16:04:59 -0800, mc****@gmail.co m <mc****@gmail.c omwrote:
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.18 198512j, 0.03208889-0.18198512j,
0.5 -0.8660254j , -3.37938524+2.83 564091j,
-1.15270364+0.41 954982j])

>
--
http://mail.python.org/mailman/listinfo/python-list
Nov 1 '06 #2
mc****@gmail.co m 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
2585
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 algorithm which is contained in Numeric but all the documentation out there says that Numeric is crap and all code should be using NumPy. Thanks, Bryan
11
3650
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 chosepython, numpy and scipy as a base. Now I am in search for a visualisation tool. I tried matplotlib and py_opendx with OpenDx. OpenDx seems to me very good but the project py_opendx looks like closed. After py_opendx instalation and subsequent testing I got an error that needs discussion with author...
3
3278
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 machine (numpy). I have managed to compile (cross-compile) the library, so that I have the python modules and the compiled .so files. I am relatively sure that these would import normally in a standard interpreter (they give bad magic on the build machine). However, I would like to be able...
3
2118
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 high-level stuff. the number-crunching is something i would prefer to do in fortran (which i have never used, but will learn), but i have no experience of accessing non-python code from python. i am also fairly new to programming period, and am therefore tackling a fairly serious issue reletive...
5
4866
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 apps object tree will become elementary numpy types. First there is some inefficiency in calculations. And then you get data inflation and questionable dependencies - e.g. with pickle,ZODB,mpi's ... : 0.0...
2
2305
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 bit instructions (whatever that means) but is still 32 bit. Thus when e.g. trying to build numpy with the self built python I get that error: Traceback (most recent call last): File "setup.py", line 89, in ? setup_package() File "setup.py", line 59, in setup_package
6
3284
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 can tell me what the differences are between the two, since there seems to be a lot of overlap (from what I have seen). If my goal is to replace matlab (we do signal processing and stats on physiological data, with a lot of visualization), would sage or enthought get me going quicker? I realize...
4
10065
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 15 GB swap drive. The command I have been trying to use is; g=numpy.ones(,numpy.int32) This returns a memory error. A smaller array () worked fine.. Two smaller arrays again crashed the system.
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10222
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10050
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9866
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8876
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3967
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3570
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.