my own dct2 implementation
조회 수: 12 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!