[Scipy-svn] r6735 - trunk/scipy/fftpack

scipy-svn@scip... scipy-svn@scip...
Sat Sep 11 19:54:22 CDT 2010

Author: ptvirtan
Date: 2010-09-11 19:54:22 -0500 (Sat, 11 Sep 2010)
New Revision: 6735

Modified:
trunk/scipy/fftpack/basic.py
trunk/scipy/fftpack/helper.py
Log:
3K: fftpack: fix integer division in rfftfreq, and remove its duplicated copy

Modified: trunk/scipy/fftpack/basic.py
===================================================================
--- trunk/scipy/fftpack/basic.py	2010-09-12 00:54:09 UTC (rev 6734)
+++ trunk/scipy/fftpack/basic.py	2010-09-12 00:54:22 UTC (rev 6735)
@@ -4,7 +4,7 @@
# Created by Pearu Peterson, August,September 2002

__all__ = ['fft','ifft','fftn','ifftn','rfft','irfft',
-           'fft2','ifft2', 'rfftfreq']
+           'fft2','ifft2']

from numpy import zeros, swapaxes, integer, array
import numpy
@@ -251,22 +251,6 @@
return _raw_fft(tmp,n,axis,1,overwrite_x,work_function)

-def rfftfreq(n,d=1.0):
-    """ rfftfreq(n, d=1.0) -> f
-
-    DFT sample frequencies (for usage with rfft,irfft).
-
-    The returned float array contains the frequency bins in
-    cycles/unit (with zero at the start) given a window length n and a
-    sample spacing d:
-
-      f = [0,1,1,2,2,...,n/2-1,n/2-1,n/2]/(d*n)   if n is even
-      f = [0,1,1,2,2,...,n/2-1,n/2-1,n/2,n/2]/(d*n)   if n is odd
-    """
-    assert isinstance(n,int) or isinstance(n,integer)
-    return array(range(1,n+1),dtype=int)/2/float(n*d)
-
-
def irfft(x, n=None, axis=-1, overwrite_x=0):
""" irfft(x, n=None, axis=-1, overwrite_x=0) -> y

Modified: trunk/scipy/fftpack/helper.py
===================================================================
--- trunk/scipy/fftpack/helper.py	2010-09-12 00:54:09 UTC (rev 6734)
+++ trunk/scipy/fftpack/helper.py	2010-09-12 00:54:22 UTC (rev 6735)
@@ -16,4 +16,4 @@
f = [0,1,1,2,2,...,n/2-1,n/2-1,n/2,n/2]/(d*n)   if n is odd
"""
assert isinstance(n,int)
-    return array(range(1,n+1),dtype=int)/2/float(n*d)
+    return (array(range(1,n+1),dtype=int)//2)/float(n*d)