The discrete cosine transform (DCT) represents an image as a sum of sinusoids of varying magnitudes and frequencies.
The dct2 function computes the two-dimensional discrete cosine transform (DCT) of an image.
The DCT has the property that, for a typical image, most of the visually significant information about the image is concentrated
in just a few coefficients of the DCT. For this reason, the DCT is often used in image compression applications.
For example, the DCT is at the heart of the international standard lossy image compression algorithm known as JPEG.
(The name comes from the working group that developed the standard: the Joint Photographic Experts Group).
In practice, the DCT is normally implemented using the same basic efficiency techniques as in FFT algorithms.
Download source code
Requirements: Matlab.