Inverse discrete cosine transform

`x = idct(y)`

x = idct(y,n)

x = idct(gpuArrayY,n)

`x = idct(y)`

returns the inverse
discrete cosine transform of `y`

. `x`

has
the same size as `y`

. If `y`

is
a matrix, then `idct`

transforms its columns.

`x = idct(y,n)`

zero-pads or
truncates the vector `y`

to length `n`

before
transforming.

`x = idct(gpuArrayY,n)`

returns the inverse
discrete cosine transform of `gpuArray`

object `gpuArrayY`

.
See GPU Computing and GPU
System Requirements for details on `gpuArray`

objects.

The inverse discrete cosine transform reconstructs a sequence
from its discrete cosine transform (DCT) coefficients. The `idct`

function
is the inverse of the `dct`

function.

The inverse discrete cosine transform is defined by

$$x(n)={\displaystyle \sum _{k=1}^{N}w}(k)y(k)\mathrm{cos}\left(\frac{\pi (2n-1)(k-1)}{2N}\right),\text{\hspace{1em}}n=1,2,\dots N$$

where

$$w(k)=\{\begin{array}{ll}\frac{1}{\sqrt{N}},\hfill & k=1\hfill \\ \sqrt{\frac{2}{N}},\hfill & 2\le k\le N\hfill \end{array}$$

and *N* is the length of `x`

.
The series is indexed from *n*` = `

1 and *k*` = `

1 instead of the usual *n* = 0 and *k* = 0 because MATLAB^{®} vectors
run from 1 to *N* instead of from
0 to *N*-1.

[1] Jain, A. K. *Fundamentals of
Digital Image Processing*. Englewood Cliffs, NJ: Prentice-Hall,
1989.

[2] Pennebaker, W. B., and J. L. Mitchell. *JPEG
Still Image Data Compression Standard*. New York: Van Nostrand
Reinhold, 1993.

Was this topic helpful?