dct
From STX Wiki
< Programmer Guide | Command Reference | EVAL
Jump to navigationJump to search
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)
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-
lengthy 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 (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)