Signals & Systems Lab#10: Signal Addition
Signals & Systems Lab#10: Signal Addition
NO:______________________
Teachers
Initials:________________
Marks Obtained:_________________
Signal Addition:
Let we have two signals x1=[1 2 2 3] and x2=[2 -1 3]. As the dimensions of
the two signals are not same so they cannot be added with the simple +
sign. First we have to make the dimensions of the two signals equal
n=4;
x1=[1 2 2 3];
x2=[2 -1 3];
x1=[x1 zeros(1,4-length(x1))];
x2=[x2 zeros(1,4-length(x2))];
sum=x1+x2;
stem(sum)
The resultant signal is as follows
5
4.5
4
3.5
3
2.5
2
1.5
1
0.5
0
0.5
1.5
2.5
Task(5.2): First write the equation of the following figure and then
write the matlab code to plot it with the help of its equation.
6
0.5
1.5
2.5
3.5
4.5
x2 ={-1, -2, -3, -4, -5, -6} ,n2 = {-5, -4, -3, -2, -1, 0}
Determine and plot the following sequences
y = x1+x2
z = x1 * x2
Task(5.5) Write the Matlab code for the following sequence and show the
resultant figure.
Take the interval 0 n 20.
Y[n]= u[n] + u[n-10]
Task(5.6) Write the Matlab code for the following equation and show
the resultant figure. You have to take the interval by observing the
equation
Y[n] = u[n] + u[n-1] + u[n-2] + u[n-3] + u[n-4] + u[n-5]