# time invariance concept? First of all ,please let me know?Is cosine time invariant or time variant? If latter is the case then if a time varying input like cos is given to a time invariant system,how will it behave?

I have a system $$y(t) = x^2(t)$$ Apparently from equation it seems to be time invariant But when i give it input $$x(t) = \cos(2 \pi t)$$ I do not get time invariant response as shown through following matlab code Although people are commenting that my system is still time invariant but as shown highlighted in attached photo y(t-3) span is between 3 to 13 while S[x(t-3)] span is between 0 to 10 but as by book both of them should have same time span?I am confused in this difference in time span

clc
clear all
close all
t=0:.001:10;
x=cos(2*pi*t);
y=x.^2;
subplot(3,1,1)
plot(t,y)

legend('y(t)')

subplot(3,1,2)
plot(t+3,y)

legend('y(t-3)')

xn=cos(2*pi*(t-3));
y2=xn.^2;
subplot(3,1,3)
plot(t,y2)

legend('S[x(t-3)]')

• What do you mean by "time invariant response"? A constant? The concept of time-(in)variance is applied to systems not to signals. Apr 24 '19 at 8:50
• engr, i am not sure you got the definition of "time-invarance" down correctly. Apr 24 '19 at 19:26
– engr
Apr 25 '19 at 9:38

You do get a time-invariant response. Your code produces the same output for all three signals. In particular, it produces the same output for $$y(\sigma^T\{x(t)\}))$$ as for $$\sigma^T\{y(x(t))\}$$ (plots 2 and 3 in your code). It is hard to see in your case because you have shifted the signal $$3\cdot 2\pi$$ in time. Whats a cosine shifted by $$6\pi$$? The same cosine. Everything will be clearer if you plot the signals on top of each other and shift by a more informative value.

Try this code:

clc
clear all
close all
t=0:.001:10;
x=cos(2*pi*t);
y=x.^2;
plot(t,y)
hold on;

plot(t+0.25,y)

xn=cos(2*pi*(t-0.25));
y2=xn.^2;
plot(t,y2)

legend('y(t)','y(t-3)','y[x(t-0.25)]')

hold off


You can see in the attached image, the orange and red lines, corresponding to shifted output and output on shifted input respectively, align with each other. That is why you can not see the red line up until the orange line ends. The unshifted output of the unshifted signal in blue does not align with the two other. A system can be described by several properties, for instance linearity, time-invariance, or instantaneity. Then, it can be characterized by specific signals (sometimes termed root signals in the non-linear filter literature). For instance, linear and time-invariant systems are fully characterized by sines and cosines, or complex exponentials. Hence, somehow, I consider that a cosine, despite appearances, is not completely time-variant.

Anyway, your system is time-invariant, and instantaneous. Being time-invariant just means that your system's properties don't vary with time. It does not mean that the output does not vary with time, but that if an input is shifted, the corresponding output will be shifted accordingly.

Since your system is also instantaneous, this is way easier to check, as done graphically by @avakok. More technically, suppose that the output of $$x(t)$$ is $$y(t)=x^2(t)$$. The output of $$x_{t_0}(t) = x(t-t_0)$$ is $$y_{t_0}(t)=x^2(t-t_0)$$, which is just the output of $$x$$, delayed by $$t_0$$.