You should use absolute (a ufunc) and not abs (internal python function):

>>> plot(absolute(fft(b)))

Nadav.


-----הודעה מקורית-----
מאת: [EMAIL PROTECTED] בשם frank wang
נשלח: ד 24-ספטמבר-08 08:21
אל: Discussion of Numerical Python
נושא: [Numpy-discussion] performance of the numpy
 

Hi, I am new user from matlab world. So I always compare with matlab. in my 
code, i have a large array with about 100000 data. when I perform
 
c=fft(b)
d=abs(c)
plot(d)
 
I got good response. however, when i try to execute:
plot(abs(fft(b)))
 
it takes forever and i have to kill the operation. 
 
In another situation, i want debug my code, so i use pdb.set_trace() to break 
and then execute the next command:
c=fft(b)
 
Then the python keeps running and never got out. I have to kiill it too. i 
posts this and hope the expert will fix this in future.
 
Thanks for the great work.
 
Frank
_________________________________________________________________
Get more out of the Web. Learn 10 hidden secrets of Windows Live.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008

<<winmail.dat>>

_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to