0% found this document useful (0 votes)
41 views

Lab Task # 2:: To Plot CT Oscillatory Signal

The document contains code to plot an oscillatory signal for three cases: (1) when a is negative, (2) when a is positive, and (3) when a is zero. For each case, the code generates the oscillatory signal as the product of an exponential function and a sine wave, plots the signal, and labels the x- and y-axes. The plots are displayed in three subplots to compare the signals under the different conditions for a.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

Lab Task # 2:: To Plot CT Oscillatory Signal

The document contains code to plot an oscillatory signal for three cases: (1) when a is negative, (2) when a is positive, and (3) when a is zero. For each case, the code generates the oscillatory signal as the product of an exponential function and a sine wave, plots the signal, and labels the x- and y-axes. The plots are displayed in three subplots to compare the signals under the different conditions for a.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

LAB TASK # 2 :: TO PLOT CT OSCILLATORY SIGNAL

% case-1 (a<0)
c=2;
a=-2;
f=50;
ph=0;
T=1/f;
t=0:T/100:50*T;
x1=c*exp(a*t);
x2=sin(2*pi*f*t + ph);
x=x1.*x2;
subplot(3,1,1);
plot(t,x,'r','linewidth',1.5);
xlabel('Time');
ylabel('Amplitude');
grid on;
title('Oscillatory signal');
% case-2 (a>0)
c=2;
a=2;
f=50;
ph=0;
T=1/f;
t=0:T/100:50*T;
x1=c*exp(a*t);
x2=sin(2*pi*f*t + ph);
x=x1.*x2;
subplot(3,1,2);
plot(t,x,'y','linewidth',1.5);
xlabel('Time');
ylabel('Amplitude');
grid on;
% case-3 (a=0)
c=2;
a=0;
f=50;
ph=0;
T=1/f;
t=0:T/100:50*T;
x1=c*exp(a*t);
x2=sin(2*pi*f*t + ph);
x=x1.*x2;
subplot(3,1,3);
plot(t,x,'g','linewidth',1.5);
xlabel('Time');
ylabel('Amplitude');
grid on;

OUTPUT
Oscillatory signal

Amplitude

2
1
0
-1
-2

0.1

0.2

0.3

0.4

0.5
Time

0.6

0.7

0.8

0.9

0.1

0.2

0.3

0.4

0.5
Time

0.6

0.7

0.8

0.9

0.1

0.2

0.3

0.4

0.5
Time

0.6

0.7

0.8

0.9

Amplitude

20
10
0
-10
-20

Amplitude

2
1
0
-1
-2

You might also like