Discrete Cosine Transform

One-dimensional forward Discrete Cosine Transform is defined by the equation:

where:

f(n) - an original signal sample,

F(k) - a sample of the spectrum,

0 ≤ n, kN.


This transform may be generalized to a two-dimensional transform defined by the formula:

where:

f(n1,n2) - a sample of an image,

F(k1,k2) - a sample of the two-dimensional spectrum,

0 ≤ n1, k1N1, 0 ≤ n2, k2 ≤ N2.


The transform size is mostly set to N1 = N2 = 8.