Testing shift invariant system help

Status
Not open for further replies.

lesgoodfella

Newbie level 2
Joined
Sep 13, 2009
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,293
I need help in testing whether or not a system in time-invariant, the problem is, i don't know how to enter the system into matlab.

this is the system:

y = n*x+x(n-1)

then i want to shift it by 10 and compare the output.
This is my program and i get errors:
n = 0:40; D = 10;a = 3.0;b = -2;
x = a*cos(2*pi*0.1*n) + b*cos(2*pi*0.4*n);
n1 = n-1;
x1 = a*cos(2*pi*0.1*n1) + b*cos(2*pi*0.4*n1);
xd = [zeros(1,D) x];
xd1 = [zeros(1,D) x1];
y = n.*x+x1;
yd = n.*xd+xd1;
d = y - yd(1+D:41+D);

is there an easier way to do this?
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…