⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rocfactor.m

📁 对输入的一有理Z变换表达式(输入分子和分母系数序列)
💻 M
字号:
%  According to ROC, factorize the input function into two part 
%
function [LB,LA,RB,RA] = ROCFactor(R, P, K, dividP)
%  Parameters:
%    R:  Column vectors containing the residues 
%    P: Column vectors containing the poles
%    K: K contains the direct terms in a row vector
%    dividP:  ROC 的分界点的模, 模比dividP小的极点对应的分式逆变换为右边序列, 
%             模大于等于dividP的极点对应的分式逆变换为左边序列
%  Return Value:
%    LB:  numerator polynomial coefficient for Left-side sequence part 
%    LA:  denominator polynomial coefficient for Left-side sequence part
%    RB:  numerator polynomial coefficient for Right-side sequence part
%    RA:  denominator polynomial coefficient for Right-side sequence part

if (dividP < 0)
    error('wrong parameter for function ROCFactor: divideP must be a real number that is not less than 0');
end

len = length(R);

if (len ~=  length(P))
    error('wrong parameter for function ROCFactor: P and R must have same length');
end

% use bubble method to sort R and P (in descending value of abs(P[i]))
for i = 1:len
    for j = 1:len-i
        if abs(P(j)) < abs(P(j+1))
            tmp = P(j);
            P(j) = P(j+1);
            P(j+1) = tmp;
            tmp1 = R(j);
            R(j) = R(j+1);
            R(j+1) = tmp1;
        end
    end
end

for i = len:-1:1
    if abs(P(i)) >= dividP
        break;
    end
end

if (i == -1)
    LR =  [];
    LP =  [];
    RR =  R(i+1:len);
    RP =  p(i+1:len);
    LB = [];
    LA = [];
    [RB RA] = RESIDUEZ(RR, RP, K);
elseif i == len
    LR =  [1:i];
    LP =  [1:i];
    RR =  [];
    RP =  [];
    RB = [];
    RA = [];
    [LB LA] = RESIDUEZ(LR, LP, K);
else
    LR =  R(1:i);
    LP =  P(1:i);
    RR =  R(i+1:len);
    RP =  P(i+1:len);
    [LB LA] = RESIDUEZ(LR, LP, K/2); % ???
    [RB RA] = RESIDUEZ(RR, RP, K/2); % ???
end        


% -------  End of Function  ROCFactor ----------------

⌨️ 快捷键说明

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