In: Electrical Engineering
Using Matlab, write code to generate Three signal components
Hello,
Please find the answer attached below. If the answer has helped you
please give a thumbs up rating. Thank you and have
a nice day!
*********** Matlab Code **********
fs = 10000;
Ts = 1/fs;
t = 0:Ts:499*Ts; % 500 points for time
x1 = sin(2*pi*25*t) + 2*sin(2*pi*40*t+0.8) +
1.5*sin(2*pi*75*t);
x2 = 2.5*sin(2*pi*600*t + 1.5) + sin(2*pi*730*t) +
1.5*sin(2*pi*800*t);
x3 = 0.8*sin(2*pi*3500*t) + sin(2*pi*4000*t) +
1.5*sin(2*pi*4200*t);
%% plotting
subplot(3,1,1);
plot(t,x1,'LineWidth',2);
grid;
xlabel('Time(s)');
ylabel('Amplitude');
title('X1');
subplot(3,1,2);
plot(t,x2,'LineWidth',2);
grid;
xlabel('Time(s)');
ylabel('Amplitude');
title('X2');
subplot(3,1,3);
plot(t,x3,'LineWidth',2);
grid;
xlabel('Time(s)');
ylabel('Amplitude');
title('X3');
********** Output **********
*************************************************************
PS: Please do not forget the thumbs
up!!