Trouble with plotting z-transform using residue
이전 댓글 표시
Hi,
I am trying to use residue function to compute the inverse z transform. I have a 2nd order X(z). I am tring to use a for loop to multiply by z^n-1 for corresponding n. I have two poles and two zeros so I am assuming the inverse z transform would be the sum of residues of all the poles of z^n-1X(z).
I have attached my code with comment inserted:I am not sure why I am getting zero for all the n values.I am trying to compute x(n) for values for n>0.
window length=500;
xn=1:windowlength;
zn=1:windowlength;
num=[1 2 2]
denom=[1 1 3]
for j=1:windowlength
zn=zeros(1:length(zn))
zn(j)=1 % setting z^n-1 for each loop teration
numf=conv(num,zn); %multiplying zn with num
r=residue(num,denom);
xn(j)=sum(r);
end;
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!