40.8k views
3 votes
Given three sinusoids with the following amplitude and phases:

x1(t)=5cos(2π(500)t)
x2(t)=5cos(2π(1200)t+0.25π)
x3(t)=5cos(2(1800)t+0.5π)
a. Create a MATLAB program to sample each sinusoid and generate a sum of three sinusoids, that is, x(n)=x1(n)+x2(n)+x3(n), using a sampling rate of 8000 Hz, and plot the sum x(n) over a range of time that will exhibit approximately 0.1 second.

User Raumus
by
7.4k points

1 Answer

4 votes

Final answer:

To create a MATLAB program to sample each sinusoid and generate the sum of three sinusoids, you need to define the sampling rate, calculate the values of the sinusoids at each time sample, add up the values of the three sinusoids, and plot the sum sinusoid over the desired time range.

Step-by-step explanation:

To create a MATLAB program to sample each sinusoid and generate the sum of three sinusoids, you will first define the sampling rate, which in this case is 8000 Hz. Then, you can use the given amplitude and phases of each sinusoid to calculate the values of the sinusoids at each time sample. Finally, you can add up the values of the three sinusoids at each time sample to obtain the sum sinusoid and plot it over the desired time range.

Here is a MATLAB code example:

t = 0:1/8000:0.1; % time range from 0 to 0.1 seconds
x1 = 5 * cos(2*pi*500*t);
x2 = 5 * cos(2*pi*1200*t + 0.25*pi);
x3 = 5 * cos(2*pi*1800*t + 0.5*pi);
x = x1 + x2 + x3;
plot(t, x);
xlabel('Time (s)');
ylabel('Sum Sinosoid x(t)');
title('Sum of Three Sinusoids');
User Artyom Degtyarev
by
7.2k points