COSINE FOURIER TRANSFORM

Cosine Transform

The cosine transform is the expansion of a function on the interval [0, B] on the basis 1/sqrt(B) and sqrt(2/B) cos(π k x / B) [for k>0]. Thus the coefficients of the transform are,

Fk = sqrt(2/B) Ck ∫ F(x) cos(π k x/B)

where the integral is over the interval [0,B]. Ck has value 1/sqrt(2) if k=0, and 1 otherwise.

Discrete Cosine Transform

Let Fi,j a 2-dim function on the discrete set NxM. Its discrete cosine transform is

F^v,w = sqrt(NM)/2 Cv Cw ∑ Fi,j cos[(2 i +1) v π/(2N)] cos[(2 j +1) w π/(2M)]

where the coefficients Cu have value 1/sqrt(2) if u=0, and 1 otherwise. The sum runs on i from 0 to N-1 and on j from 0 to M-1. The inverse transform is similar to the direct transform,

Fi,j = sqrt(NM)/2 ∑ Cv Cw Fv,w cos[(2 i +1) v π/(2N)] cos[(2 j +1) w π/(2M)]

where the sum runs on v from 0 to N-1 and on w from 0 to M-1. The important point is that the kernel of the tranform is the same as that of the inverse transform,

K(i,j;v,w) = sqrt(NM)/2 Cv Cw cos[(2 i +1) v π/(2N)] cos[(2 j +1) w π/(2M)]

Proof. The key to the discrete cosine transform is the identity

½ + ∑ cos[(2x+1) π u/(2N)] cos[(2y+1) π u/(2N)] =
= ¼ ∑{ exp[i (x+y+1) π u/N] + exp[i (x-y) π u/N] }
= ¼{ e-i (x+y+1) π ∑ exp[i (x+y+1) π u/N] + e-i (x-y) π ∑ exp[i (x-y) π u/N] }
= N/2 dx,y

The sums in the first line run from 1 to N-1. That on the second line from -N+1 to N-1, but a term -N can be added, because it vanishes. The sums in the third line run from 0 to 2N-1. The first of them is zero because x+y+1 is always positive.

Marco Corvi - Page hosted by geocities.com.