Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using MATLAB and the matlab template below provided please write a code for this problem : The equation from the link : Template: %Create the

Using MATLAB and the matlab template below provided please write a code for this problem:

The equation from the link :image text in transcribed

image text in transcribed

Template:

%Create the vector of t values %Use array operations to calculate the three approximations and the %exact function as given in the assignment

%If using the checker, store the results in these variables

t = [];

y1 = []; y2 = []; y3 = []; y_exact =[];

%Plot all four functions on the same graph; add all necessary annotations

(= {4, 147, 2T(t) = 10. \t\ > IA. 4. Harmonic Analysis A fundamental technique of engineering analysis is Fourier decomposition - representing a periodic function as a sum of sine or cosine functions at multiples of the fundamental frequency. For example, a periodic square wave can be written as a sum of cosines as shown here. Using the cosine series given in the link, calculate the first five non-zero terms (including the DC term) of the series for 50 % duty cycle over the domain t = [-2 , 2 T], taking 0. = 1 and A = 1. Choose the step size so that you get a smooth plot (see plotting instructions below). Create one graph containing plots of: a. The fundamental term +DC offset (= 0.5) b. The sum of the first 3 terms (DC, fundamental, and 3rd harmonic) C. The sum of the first 5 terms (DC, fundamental, 3rd, 5th and 7th harmonic) d. The exact function, which can be calculated using the MATLAB built-in function square () as follows: Yuexact = 0.5+square (x + pi/2)/2; You can use the app on the linked web page to check that your plotted functions are correct. . For all assignments, always follow good graphing practices, including: a. Distinguish each series clearly (i.e., with different line types, and don't forget to include a legend). b. Title your plot. Note: your title should be more informative than simply Y vs X. C. Label all axes with a name and units. (When there are no units, indicate 'unitless'). For this particular problem, assume that the time unit is milliseconds, and the amplitude unit is centimeters. (= {4, 147, 2T(t) = 10. \t\ > IA. 4. Harmonic Analysis A fundamental technique of engineering analysis is Fourier decomposition - representing a periodic function as a sum of sine or cosine functions at multiples of the fundamental frequency. For example, a periodic square wave can be written as a sum of cosines as shown here. Using the cosine series given in the link, calculate the first five non-zero terms (including the DC term) of the series for 50 % duty cycle over the domain t = [-2 , 2 T], taking 0. = 1 and A = 1. Choose the step size so that you get a smooth plot (see plotting instructions below). Create one graph containing plots of: a. The fundamental term +DC offset (= 0.5) b. The sum of the first 3 terms (DC, fundamental, and 3rd harmonic) C. The sum of the first 5 terms (DC, fundamental, 3rd, 5th and 7th harmonic) d. The exact function, which can be calculated using the MATLAB built-in function square () as follows: Yuexact = 0.5+square (x + pi/2)/2; You can use the app on the linked web page to check that your plotted functions are correct. . For all assignments, always follow good graphing practices, including: a. Distinguish each series clearly (i.e., with different line types, and don't forget to include a legend). b. Title your plot. Note: your title should be more informative than simply Y vs X. C. Label all axes with a name and units. (When there are no units, indicate 'unitless'). For this particular problem, assume that the time unit is milliseconds, and the amplitude unit is centimeters

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions