idct
Inverse discrete cosine transform.
Syntax
y = idct(x)
y = idct(x,n)
Inputs
- x
- The transform to be inverted.
- n
- The idct length (default: the input vector length).
Outputs
- y
- The inverse transform of x.
Example
Demonstrate data compression by inverting a transform after zeroing the final four values.
x = [1, 4, 9, 16, 25, 36, 49, 64];
y = dct(x)
y(5:8) = 0
z = idct(y)
y = [Matrix] 1 x 8
72.12489 -57.98091 12.61729 -6.06109 2.82843 -1.80813 0.89668 -0.45632
y = [Matrix] 1 x 8
72.12489 -57.98091 12.61729 -6.06109 0.00000 0.00000 0.00000 0.00000
z = [Matrix] 1 x 8
0.37521 4.40076 9.95187 15.69950 23.64365 36.21970 51.42766 62.28164
Comments
The idct is applied to a vector input or to each column vector of a matrix input. When n is used, each input vector is either truncated or extended with zeroes to the specified length. idct uses the FFTW library.