* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 1997 - INRIA
* Copyright (C) 2012 - Serge Steer - INRIA
-*
+*
* This file must be used under the terms of the CeCILL.
* This source file is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
-* are also available at
+* are also available at
* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
*
-->
-<refentry xmlns="http://docbook.org/ns/docbook"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns:mml="http://www.w3.org/1998/Math/MathML"
- xmlns:db="http://docbook.org/ns/docbook"
+<refentry xmlns="http://docbook.org/ns/docbook"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns:mml="http://www.w3.org/1998/Math/MathML"
+ xmlns:db="http://docbook.org/ns/docbook"
xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="dct">
<refnamediv>
<refname>dct</refname>
vector of positive integers. See the Description part for details.
<para>
Each element must be a divisor
- of the total number of elements of <literal>A</literal>.
+ of the total number of elements of <literal>A</literal>.
</para>
<para>
The product of the elements must be less than the total
</variablelist>
</refsection>
<refsection>
- <title>Description</title>
+ <title>Description</title>
<refsection>
- <title>Transform description</title>
+ <title>Transform description</title>
<para>
This function realizes direct or
inverse 1-D or N-D Discrete Cosine Transforms with shift depending on the <literal>option</literal> parameter value. For a 1-D array <latex>$A$</latex> of length <latex>$n$</latex>:
<itemizedlist>
<listitem>
<para>
- For <literal>"dct1"</literal> the function computes the unnormalized DCT-I transform:
+ For <literal>"dct1"</literal> the function computes the unnormalized DCT-I transform:
</para>
<para>
<latex>
- $X(k) = X(1)+(-1)^{k-1}X(n)+2\sum_{i=2}^{n-1} {A(i)
+ $X(k) = A(1) + (-1)^{k-1}A(n) + 2\sum_{i=2}^{n-1} {A(i)
\cos\frac{\pi (i -1)(k-1)}{n-1}}, k=1\ldots n$
</latex>
</para>
</para>
<para>
<latex>
- $X(k) =2 \sum_{i=1}^{n} {A(i) \cos\frac{\pi (i
+ $X(k) = 2 \sum_{i=1}^{n} {A(i) \cos\frac{\pi (i
-1/2)(k-1)}{n}}, k=1\ldots n$
</latex>
</para>
</para>
<para>
<latex>
- $X(k) =X(1)+ 2 \sum_{i=2}^{n} {A(i) \cos\frac{\pi (i
+ $X(k) = A(1) + 2 \sum_{i=2}^{n} {A(i) \cos\frac{\pi (i
-1)(k-1/2)}{n}}, k=1\ldots n$
</latex>
</para>
</para>
<para>
<latex>
- $X(k) =2 \sum_{i=1}^{n} {A(i) \cos\frac{\pi (i
+ $X(k) = 2 \sum_{i=1}^{n} {A(i) \cos\frac{\pi (i
-1/2)(k-1/2)}{n}}, k=1\ldots n$
</latex>
</para>
\sum_{i=1}^n {A(i) \cos\frac{\pi (i
-1/2)(k-1)}{n}}, k=1\ldots n \quad\text{with }
\omega(1)=\frac{1}{\sqrt{n}} \quad\text{and }
- \omega(k)=\sqrt{\frac{2}{n}} , k>1$
+ \omega(k)=\sqrt{\frac{2}{n}} , k>1$
</latex>
</para>
</listitem>
$X(i) = \sum_{k=1}^n {\omega(k) A(k) \cos\frac{\pi (i
-1/2)(k-1)}{n}}, k=1\ldots n \quad\text{with }
\omega(1)=\frac{1}{\sqrt{n}} \quad\text{and }
- \omega(k)=\sqrt{\frac{2}{n}} , k>1$
+ \omega(k)=\sqrt{\frac{2}{n}} , k>1$
</latex>
</para>
</listitem>
\text{with}\\
\omega_j(1)=\frac{1}{\sqrt{n_j}}\\
\omega_j(k)=\sqrt{\frac{2}{n_j}} , k>1
- \end{array}$
+ \end{array}$
</latex>
</para>
<para>
<para>
<literal>X=dct(A,1 [,option])</literal> or
<literal>X=idct(A [,option])</literal>performs the inverse
- transform.
+ transform.
</para>
<para>
If <literal>A</literal> is a vector (only one
For example, if <literal>A</literal> is a 3-D array
<literal>X=dct(A,-1,2)</literal> is equivalent to:
</para>
- <programlisting role=""><![CDATA[
+ <programlisting role=""><![CDATA[
for i1=1:size(A,1),
for i3=1:size(A,3),
X(i1,:,i3)=dct(A(i1,:,i3),-1);
<para>
and <literal>X=dct(A,-1,[1 3])</literal> is equivalent to:
</para>
- <programlisting role=""><![CDATA[
+ <programlisting role=""><![CDATA[
for i2=1:size(A,2),
X(:,i2,:)=dct(A(:,i2,:),-1);
end
the time computation when consecutives calls (with same
parameters) are performed.
</para>
- <para>
+ <para>
It is possible to go further in dct optimization using
<link linkend="get_fftw_wisdom">get_fftw_wisdom</link>, <link
linkend="set_fftw_wisdom">set_fftw_wisdom</link> functions.
<refsection>
<title>Examples</title>
<para>1-D dct</para>
- <programlisting role="example"><![CDATA[
+ <programlisting role="example"><![CDATA[
//Frequency components of a signal
//----------------------------------
- // build a sampled at 1000hz containing pure frequencies
+ // build a sampled at 1000hz containing pure frequencies
// at 50 and 70 Hz
sample_rate=1000;
t = 0:1/sample_rate:0.6;
]]></programlisting>
<para>2-D dct</para>
- <programlisting role="example"><![CDATA[
+ <programlisting role="example"><![CDATA[
x=-2:0.1:2;
A=eval3d(milk_drop,x,x);
d=dct(A);
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 1997 - INRIA
* Copyright (C) 2012 - Serge Steer - INRIA
-*
+*
* This file must be used under the terms of the CeCILL.
* This source file is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
-* are also available at
+* are also available at
* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
*
-->
-<refentry xmlns="http://docbook.org/ns/docbook"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns:mml="http://www.w3.org/1998/Math/MathML"
- xmlns:db="http://docbook.org/ns/docbook"
+<refentry xmlns="http://docbook.org/ns/docbook"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns:mml="http://www.w3.org/1998/Math/MathML"
+ xmlns:db="http://docbook.org/ns/docbook"
xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="dst">
<refnamediv>
<refname>dst</refname>
vector of positive integers. See the Description part for details.
<para>
Each element must be a divisor
- of the total number of elements of <literal>A</literal>.
+ of the total number of elements of <literal>A</literal>.
</para>
<para>
The product of the elements must be less than the total
</variablelist>
</refsection>
<refsection>
- <title>Description</title>
+ <title>Description</title>
<refsection>
- <title>Transform description</title>
+ <title>Transform description</title>
<para>
This function realizes direct or
inverse 1-D or N-D Discrete Sine Transforms with shift depending on the <literal>option</literal> parameter value:
</para>
<para>
<latex>
- $X(k) = 2\sum_{i=1}^{n} {A(i) \cos\frac{\pi i k}{n+1}},
+ $X(k) = 2 \sum_{i=1}^{n} {A(i) \cos\frac{\pi i k}{n+1}},
k=1\ldots n$
</latex>
</para>
</para>
<para>
<latex>
- $X(k) =2 \sum_{i=1}^{n} {A(i) \cos\frac{\pi ( i
+ $X(k) = 2 \sum_{i=1}^{n} {A(i) \cos\frac{\pi ( i
-1/2) k}{n}}, k=1\ldots n$
</latex>
</para>
</para>
<para>
<latex>
- $X(k) = (-1)^{k-1}X(n)+ 2 \sum_{i=1}^{n-1} {A(i) \cos\frac{\pi i (k-1/2)}{n}}, k=1\ldots n$
+ $X(k) = (-1)^{k-1}A(n) + 2 \sum_{i=1}^{n-1} {A(i) \cos\frac{\pi i (k-1/2)}{n}}, k=1\ldots n$
</latex>
</para>
</listitem>
</para>
<para>
<latex>
- $X(k) =2 \sum_{i=1}^{n} {A(i) \cos\frac{\pi (i
+ $X(k) = 2 \sum_{i=1}^{n} {A(i) \cos\frac{\pi (i
-1/2)(k-1/2)}{n}}, k=1\ldots n$
</latex>
</para>
<para>
<literal>X=dst(A,1 [,option])</literal> or
<literal>X=idst(A [,option])</literal>performs the inverse
- transform.
+ transform.
</para>
<para>
If <literal>A</literal> is a vector (only one
For example, if <literal>A</literal> is a 3-D array
<literal>X=dst(A,-1,2)</literal> is equivalent to:
</para>
- <programlisting role=""><![CDATA[
+ <programlisting role=""><![CDATA[
for i1=1:size(A,1),
for i3=1:size(A,3),
X(i1,:,i3)=dst(A(i1,:,i3),-1);
<para>
and <literal>X=dst(A,-1,[1 3])</literal> is equivalent to:
</para>
- <programlisting role=""><![CDATA[
+ <programlisting role=""><![CDATA[
for i2=1:size(A,2),
X(:,i2,:)=dst(A(:,i2,:),-1);
end
improves greatly the time computation when consecutives
calls (with same parameters) are performed.
</para>
- <para>
+ <para>
It is possible to go further in dst optimization using
<link linkend="get_fftw_wisdom">get_fftw_wisdom</link>, <link
linkend="set_fftw_wisdom">set_fftw_wisdom</link> functions.