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

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
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)
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>
;Usage:<code>dct(<var>x</var> {, <var>n</var> {, <var>dir</var>)</code>
:;<var>x</var>the data vector
:;<var>x</var>:the data or coefficient 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>n</var>:the number of dct coefficients to compute or to use (default=<code>nrow(''x'')</code>); the meaning of this argument depends on the value of ''dir''
:;<var>dir</var>:the direction of the dct (default=0)
:;<var>dir</var>:the direction of the dct (default=0)
:::{class="keinrahmen"
:::{|class="keinrahmen"
|''dir''='''0''' ||-> forward dct
|''dir''='''0''' ||&rarr; forward dct
|-
|-
|otherwise ||-> inverse (or backward) dct
|otherwise ||&rarr; 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>
|}
;Result: A vector ''y'' containing the result of the transformation. In the following table NX is equal to <code>nrow(''x'')</code>.
:{|class="einrahmen"
:{|class="einrahmen"
!''dir'' !! ''n'' !! dct-<BR>length !! ''y'' !! nrow(''y'') !! description
!''dir'' !! ''x'' !! ''n'' !! dct-<BR>length !! ''y'' !! nrow(''y'') !! description
|-
|-
|'''0'''
|'''0'''
|<code>0<''n''<=NX</code>
|data samples
|<code>0<''n''&le;NX</code>
|NX
|NX
|dct coefficients
|dct coefficients
Line 21: Line 23:
|-
|-
|'''1'''
|'''1'''
|<code>0<''n''<= NX</code>
|dct coefficients
|<code>0<''n''&le;NX</code>
|NX
|NX
|data samples
|data samples
|NX
|NX
|inverse dct; if ''n''<NX only the first ''n'' coefficients of ''x'' are used (smoothing or liftering)
|inverse dct; if ''n''<NX only the first ''n'' coefficients of ''x'' are used, all other are set to 0 (smoothing or liftering)
|-
|-
|'''1'''
|'''1'''
|dct coefficients
|<code>''n''>NX</code>
|<code>''n''>NX</code>
|''n''
|''n''
Line 34: Line 38:
|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)
|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]]
;See also: [[../fft|fft]], [[../ifft|ifft]], [[../dft|dft]], [[../cepstrum|cepstrum]], [[../lpc|lpc]]


[[Programmer_Guide/Command_Reference/EVAL#Functions|<function list>]]
[[../#Functions|<function list>]]

Latest revision as of 20:24, 21 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)
x
the data or coefficient 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)
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 x n dct-
length
y nrow(y) description
0 data samples 0<n≤NX NX dct coefficients n forward dct; if n<NX only the first n coefficients are computed
1 dct coefficients 0<n≤NX NX data samples NX inverse dct; if n<NX only the first n coefficients of x are used, all other are set to 0 (smoothing or liftering)
1 dct coefficients 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

<function list>

Navigation menu

Personal tools