Lab Task # 2:: To Plot CT Oscillatory Signal
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