diff options
author | Stefan van der Walt <stefan@sun.ac.za> | 2006-09-05 08:32:14 +0000 |
---|---|---|
committer | Stefan van der Walt <stefan@sun.ac.za> | 2006-09-05 08:32:14 +0000 |
commit | 1fcb79afad43182ce548c39fea4b5c4790f5958f (patch) | |
tree | b450e1f1e62fc5fa910c7c7c833c748182d66eb2 /numpy/fft/helper.py | |
parent | 802450e805da6e18538e56e41fcec1c757ff7f1a (diff) | |
download | numpy-1fcb79afad43182ce548c39fea4b5c4790f5958f.tar.gz |
Optimize fftfreq.
Diffstat (limited to 'numpy/fft/helper.py')
-rw-r--r-- | numpy/fft/helper.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/fft/helper.py b/numpy/fft/helper.py index 4e1da2abd..99b576708 100644 --- a/numpy/fft/helper.py +++ b/numpy/fft/helper.py @@ -7,6 +7,7 @@ __all__ = ['fftshift','ifftshift','fftfreq'] 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 @@ def fftfreq(n,d=1.0): 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) |