<< Image_Processing_Tool_2 Image_Processing_Tool_2 dct2 >>

Image_Processing_Tool_2 >> Image_Processing_Tool_2 > dct

dct

Discrete Cosine Transform

Calling Sequence

x = dct(a)
x = dct(a, n)

Arguments

X

Real or complex vector or real or complex matrix (2-dim dct).

a

Real or complex vector or real or complex matrix (2-dim dct).

n

Integer value for length of the input vector.

Description

Discrete Cosine Transform (DCT) can linearly transform data into the frequency domain, where the data can be represented by a set of coefficients. The advantage of DCT is that the energy of the original data may be concentrated in only a few low frequency components of DCT depending on the correlation in the data. DCT express a signal (a set of numbers) in terms of a sum of cosine functions with different frequencies. For example, given a set A of n values, x = dct(a) returns the unitary discrete cosine transform of a. x = dct(a, n) pads or truncates a to length n before transforming.

Examples

The DCT is closely related to the Discrete Fourier Transform. You can often reconstruct a sequency very accurately from only a few DCT coefficients, a useful property for applications requiring data reduction. If you plan to use DCT for data compression, you should first find a good way to represent your data where the elements are correlated. For example, let us naively sort the elements of B and then apply DCT to the sorted set.

B = [1  5 -9 -8  7  1  0  9];
W = dct(B);

sumW = sum(abs(W)); // The total energy for DCT coefficient is high for uncorrelated data.

B_s = gsort(B);

W_s = dct(B_s);

sumW_s = sum(abs(W_s)); // The total energy for DCT coefficient is less.

See Also

Authors

<< Image_Processing_Tool_2 Image_Processing_Tool_2 dct2 >>