Pre Lab
Pre Lab
clc
clear all
close all
%Question 1
t = 0:0.0005:0.04;
amp = 3;
freq_HZ = 50;
freq_RPS = 2*pi*freq_HZ;
y1 = amp * sin(freq_RPS * t);
plot(t,y1)
grid
xlabel('Time (seconds)')
ylabel('y(t)')
title('SINE wave of 50HZ')
%Question 2
figure
t = 0:0.0005:0.04;
amp = 3;
freq_HZ = 50;
freq_RPS = 2*pi*freq_HZ;
y1 = amp * sin(freq_RPS * t);
plot(t,y1)
hold on
freq_HZ = 25;
freq_RPS = 2*pi*freq_HZ;
y2 = amp * sin(freq_RPS * t);
plot(t,y2)
xlabel('Time (seconds)')
ylabel('y(t)')
title('SINE wave of 25HZ and 50HZ')
legend('50 Hz','25 Hz')
grid
%Question 3
figure
t = 0:0.0005:0.04;
amp = 3;
freq_HZ = 25;
freq_RPS = 2*pi*freq_HZ;
y1 = amp * sin(freq_RPS * t);
y2 = amp * sin(freq_RPS * t + (2*pi)/3);
y3 = amp * sin(freq_RPS * t + (4*pi)/3);
plot(t,y1,'r',t,y2,'m',t,y3,'k')
xlabel('Time (seconds)')
ylabel('y(t)')
title('sine waves out of phase of 120
angle')
legend('0 angle','120 angle','240 angle')
grid