%% DCT transform
% Tom Wada
% 2011/6/20

N=8;
n=(0:N-1);
%Šî’êŠÖ�”
p=zeros(N,N);
p(1,:)=1*cos(pi/(2*N)*(2*n+1)*0);
for l=2:N
    p(l,:)=sqrt(2)*cos(pi/(2*N)*(2*n+1)*(l-1));
end
%’¼Œðƒ`ƒFƒbƒN
InnerProd=zeros(N,N);
for l=1:N
    for n=1:N
        InnerProd(l,n)=p(l,:)*p(n,:)'/N;
    end
end
figure(1)
for l=1:N
    subplot(8,1,l)
    stem(p(l,:));
    axis([1,8,-2,2]);
end

