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

scipy-svn@scip... scipy-svn@scip...
Sun Jan 18 05:25:40 CST 2009


Author: cdavid
Date: 2009-01-18 05:25:34 -0600 (Sun, 18 Jan 2009)
New Revision: 5486

Modified:
   trunk/scipy/fftpack/realtransforms.py
Log:
Add doc for dct3.

Modified: trunk/scipy/fftpack/realtransforms.py
===================================================================
--- trunk/scipy/fftpack/realtransforms.py	2009-01-18 11:25:15 UTC (rev 5485)
+++ trunk/scipy/fftpack/realtransforms.py	2009-01-18 11:25:34 UTC (rev 5486)
@@ -36,7 +36,7 @@
     sequence x.
 
     This is the most commonly used DCT, and corresponds to what is called 'the'
-    DCT; in particular, dct2(x, norm='ortho) gives the same result as Matlab
+    DCT; in particular, dct2(x, norm='ortho') gives the same result as Matlab
     dct function
 
     Parameters
@@ -81,14 +81,9 @@
     """
     Return Discrete Cosine Transform (type III) of arbitrary type sequence x.
 
-    There are several definitions, we use the following:
-
-                          N-1
-        y[k] = x[0] + 2 * sum x[n]*cos(pi*(k+0.5)*n/N), 0 <= k < N.
-                          n=0
-
-    The DCT-III is the inverse of DCT-II up to a scaling factor.
-
+    This is also called 'the' inverse DCT (IDCT) - dct3(x, norm='ortho') is
+    exactly the same as the idct function of Matlab.
+    
     Parameters
     ----------
     x : array-like
@@ -104,11 +99,22 @@
 
     Notes
     -----
+    There are several definitions, we use the following (norm=None):
+
+                          N-1
+        y[k] = x[0] + 2 * sum x[n]*cos(pi*(k+0.5)*n/N), 0 <= k < N.
+                          n=0
+
+    Or (norm='ortho'), for 0 <= k < N:
+
+                                            N-1
+        y[k] = x[0] / sqrt(N) + sqrt(1/N) * sum x[n]*cos(pi*(k+0.5)*n/N)
+                                            n=0
+
     The (unnormalized) DCT-III is the inverse of the (unnormalized) DCT-II, up
-    to a factor 2*N.
+    to a factor 2*N. The orthonormalized DCT-III is exactly the inverse of the
+    orthonormalized DCT-II.
 
-    This is also called 'the' inverse DCT (IDCT).
-    
     Examples
     --------
     >>> x = np.linspace(0, 9, 10)



More information about the Scipy-svn mailing list