cosm.m

来自「里面囊括了基于matlab滤波器设计的各种.m文件」· M 代码 · 共 27 行

M
27
字号
 
 
% [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 + =
减小字号Ctrl + -
显示快捷键?