Question
Filename: MAE1090_HW8_2.m A Fourier series representation for a square wave, with frequency ??0, is given by the following infinite summation: ??(??) = 4 ?? sin(2??
Filename: MAE1090_HW8_2.m A Fourier series representation for a square wave, with frequency ??0, is given by the following infinite summation: ??(??) = 4 ?? sin(2?? ? ??0??) + 4 3?? sin(2?? ? 3??0??) + 4 5?? sin(2?? ? 5??0??) + 4 7?? sin(2?? ? 7??0??) + 4 9?? sin(2?? ? 9??0??) + 4 11?? sin(2?? ? 11??0??) + ? Note, the above equation assumes time in units of seconds and frequency in units of Hertz. Write an m-file that computes the summation shown above, truncated after different numbers of terms. The truncated series provides an approximation of the square wave function. ? Set the fundamental frequency to ??0 = 500??????. ? Use a for loop to calculate and store the summation, truncated after 1, 2, 3, 4, and 5 terms. That is, compute five separate vectors, each the same length as the time vector, each including a different number of terms from the Fourier series. ? Compute each of the truncated series over a time range of 0 ? ?? ? 4????????. ? Store each resulting vector as a row in a matrix, f. This matrix should, therefore, have dimensions 5 length(t). ? So, for example, the second row in f should include the first two terms of the series and be computed using the following function: ??(??) = 4 ?? sin(2?? ? ??0??) + 4 3?? sin(2?? ? 3??0??) ? Plot rows 2 5 of the matrix f in subplots 1 4 of a 2 x 2 subplot grid. ? Plot each function versus time in microseconds (not seconds), as shown below. ? The title of each subplot should indicate the number of terms used in each truncated series approximation, as shown below. ? Your plot should look exactly like the following plot:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started