enter image description here

I am studying linear systems from the book "Signals and Systems Laboratory with MATLAB". I have performed an example on MATLAB myself in this regard. Code is as follow:

clear all
close all
ylim([-1 11]);
ylim([-1 19]);

When I run this program I get two figures containing two same shapes that are curve-like but amplitude/size/height is not same.

I am confused if my this system defined by equation y=2*z*cos(pi*t/3) used in program above is linear or not? If still yes, then why (as we have size difference in both curves)?

  • $\begingroup$ I tried to improve the typesetting, but did not understand the last y= equation, and the actual question. Could you provide more details? $\endgroup$ Apr 11, 2019 at 18:15
  • $\begingroup$ dear@LaurentDuval . I for got to set both outputs with different names/identifier. I have now edited my code for clarification. So now y1 represents left hand side of linearity equation and y2 represents right hand side of linearity equation. As per requirement/law of linearity both sides of equation should be equal $\endgroup$
    – DSP_CS
    Apr 12, 2019 at 5:10
  • $\begingroup$ i have highlighted linearity equation in attached photo $\endgroup$
    – DSP_CS
    Apr 12, 2019 at 5:40

2 Answers 2


To expand on Justme's reply:

From the looks of your code you seem to have confused what constitutes an LTI system.

In your code the LTI system that I see (y1=2*z) scales an undelayed input signal by 2. The additional 2*cos(pi/t) is NOT part of the system, it is in effect just another sinusoid that you have added to your signal - thus giving it an additional frequency component.

An LTI system can only ever do two things to an input complex signal - it can scale the magnitude and it can modify the phase of frequency components of the signal. It cannot modify the fundamental frequencies of the sinusoidal components of a signal. (NB: It can however create resonances that self-oscillate - this is however cause by recursion in the system)

Returning to your code once again, we see that you have checked the linearity property, but have also included a scaling of the additional sinusoid that you have misattributed as part of the system. If you remove this sinusoid in your system function, you will find that the linearity property holds for your system

Edit: Fixed some technical wording issues


But you have an error so y1 and y2 are not equal. There is only 2*cos(pi*t/3) in y1, but 10*cos(pi*t/3) in y2.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.