[Scipy-svn] r5467 - trunk/scipy/fftpack/src

scipy-svn@scip... scipy-svn@scip...
Fri Jan 16 01:34:15 CST 2009


Author: cdavid
Date: 2009-01-16 01:34:10 -0600 (Fri, 16 Jan 2009)
New Revision: 5467

Modified:
   trunk/scipy/fftpack/src/dct.c
Log:
Divide every points of the DCT by 2 for dct2.

Modified: trunk/scipy/fftpack/src/dct.c
===================================================================
--- trunk/scipy/fftpack/src/dct.c	2009-01-16 00:04:38 UTC (rev 5466)
+++ trunk/scipy/fftpack/src/dct.c	2009-01-16 07:34:10 UTC (rev 5467)
@@ -41,7 +41,7 @@
         }
 
 	if (normalize) {
-                fprintf(stderr, "dct1: normalize not yet supported=%d\n", 
+                fprintf(stderr, "dct1: normalize not yet supported=%d\n",
                                 normalize);
 	} else {
                 ptr = inout;
@@ -65,7 +65,12 @@
         }
 
 	if (normalize) {
-                fprintf(stderr, "dct2: normalize not yet supported=%d\n", 
+                fprintf(stderr, "dct2: normalize not yet supported=%d\n",
                                 normalize);
-	}
+	} else {
+                ptr = inout;
+                for (i = n * howmany - 1; i >= 0; --i, ++ptr) {
+                        *((double *) (ptr)) *= 0.5;
+                }
+        }
 }



More information about the Scipy-svn mailing list