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

Please answer MATLAB questions with MATLAB code. Others by hand. Consider the si

ID: 3736504 • Letter: P

Question

Please answer MATLAB questions with MATLAB code. Others by hand.

Consider the signal below, periodic with period T-2. 1 Kt1. f(t)enutdt, n-0,1, +2, (a) Find the real Fourier coefficients an, bn You may use your knowledge of cn to do this, without integrating. Alternatively, you may choose instead to find an and bn by integration, and use this knowledge to find c (b) Find the average energy of f over one period; that is, compute TJ-T/2 (c) Use Parseval's identity to answer the following question: How many terms do we need to add in the Fourier series in order to approximate f, with at least 99% of the (average) energy of f being present in the approximation? Justify. (This can, and should, be done using MATLAB. Include your code in the answer.) (d) Use MATLAB to plot, on the same graph, both f and the approximation obtained in the last item. (e) Draw an accurate picture of the (complex) amplitude spectrum of f, containing at least the first 5 frequencies. For full marks you will need to label all axes correctly, making clear which angular frequencies are present in this signal.

Explanation / Answer

First, we need to define the function after observing the graph:

displaystyle f{{left({t} ight)}}={leftlbraceegin{matrix}-{3}&&-pi{left.le ight.}{t}<{0}\{3}&&{0}{left.le ight.}{t}<piend{matrix} ight.}f(t)={33t<00t<

We can see from the graph that it is periodic, with period displaystyle{2}pi2.

So displaystyle f{{left({t} ight)}}= f{{left({t}+{2}pi ight)}}f(t)=f(t+2).

Also, displaystyle{L}=piL=.

We can also see that it is an odd function, so we know displaystyle{a}_{{0}}={0}a0=0 and displaystyle{a}_{{n}}={0}an=0. So we will only need to find bn.

Since displaystyle{L}=piL=, the necessary formulae become:

displaystyle{b}_{{n}}= rac{1}{pi}{int_{{-pi}}^{pi}} f{{left({t} ight)}} sin{{n}}{t} {left.{d}{t} ight.}bn=1f(t)sinnt dt

displaystyle f{{left({t} ight)}}={sum_{{{n}={1}}}^{infty}}{b}_{{n}} sin{{n}}{t}f(t)=n=1bnsinnt

Now

displaystyle{b}_{{n}}= rac{1}{pi}{int_{{-pi}}^{pi}} f{{left({t} ight)}} sin{{n}}{t} {left.{d}{t} ight.}bn=1f(t)sinnt dt

displaystyle= rac{1}{pi}{left({int_{{-pi}}^{{0}}}-{3} sin{{n}}{t} {left.{d}{t} ight.} ight.}=1(03 sinnt dt displaystyle{left.+{int_{{0}}^{pi}}{3} sin{{n}}{t} {left.{d}{t} ight.} ight)}+03 sinnt dt)

displaystyle= rac{3}{pi}{left({{left[ rac{{ cos{{n}}{t}}}{{n}} ight]}_{{-pi}}^{{0}}}+{{left[- rac{{ cos{{n}}{t}}}{{n}} ight]}_{{0}}^{pi}} ight)}=3([ncosnt]0+[ncosnt]0)

displaystyle= rac{3}{{pi{n}}}{left( cos{{0}}- cos{{left(-pi{n} ight)}} ight.}=n3(cos0cos(n) displaystyle- cos{{n}}picosn displaystyle{left.+ cos{{0}} ight)}+cos0)

displaystyle= rac{3}{{pi{n}}}{left({2}- cos{pi}{n}- cos{pi}{n} ight)}=n3(2cosncosn)

displaystyle= rac{6}{{pi{n}}}{left({1}- cos{pi}{n} ight)}=n6(1cosn)

displaystyle= rac{12}{{pi{n}}} {left({n} ext{odd} ight)}{quad ext{or}quad}=n12 (n odd)or

displaystyle={0} {left({n} ext{even} ight)}=0 (n even)

We could write this as: displaystyle{b}_{{n}}= rac{12}{{pi{left({2}{n}-{1} ight)}}} {n}={1},{2},{3}ldotsbn=(2n1)12  n=1,2,3… (Substitute displaystyle{n}={1},{2},{3}ldotsn=1,2,3… to see how this works.)

So the Fourier series for our odd function is given by:

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