📄 cosm.m
字号:
% [Ca,Cs] = cosm(M,m)
%
% Select the value of M and m such that N=2*m*M.
% Then deliver the Cosine-Modulated Matrix (CMM) C
% with the order M-by-2*M, Ca and Cs are the
% result of Cosine-Modulated Matrix in analysis
% and synthesis case respectively. We usually use
% this function to evaluate the property of CMM.
function [Ca,Cs] = cosm(M,m)
N = 2*m*M;
% produce the elements of the Ca matrix
for k = 1:M
for l = 1:2*M
Ca(k,l) =
2*cos((2*(k-1)+1)*(pi/(2*M))*((l-1)-(N-1)/2)+(pi/4)*(-1)^(k-1));
end
end
for k = 1:M
for l = 1:2*M
Cs(k,l) =
2*cos((2*(k-1)+1)*(pi/(2*M))*((l-1)-(N-1)/2)-(pi/4)*(-1)^(k-1));
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -