Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 14bd37e7 authored by hhakim's avatar hhakim
Browse files

Add analytical formula in DCT/DST doc.

parent 0af95302
No related branches found
No related tags found
No related merge requests found
%=========================================
%> @brief Returns the Direct Cosine Transform (Type II) Faust of order n.
%>
%> The analytical formula of DCT II used here is:
%> \f$2 \sum_{n=0}^{N-1} x_n cos \left( {\pi k (2n + 1)} \over {2N} \right)\f$
%>
%> @param n: the order of the DCT (it must be a power of two).
%> @param 'dev', str: 'gpu' or 'cpu' to create the Faust on CPU or GPU ('cpu' is the default).
%>
......
%=========================================
%> @brief Returns the Direct Sine Transform (Type II) Faust of order n.
%>
%> @param n: the order of the DCT (it must be a power of two).
%> The analytical formula of DST II used here is:
%> \f$2 \sum_{n=0}^{N-1} x_n sin \left( {\pi (k+1) (2n + 1)} \over {2N} \right)\f$
%>
%> @param n: the order of the DST (it must be a power of two).
%> @param 'dev', str: 'gpu' or 'cpu' to create the Faust on CPU or GPU ('cpu' is the default).
%>
%> @b Example
......
......@@ -3302,6 +3302,10 @@ def dft(n, normed=True, dev='cpu'):
def dct(n, dev='cpu'):
"""Returns the Direct Cosine Transform (Type II) Faust of order n.
The analytical formula of DCT II used here is:
\f$2 \sum_{n=0}^{N-1} x_n cos \left( {\pi k (2n + 1)} \over {2N} \right)\f$
Args:
n: the order of the DCT (must be a power of two).
dev: the device on which the Faust is created.
......@@ -3398,6 +3402,9 @@ def dst(n, dev='cpu'):
"""
Returns the Direct Sine Transform (Type II) Faust of order n.
The analytical formula of DST II used here is:
\f$2 \sum_{n=0}^{N-1} x_n sin \left( {\pi (k+1) (2n + 1)} \over {2N} \right)\f$
Args:
n: the order of the DST (must be a power of two).
dev: the device on which the Faust is created.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment