Discrete Cosine Transform

1D DCT:

dct1

Inverse 1D DCT:

dct2

2D DCT:

dct3

Inverse 2D DCT:

dct4

RGB = imread('lena.tif');
I = rgb2gray(RGB);
J = dct2(I);
figure, imshow(log(abs(J)),[]), colormap(jet(64)), colorbar
J(abs(J) < 10) = 0; %filter
K = idct2(J);
figure, imshow(I)
figure, imshow(K,[0 255])

Relationship between DCT and FFT

  • DCT (Discrete Cosine Transform) is actually a cut-down version of the Fourier Transform or the Fast Fourier Transform (FFT):
  • Only the real part of FFT
  • Computationally simpler than FFT
  • DCT — Effective for Multimedia Compression
  • DCT MUCH more commonly used (than FFT) in Multimedia Image/Video Compression
  • Cheap MPEG Audio Variant
Advertisements