[Math] Matlab: Impulse response of linear time invariable (LTI) sine-signal

convolutionMATLABsignal processing

I'm preparing for a lab in a Signals and Systems course in my university, 5th semester.

I've found old exercise material from the class and since I know some Matlab and have dealt with LTI systems and impulse responses of signals before, I decided to try to tackle them.

Of course, I was completely wrong in my decision and I reached a dead-end.

Here's the first part of the exercise, graded for 50%:

The same sine signal $x(n)$ (of your choice) is inserted into two different Linera Time-invariant (LTI) systems with impulse response $h1(n) = u(n)$ and $h2(n) = u(n-10)$, accordingly.

$\alpha )$ Compare the two exits $y1(n)$ and $y2(n)$

$\beta )$ Are the exit signals periodical?

Some questions before my attempt, along with some of my code:

1: I decided to go for this sine-signal:

Fs=1;  
t=0:1/Fs:1000;  
x=sin(2*pi*0.01*t); 

2: Does "are inserted" imply Convolution?

3: How can you mathematically check for periodicality apart from seeing the repetitions with your eye and calling it a day?

Best Answer

After some work and help from a colleague, I managed to get an answer. For posterity, here it is:

And apparently, yes, we're supposed to use convolution from the fact that we're asked for impulse response.

% Creating our sine-signal
clear
t = -50:50;                 
Fs = 25;                    
x=sin(2*pi*(1/Fs)*t);       

% Creating our impulse responses. They're unit steps, going from all-zeroes to all-ones.
h1 = [zeros(1,50) ones(1,50)];                  
h2 = [zeros(1,40) ones(1,60)];      

% Calculating the convolusion result of the square signals above with our original sine-signal.
convPlot1 = conv(x,h1);
convPlot2 = conv(x,h2);

% Plot and check our result.
plot(convPlot1)
plot(convPlot2)