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

Write a MATLAB script that plots one cycle of the waveform given below, beginnin

ID: 2291176 • Letter: W

Question

Write a MATLAB script that plots one cycle of the waveform given below, beginning at t-0. The width should be 3, and the plot must have a title, labels for the x- and y-axes, and a grid. The font for text be 20. The created figure should appear as shown below. The waveform to be plotted is w(t) = 2 + 2cos(2m+) + cos(10mtr) One Cycle of w(t) 5 4 -1 0.1 0.2 0.3 04 0.50.6 0.7 0.8 0.9 Time [sec Write a MATLAB function that uses the Riemann sum approach to estimate the Fourier series coefficients for w(t). Specifically, the function should accept the number of strips, N, as input, and output an array containing the Fourier series coefficients (DC plus the first 6 harmonics). The array must be organized as: Given the above requirements, the syntax for calling the function should be: a-Fourier Series Approx (N) Using your software, evaluate the Fourier series coefficients using 5, 10, 20, and 100 rectangular strips (over one period), and compare each result to the analytical values.

Explanation / Answer

%% Part 1: For plotting a signal

clc;clear;
t = 0:0.001:1;
w_t = 2+ 2*cos(2*pi*t+(pi/4))+cos(10*pi*t-(pi/3));
plot(t,w_t)
title 'One Cycle if w(t)'
xlabel 'Time[Sec]'
ylabel 'Amplitude'
grid on

%-------------------------------------------

Code for Fourier_Seriese_Approx.m

----------------------------------------------------

function [ a ] = Fourier_Seriese_Approx( N )
a = zeros(1,7);
for k = -3: 1 : 3;
for n = 1:1:N
a(k+4) = a(k+4) + exp(-1i*2*pi*n/N);
end;
end
end

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote