my own dct2 implementation

12 visualizaciones (últimos 30 días)
Uros
Uros el 29 de Oct. de 2012
Hi
I need to make my own implementation of dct2 function in matlab for my school project.
I've written this but it's not working okay. I can't find bugs :S Please help me :(
function [output] = my_dct2(input)
C = [1 / sqrt(2), 1, 1, 1, 1, 1, 1, 1];
for u=1:8,
for v=1:8,
tmp = 0;
for x=1:8,
for y=1:8,
tmp = tmp + input(u, v) * cosd( (2*x + 1)*u*pi/16 ) * cosd( (2*y + 1)*v*pi/16 );
end
end
output(u, v) = 0.25 * C(v) * C(u) * tmp;
end
end
end

Respuestas (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by