You are on page 1of 1

LAB TASK # 1 :: TO PLOT A CT SINUSOID

% part-1
c =5;
f=1000;
ph=pi/4
T=1/f;
t=0:T/100:2*T;
x=c*sin(2*pi*f*t + ph);
figure(1);
plot(t,x,'linewidth',2);
title('Sine Wave');
xlabel('Time');
ylabel('Amplitude');
grid on;
% part-2
c=5;
f=1000;
ph=-pi/2;
T=1/f;
t=0:T/100:2*T;
x=c*cos(2*pi*f*t + ph);
figure(2);
plot(t,x,'linewidth',2);
title('Cosine Wave');
xlabel('Time');
ylabel('Amplitude');
grid on;
Sine Wave
5

Amplitude

Amplitude

Cosine Wave
5

0
-1

0
-1

-2

-2

-3

-3

-4

-4

-5

0.2

0.4

0.6

0.8

1
Time

1.2

1.4

1.6

1.8

2
-3

x 10

-5

0.2

0.4

0.6

0.8

1
Time

1.2

1.4

1.6

1.8

2
-3

x 10

You might also like