[Scipy-svn] r5468 - trunk/scipy/fftpack
scipy-svn at scipy.org
scipy-svn at scipy.org
Fri Jan 16 02:34:29 EST 2009
Author: cdavid
Date: 2009-01-16 01:34:25 -0600 (Fri, 16 Jan 2009)
New Revision: 5468
Modified:
trunk/scipy/fftpack/realtransforms.py
Log:
Add definition of dct II we use, + refs.
Modified: trunk/scipy/fftpack/realtransforms.py
===================================================================
--- trunk/scipy/fftpack/realtransforms.py 2009-01-16 07:34:10 UTC (rev 5467)
+++ trunk/scipy/fftpack/realtransforms.py 2009-01-16 07:34:25 UTC (rev 5468)
@@ -31,7 +31,14 @@
def dct2(x, n=None):
"""
Return Discrete Cosine Transform (type II) of arbitrary type sequence x.
+ There are several definitions, we use the following:
+ N-1
+ y[k] = 2* sum x[n]*cos(pi*k*(2n+1)/(2*N)), 0 <= k < N.
+ n=0
+
+ In particular, we do not normalize it by the number of points of the DCT N.
+
Parameters
----------
x : array-like
@@ -42,6 +49,14 @@
Returns
-------
y : real ndarray
+
+ References
+ ----------
+
+ http://en.wikipedia.org/wiki/Discrete_cosine_transform
+
+ 'A Fast Cosine Transform in One and Two Dimensions', by J. Makhoul, in IEEE
+ Transactions on acoustics, speech and signal processing.
"""
return _dct(x, 2, n)
More information about the Scipy-svn
mailing list