Code covered by the BSD License  

Highlights from
MatLab Solutions: "Introduction to Digital Signal Processing: A Computer Laboratory Textbook".

image thumbnail

MatLab Solutions: "Introduction to Digital Signal Processing: A Computer Laboratory Textbook".

by

 

29 Oct 2012 (Updated )

These files are the MatLab solutions of exercises contained in the above DSP lab textbook.

my_DCT_2D(X)
% Two-dimensional DCT computation.
% Input X is an arbitrary real or complex data matrix.
% Output Y is its 2D-DCT transform.
% 2D DCT is useful for sparse representation and compression of digital
% images. It finds extensive application in the jpeg image formats.
function Y = my_DCT_2D(X)

[rows cols] = size(X);

X1 = zeros(rows,cols);
Y    = zeros(rows,cols);

% Compute the DCT row-wise:
for i=1:rows
     X1(i,:) = my_DCT(X(i,:));
end

% Because of the 2D-FFT separability, now
% compute the FFT column-wise on matrix x1:
for j=1:cols
    Y(:,j) = my_DCT(X1(:,j));
end

Contact us