📄 invztrans.m
字号:
% According to ROC, inverse a transform function to a sequence.
%
function [SEQ, t] = InvZTrans(R, P, K, dividP, Leng)
% 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的极点对应的分式逆变换为左边序列
% Length: The length of generated sequence.
% Return Value:
% SEQ: Generated sequence by inverse z-transform.
% t: Vector of times
[LB, LA, RB, RA] = ROCFactor(R, P, K, dividP);
lengL = length(LB);
lengR = length(RB);
if lengL ~= 0
% untilize the time-shift property of Z transform to calculate
% left-side sequence
num = fliplr(LB);
den = fliplr(LA);
if Leng > 0
[yl,tl] = impz(num, den, Leng);
else
[yl,tl] = impz(num, den);
end
tl = -tl;
yl = flipud(yl);
tl = flipud(tl);
else
yl = [];
end
if lengR ~= 0
if Leng > 0
[yr,tr] = impz(RB, RA, Leng);
else
[yr,tr] = impz(RB, RA);
end
else
yr = [];
end
length_l = length(yl);
length_r = length(yr);
if length_l ~= 0
if length_r ~= 0
SEQ = [yl(1:length_l-1); yl(length_l)+yr(1); yr(2:length_r)];
t = [tl(1:length_l-1); 0; tr(2:length_r)];
else
SEQ = yl;
t = tl;
end
else
if length_r ~= 0
SEQ = yr;
t = tr;
else
SEQ = [];
t = [];
end
end
% ------- End of Function InvZTrans ------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -