Qu

dct

Builtin index · Signal processing

result = dct(x)

Input: x · Output: result

What it is

x is a length-N real vector.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = dct(x)
x vectornot documented yet
result vector
Returns a length-N real vector. Orthonormal DCT-II (MATLAB dct / scipy.fft.dct(norm='ortho') convention).

Examples

From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.

  c = dct([1, 2, 3, 4, 5, 6, 7])
  xr = idct(c)                 # xr == the original signal

from numerics-dsp

How it works

Orthonormal DCT-II / DCT-III pair (MATLAB dct/idct, scipy.fft.dct(norm='ortho') convention) -- round-trips exactly since the basis is orthonormal.

From the note above this builtin in the interpreter, where the reasoning was written down as it was built.