Sunday, 21 October 2012

Z Transform Shifting Property in MATLAB



Just create a new file with extension .m and paste the code below in that .m file. Then Run it.

clear all;
clc;
syms z;
x=input('enter the sequence x(n) : ');
s=input('enter the starting interval of x(n) : ');
a=input('enter the value of Shifting Factor(+ve for Delayed)(-ve for Advanced) : ');
l=length(x);
LHS=0;
%starting of LHS
for n=(s+a):1:(l+s+a-1)
    LHS=LHS+x(n-s-a+1)*z^(-n);

end
LHS
RHS=0;
%starting of RHS
for n=s:1:l+s-1
    RHS=RHS+x(n-s+1)*z^(-n);
end
RHS=z^(-a)*RHS;
RHS

No comments:

Post a Comment

Tech N Science © 2013