Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Matlab t = (-.00025: .00025: 100000); A1 = 29; A2 = 1.2*A1; t1 = (37.2/2)*.00025

ID: 3792241 • Letter: M

Question

Matlab

t = (-.00025: .00025: 100000);

A1 = 29;

A2 = 1.2*A1;

t1 = (37.2/2)*.00025;

t2 = -(41.3/10)*.00025;

x1 = A1*co(2*pi*(4000)*(t-t1));

x2 = A2*co(2*pi*(4000)*(t-t2));

x3 = x1 + x2;

(a) Write one line of MATLAB code that will generate values of the sinusoid x1(t) above by using
the complex-amplitude representation:
x1(t) = Re{Xe^jt}
(b) Write one line of MATLAB code that will calculate the magnitude of the sinusoid that is the
given by
x4(t) = x1(t) 2x2(t)
and write one line of MATLAB code that will calculate the phase of x4(t).

Explanation / Answer

if true % code end A1=18; A2=1.2*18; f = 4000; % sinusoid freq T = 1/f; % period fs = T/25; % time step tt = -T:fs:T; % time vector tm1=(37.2/11)*T; tm2=-(41.3/27)*T; X1=A1*cos(2*pi*(4000))*(tt-tm1); subplot(3,1,1); plot(tt,X1),grid on title('Sinusoid #1') hold on X2=A2*cos(2*pi*(4000))*(tt-tm2); subplot(3,1,2) plot(tt,X2),grid on