Programmer Guide/Command Reference/EVAL/dct: Difference between revisions

From STX Wiki
Jump to navigationJump to search
m (1 revision: Initial import)
No edit summary
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
=====dct=====
Compute the forward or inverce '''discrete cosine transform''' (dct) of the input vector ''x''. This function was implemented for the computation of the MFCC (mel-cepstrum coefficients)
;Usage:<code>dct(<var>x</var> {, <var>n</var> {, <var>dir</var>)</code>
:;<var>x</var>the data vector
:;<var>n</var>:the number of dct coefficients to compute or to use (default=<code>nrow(''x'')); the meaning of this argument depends on the value of ''dir''
:;<var>dir</var>:the direction of the dct (default=0)
:::{class="keinrahmen"
|''dir''='''0''' ||-> forward dct
|-
|otherwise ||-> inverse (or backward) dct
;Result: A vector ''y'' containing the result of the transformation. In the following table NX is equal to <code>nrow(''x'')</code>
:{|class="einrahmen"
!''dir'' !! ''n'' !! dct-<BR>length !! ''y'' !! nrow(''y'') !! description
|-
|'''0'''
|<code>0 < ''n'' <= NX</code>
|NX
|dct coefficients
|''n''
|forward dct; if ''n''<NX only the first ''n'' coefficients are computed
|-
|'''1'''
|<code>0 < ''n'' <= NX</code>
|NX
|data samples
|NX
|inverse dct; if ''n''<NX only the first ''n'' coefficients of ''x'' are used (smoothing or liftering)
|-
|'''1'''
|<code>''n'' > NX</code>
|''n''
|data samples
|''n''
|inverse dct; the vector ''x'' is expanded with zeros to length ''n'' and the inverse transform is applied to the expanded vector (smoothing or liftering)
|}
;See also: [[Programmer_Guide/Command_Reference/EVAL/fft|fft]], [[Programmer_Guide/Command_Reference/EVAL/ifft|ifft]], [[Programmer_Guide/Command_Reference/EVAL/dft|dft]], [[Programmer_Guide/Command_Reference/EVAL/cepstrum|cepstrum]], [[Programmer_Guide/Command_Reference/EVAL/lpc|lpc]], [[Programmer_Guide/Command_Reference/EVAL/complex arithmetic|complex arithmetic]]


Discrete Cosine Transform.
[[Programmer_Guide/Command_Reference/EVAL#Functions|<function list>]]
 
=====Usage:=====
 
<code>dct(<var>x</var> {, n {, 0}})</code>
 
=====Function:=====
 
Computes the discrete cosine transform of <var>x</var>. <var>n</var> must be in the range <code>1..nrow(</code><var>x</var><code>)</code>. The default is <var>n</var> <code>= nrow(</code><var>x</var><code>)</code>.
 
=====Result:=====
 
A vector containing the first <var>n</var> dct coefficients.
 
=====Usage:=====
 
<code>dct(<var>x</var>, n, 1)</code>
 
=====Function:=====
 
Computes the inverse dct of <var>x</var>.
 
If <var>n</var> <code><= nrow(</code><var>x</var><code>)</code>:
 
Only the first <var>n</var> coefficients of <var>x</var> are used, the others are set to <code>0</code>. Output length = <code>nrow(</code><var>x</var><code>)</code>.
 
If <var>n</var> <code>> nrow(</code><var>x</var><code>)</code>:
 
<var>x</var> is expanded with zeros to <var>n</var> elements.
 
=====Result:=====
 
A vector containing the inverse dct.

Revision as of 13:06, 12 April 2011

Compute the forward or inverce discrete cosine transform (dct) of the input vector x. This function was implemented for the computation of the MFCC (mel-cepstrum coefficients)

Usage
dct(x {, n {, dir)
xthe data vector
n
the number of dct coefficients to compute or to use (default=nrow(x)); the meaning of this argument depends on the value of dir
dir
the direction of the dct (default=0)
{class="keinrahmen"

|dir=0 ||-> forward dct |- |otherwise ||-> inverse (or backward) dct

Result
A vector y containing the result of the transformation. In the following table NX is equal to nrow(x)
dir n dct-
length
y nrow(y) description
0 0 < n <= NX NX dct coefficients n forward dct; if n<NX only the first n coefficients are computed
1 0 < n <= NX NX data samples NX inverse dct; if n<NX only the first n coefficients of x are used (smoothing or liftering)
1 n > NX n data samples n inverse dct; the vector x is expanded with zeros to length n and the inverse transform is applied to the expanded vector (smoothing or liftering)
See also
fft, ifft, dft, cepstrum, lpc, complex arithmetic

<function list>

Navigation menu

Personal tools