[Numpy-svn] r3120 - trunk/numpy/fft

numpy-svn at scipy.org numpy-svn at scipy.org
Tue Sep 5 03:32:33 CDT 2006


Author: stefan
Date: 2006-09-05 03:32:14 -0500 (Tue, 05 Sep 2006)
New Revision: 3120

Modified:
   trunk/numpy/fft/helper.py
Log:
Optimize fftfreq.


Modified: trunk/numpy/fft/helper.py
===================================================================
--- trunk/numpy/fft/helper.py	2006-09-05 06:58:18 UTC (rev 3119)
+++ trunk/numpy/fft/helper.py	2006-09-05 08:32:14 UTC (rev 3120)
@@ -7,6 +7,7 @@
 
 from numpy.core import asarray, concatenate, arange, take, \
     array, integer
+from numpy import hstack
 import types
 
 def fftshift(x,axes=None):
@@ -62,5 +63,4 @@
       f = [0,1,...,(n-1)/2,-(n-1)/2,...,-1]/(d*n)   if n is odd
     """
     assert isinstance(n,types.IntType) or isinstance(n, integer)
-    k = range(0,(n-1)/2+1)+range(-(n/2),0)
-    return array(k,'d')/(n*d)
+    return hstack((arange(0,(n-1)/2 + 1), arange(-(n/2),0))) / (n*d)



More information about the Numpy-svn mailing list