Module 4.3: Discrete Cosine Transform

2-D Discrete cosine transforms

One disadvantage of the DFT for some applications is that the transform is complex valued, even for real data. A related transform, the discrete cosine transform (DCT), does not have this problem. The DCT is a separate transform and not the real part of the DFT. It is widely used in image and video compression applications, e.g., JPEG and MPEG. It is also possible to use DCT for filtering using a slightly different form of convolution called symmetric convolution.

Definition (2-D DCT)

Assume that the data array has finite rectangular support on then the 2-D DCT is given as

for

(4.3.1)

The DCT basis functions for size 8 x 8 are shown in Figure ( ). The mapping between the mathematical values and the colors (gray levels) is the same as in the DFT case. Each basis function occupies a small square; the squares are then arranged into as 8 x 8 mosaic. Note that unlike the DFT, where the highest frequencies occur near , the , the highest frequencies of the DCT occur at the highest indices .

The inverse DCT exists and is given for as,

(4.3.2)

where the weighting function w(k) is given just as in the case of 1-D DCT by

(4.3.3)

From eqn (4.3.1), we see that the 2-D DCT is a separable operator. As such it can be applied to the rows and then the columns, or vice versa. Thus the 2-D theory can be developed by repeated application of the 1-D theory. In the following subsections we relate the 1-D DCT to 1-D DFT of a symmetrically extended sequence. This not only provides an understanding of the DCT but also enables its fast calculation. We also present a fast DCT calculation that can avoid the use of complex arithmetic in the usual case where x is a real-valued signal, e.g., an image. (Note: the next two subsections can be skipped by the reader familiar with the 1-D DCT)