my own dct2 implementation
Show older comments
Hi
I need to make my own implementation of dct2 function in matlab for my school project.
http://shrani.si/f/2t/c5/4VV5U3xL/brez-naslova.png C(1) = 1/sqrt(2) C(2:8) = 1
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
Answers (0)
Categories
Find more on Image Transforms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!