### The Discrete Cosine Transform (DCT)

In image coding (such as MPEG and JPEG), and many audio coding algorithms (MPEG), the*discrete cosine transform*(DCT) is used because of its nearly optimal asymptotic theoretical

*coding gain*.

^{A.9}For 1D signals, one of several DCT definitions (the one called DCT-II)

^{A.10}is given by

where

`dct`and

`dct2`are available for the 1D and 2D cases, respectively.

**Exercise:**Using Euler's identity, expand the cosine in the DCT defined by Eq.(A.2) above into a sum of complex sinusoids, and show that the DCT can be rewritten as the sum of two phase-modulated DFTs:

**Next Section:**

Number Theoretic Transform

**Previous Section:**

Fixed-Point FFTs and NFFTs