setmppar.m

来自「ITU-T G.723.1 Speech Coder: Matlab imple」· M 代码 · 共 42 行

M
42
字号
function MPpar = SetMPpar (MPpar)% Multipulse parameters% $Id: SetMPpar.m 1.1 2003/11/21 G.723.1-v2r1a $if (ischar (MPpar.g))  MPpar.g = load (MPpar.g);end% Grids for pulsesNSubframe = length (MPpar.Grid);NGridMax = 0;for (i = 1:NSubframe)  NG = length (MPpar.Grid{i});  for (j = 1:NG)    % Make a column vector, reverse its order so that the pulses are    % searched from high index to low index. This is a hack so that    % in the case of zero energy, pulses are placed in the high index    % positions first (as in the G.723.1 code)    % *** Don't forget to take this reversal into account when coding    %     the positions ***    MPpar.Grid{i}{j} = flipud (MPpar.Grid{i}{j}(:));    NGridMax = max (NGridMax, length (MPpar.Grid{i}{j}));  endend% Fill in a combinatoric table% nCk(n+1,k+1) is n choose k, except that it is set to% zero if k > nNpMax = max (MPpar.Np);nCk = zeros (NGridMax+1, NpMax+1);for (n = 0:NGridMax)  for (k = 0:NpMax)    if (k <= n)   % Otherwise 0      nCk(n+1,k+1) = nchoosek (n, k);    end  endendMPpar.nCk = nCk;return

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?