0% found this document useful (0 votes)
30 views3 pages

Such As Addition, Subtraction, Multiplication

The MATLAB program defines time and frequency variables to generate two sinusoidal signals. It performs basic operations on the signals like addition, subtraction, and multiplication. It also demonstrates time folding, time scaling, and time shifting of the signals by plotting the results.

Uploaded by

Pradeep Singla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views3 pages

Such As Addition, Subtraction, Multiplication

The MATLAB program defines time and frequency variables to generate two sinusoidal signals. It performs basic operations on the signals like addition, subtraction, and multiplication. It also demonstrates time folding, time scaling, and time shifting of the signals by plotting the results.

Uploaded by

Pradeep Singla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

AIM: - To write a MATLAB program to perform some basic operation ON SIGNALS

such as addition, subtraction, multiplication.

clc;
clear;
clear all;
t=[0:0.01:2*pi];
f1=1;
f2=2;
X1=sin(2*pi*f1*t);
X2=sin(2*pi*f2*t);
subplot(5,2,1);
plot(t,X1);
xlabel('time');
ylabel('amplitude');
title('Plot for FIRST SIGNAL,signal @ 8614214');
subplot(5,2,2);
plot(t,X2);
xlabel('time');
ylabel('amplitude');
title('Plot for SECOND SIGNAL,signal @ 8614214');
X3=X1+X2;
subplot(5,2,3);
plot(t,X3);
xlabel('time');
ylabel('amplitude');
title('Plot for ADDITION,signal @ 8614214');
X4=X1-X2;
subplot(5,2,4);
plot(t,X4);
xlabel('time');
ylabel('amplitude');
title('Plot for SUBTRACTION,signal @ 8614214');
X5=X1.*X2;
subplot(5,2,5);
plot(t,X5);
xlabel('time');
ylabel('amplitude');
title('Plot for MULTIPLICATION,signal @ 8614214');
X=sin(2*pi*f1*-t);
Y=sin(2*pi*f2*-t);
subplot(5,2,6);
plot(-t,X);
xlabel('time');
ylabel('amplitude');
title('Plot for TIME FOLDING OF FIRST SIGNAL @ 8614214');

subplot(5,2,7);
plot(-t,Y);
xlabel('time');
ylabel('amplitude');
title('Plot for TIME FOLDING OF SECOND SIGNAL @ 8614214');
X6=sin(2*pi*f1*2*t);
subplot(5,2,8);
plot(t,X6);
xlabel('time');
ylabel('amplitude');
title('Plot for time scaling of first signal @ 8614214');
X7=sin(2*pi*f1*t+2);
subplot(5,2,9);
plot(t+2,X6);
xlabel('time');
ylabel('amplitude');
title('Plot for time SHIFTING of first signal @ 8614214');

time
Plot for ADDITION,signal @ 8614214

amplitude

0
-2

time
Plot for MULTIPLICATION,signal @ 8614214

0
-1

time
Plot for TIME FOLDING OF SECOND SIGNAL @ 8614214

0
-1
-7
1

-6

-5

-4

-3

-2

-1

time
Plot for time SHIFTING of first signal @ 8614214

0
-1

time

amplitude

-1

amplitude

amplitude

amplitude
amplitude
amplitude
amplitude
amplitude

Plot for FIRST SIGNAL,signal @ 8614214

Plot for SECOND SIGNAL,signal @ 8614214

1
0
-1

-6

-5

-4

4
5
6
time
Plot for SUBTRACTION,signal @ 8614214

0
-2

4
5
6
7
time
Plot for TIME FOLDING OF FIRST SIGNAL @ 8614214

0
-1
-7
1

-3
-2
-1
time
Plot for time scaling of first signal @ 8614214

0
-1

time

You might also like