Each discrete cosine transform (DCT) uses N real basis vectors whose compon
ents are cosines. In the DCT-4, for example, the jth component of v(k) is c
os(j + 1/2) (k + 1/2)pi/n. These basis vectors are orthogonal and the trans
form is extremely useful in image processing. Tf the vector x gives the int
ensities along a row of pixels, its cosine series Sigma c(k)v(k) has the co
efficients c(k) = (x,v(k))/N. They are quickly computed from a Fast Fourier
Transform. But a direct proof of orthogonality, by calculating inner produ
cts, does not reveal how natural these cosine vectors are.
We prove orthogonality in a different way. Each DCT basis contains the eige
nvectors of a symmetric "second difference": matrix. By varying the boundar
y conditions we get the established transforms DCT-1 through DCT-4. Other c
ombinations lead to four additional cosine transforms. The type of boundary
condition (Dirichlet or Neumann, centered at a meshpoint or a midpoint) de
termines the applications that are appropriate for each transform. The cent
ering also determines the period: N - 1 or N in the established transforms,
N - 1/2 or N + 1/2 in the other four. The key point is that all these "eig
envectors of cosines" come from simple and familiar matrices.