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

scipy-svn@scip... scipy-svn@scip...
Wed Jan 7 08:51:01 CST 2009


Author: cdavid
Date: 2009-01-07 08:50:47 -0600 (Wed, 07 Jan 2009)
New Revision: 5358

Modified:
   trunk/scipy/fftpack/basic.py
Log:
Handle single prec in rfft and irfft.

Modified: trunk/scipy/fftpack/basic.py
===================================================================
--- trunk/scipy/fftpack/basic.py	2009-01-07 14:50:17 UTC (rev 5357)
+++ trunk/scipy/fftpack/basic.py	2009-01-07 14:50:47 UTC (rev 5358)
@@ -201,7 +201,10 @@
     tmp = asarray(x)
     if not numpy.isrealobj(tmp):
         raise TypeError,"1st argument must be real sequence"
-    work_function = fftpack.drfft
+    if istype(tmp, numpy.float32):
+        work_function = fftpack.rfft
+    else:
+        work_function = fftpack.drfft
     return _raw_fft(tmp,n,axis,1,overwrite_x,work_function)
 
 
@@ -245,7 +248,10 @@
     tmp = asarray(x)
     if not numpy.isrealobj(tmp):
         raise TypeError,"1st argument must be real sequence"
-    work_function = fftpack.drfft
+    if istype(tmp, numpy.float32):
+        work_function = fftpack.rfft
+    else:
+        work_function = fftpack.drfft
     return _raw_fft(tmp,n,axis,-1,overwrite_x,work_function)
 
 



More information about the Scipy-svn mailing list