2.2 HW2

  2.2.1 Problem 1
  2.2.2 Problem 2
PDF (letter size)
PDF (legal size)

2.2.1 Problem 1

pict

Period is \(\tau \). This is not even and not odd. The first step is to determine the function \(x\left ( t\right ) \). This is truncated \(\sin \). Therefore we see that, over first period

\[ x\left ( t\right ) =\left \{ \begin{array} [c]{ccc}A\sin \left ( \frac{2\pi }{\tau }t\right ) & & 0\leq t\leq \frac{\tau }{2}\\ 0 & & \frac{\tau }{2}<t\leq \tau \end{array} \right . \]

This repeated over each period by shifting it. Now that we know \(x\left ( t\right ) \) we can find \(a_{0},a_{n},b_{n}\) and plot the approximation for larger \(n\)

\begin{align*} a_{0} & =\frac{1}{\frac{\tau }{2}}\int _{-\frac{\tau }{2}}^{\frac{\tau }{2}}x\left ( t\right ) dt\\ & =\frac{2}{\tau }\int _{0}^{\frac{\tau }{2}}x\left ( t\right ) dt\\ & =\frac{2}{\tau }\int _{0}^{\frac{\tau }{2}}A\sin \left ( \frac{2\pi }{\tau }t\right ) dt\\ & =-\frac{2}{\tau }\frac{A}{\frac{2\pi }{\tau }}\left [ \cos \left ( \frac{2\pi }{\tau }t\right ) \right ] _{0}^{\frac{\tau }{2}}\\ & =-\frac{A}{\pi }\left [ \cos \left ( \frac{2\pi }{\tau }\frac{\tau }{2}\right ) -1\right ] \\ & =-\frac{A}{\pi }\left [ \cos \left ( \pi \right ) -1\right ] \end{align*}

Hence

\[ a_{0}=\frac{2A}{\pi }\]

Finding \(a_{n}\)

\begin{align*} a_{n} & =\frac{1}{\frac{\tau }{2}}\int _{-\frac{\tau }{2}}^{\frac{\tau }{2}}x\left ( t\right ) \cos \left ( \frac{2\pi }{\tau }nt\right ) dt\\ & =\frac{2}{\tau }\int _{0}^{\frac{\tau }{2}}x\left ( t\right ) \cos \left ( \frac{2\pi }{\tau }nt\right ) dt\\ & =\frac{2}{\tau }\int _{0}^{\frac{\tau }{2}}A\sin \left ( \frac{2\pi }{\tau }t\right ) \cos \left ( \frac{2\pi }{\tau }nt\right ) dt \end{align*}

But \(\sin \left ( u\right ) \cos \left ( v\right ) =\frac{1}{2}\left ( \sin \left ( u+v\right ) +\sin \left ( u-v\right ) \right ) \), therefore the above integral becomes

\begin{align} a_{n} & =\frac{2A}{\tau }\left ( \frac{1}{2}\int _{0}^{\frac{\tau }{2}}\sin \left ( \frac{2\pi }{\tau }t+\frac{2\pi }{\tau }nt\right ) dt+\frac{1}{2}\int _{0}^{\frac{\tau }{2}}\sin \left ( \frac{2\pi }{\tau }t-\frac{2\pi }{\tau }nt\right ) dt\right ) \nonumber \\ & =\frac{A}{\tau }\left ( \int _{0}^{\frac{\tau }{2}}\sin \left ( \frac{2\pi }{\tau }\left ( 1+n\right ) t\right ) dt+\int _{0}^{\frac{\tau }{2}}\sin \left ( \frac{2\pi }{\tau }\left ( 1-n\right ) t\right ) dt\right ) \tag{1} \end{align}

The first integral above is \begin{align*} \int _{0}^{\frac{\tau }{2}}\sin \left ( \frac{2\pi }{\tau }\left ( 1+n\right ) t\right ) dt & =-\left [ \frac{\cos \left ( \frac{2\pi }{\tau }\left ( 1+n\right ) t\right ) }{\frac{2\pi }{\tau }\left ( 1+n\right ) }\right ] _{0}^{\frac{\tau }{2}}\\ & =\frac{-1}{\frac{2\pi }{\tau }\left ( 1+n\right ) }\left [ \cos \left ( \frac{2\pi }{\tau }\left ( 1+n\right ) \frac{\tau }{2}\right ) -1\right ] \\ & =\frac{-\tau }{2\pi \left ( 1+n\right ) }\left [ \cos \left ( \pi \left ( 1+n\right ) \right ) -1\right ] \end{align*}

For \(n=1,3,5,\cdots \) the above becomes zero. For \(n=2,4,6,\cdots \)

\begin{align} \int _{0}^{\frac{\tau }{2}}\sin \left ( \frac{2\pi }{\tau }\left ( 1+n\right ) t\right ) dt & =\frac{2\tau }{2\pi \left ( 1+n\right ) }\nonumber \\ & =\frac{\tau }{\pi \left ( 1+n\right ) }\qquad n=2,4,6,\cdots \tag{2} \end{align}

The second integral in (1) is

\[ \int _{0}^{\frac{\tau }{2}}\sin \left ( \frac{2\pi }{\tau }\left ( 1-n\right ) t\right ) dt=-\left [ \frac{\cos \left ( \frac{2\pi }{\tau }\left ( 1-n\right ) t\right ) }{\frac{2\pi }{\tau }\left ( 1-n\right ) }\right ] _{0}^{\frac{\tau }{2}}\]

But this is undefined for \(n=1\), since denominator is zero. Hence we need to handle \(n=1\) first on its own. At \(n=1\,\), since \(\sin \left ( 0\right ) =0\) then

\begin{equation} \int _{0}^{\frac{\tau }{2}}\sin \left ( \frac{2\pi }{\tau }\left ( 1-n\right ) t\right ) dt=0 \tag{3} \end{equation}

For \(n>1\)

\begin{align*} \int _{0}^{\frac{\tau }{2}}\sin \left ( \frac{2\pi }{\tau }\left ( 1-n\right ) t\right ) dt & =-\left [ \frac{\cos \left ( \frac{2\pi }{\tau }\left ( 1-n\right ) t\right ) }{\frac{2\pi }{\tau }\left ( 1-n\right ) }\right ] _{0}^{\frac{\tau }{2}}\\ & =\frac{-1}{\frac{2\pi }{\tau }\left ( 1-n\right ) }\left [ \cos \left ( \frac{2\pi }{\tau }\left ( 1-n\right ) \frac{\tau }{2}\right ) -1\right ] \\ & =\frac{-1}{\frac{2\pi }{\tau }\left ( 1-n\right ) }\left [ \cos \left ( \pi \left ( 1-n\right ) \right ) -1\right ] \\ & =\frac{1}{\frac{2\pi }{\tau }\left ( n-1\right ) }\left [ \cos \left ( \pi \left ( n-1\right ) \right ) -1\right ] \end{align*}

For \(n=2,4,6,\cdots \)

\begin{equation} \int _{0}^{\frac{\tau }{2}}\sin \left ( \frac{2\pi }{\tau }\left ( 1-n\right ) t\right ) dt=\frac{-2}{\frac{2\pi }{\tau }\left ( n-1\right ) }=\frac{-\tau }{\pi \left ( n-1\right ) } \tag{4} \end{equation}

For \(n=3,5,7,\cdots \) the integral is zero. Using result in (2,3,4) in (1) gives final result

\[ a_{n}=\left \{ \begin{array} [c]{ccc}\frac{A}{\tau }\left ( \frac{\tau }{\pi \left ( 1+n\right ) }+\frac{-\tau }{\pi \left ( n-1\right ) }\right ) & & n=2,4,6,\cdots \\ 0 & & \text{otherwise}\end{array} \right . \]

Or

\[ a_{n}=\left \{ \begin{array} [c]{ccc}A\left ( \frac{\left ( n-1\right ) -\left ( 1+n\right ) }{\pi \left ( 1+n\right ) \left ( n-1\right ) }\right ) & & n=2,4,6,\cdots \\ 0 & & \text{otherwise}\end{array} \right . \]

Or

\[ a_{n}=\left \{ \begin{array} [c]{ccc}A\left ( \frac{n-1-1-n}{\pi \left ( 1+n\right ) \left ( n-1\right ) }\right ) & & n=2,4,6,\cdots \\ 0 & & \text{otherwise}\end{array} \right . \]

Or

\begin{equation} a_{n}=\left \{ \begin{array} [c]{ccc}A\left ( \frac{-2}{\pi \left ( 1+n\right ) \left ( n-1\right ) }\right ) & & n=2,4,6,\cdots \\ 0 & & \text{otherwise}\end{array} \right . \tag{5} \end{equation}

Finding \(b_{n}\)

\begin{align*} b_{n} & =\frac{1}{\frac{\tau }{2}}\int _{-\frac{\tau }{2}}^{\frac{\tau }{2}}x\left ( t\right ) \sin \left ( \frac{2\pi }{\tau }nt\right ) dt\\ & =\frac{2}{\tau }\int _{0}^{\frac{\tau }{2}}x\left ( t\right ) \sin \left ( \frac{2\pi }{\tau }nt\right ) dt\\ & =\frac{2}{\tau }\int _{0}^{\frac{\tau }{2}}A\sin \left ( \frac{2\pi }{\tau }t\right ) \sin \left ( \frac{2\pi }{\tau }nt\right ) dt \end{align*}

But \(\sin \left ( u\right ) \sin \left ( v\right ) =\frac{1}{2}\left ( \cos \left ( u-v\right ) -\cos \left ( u+v\right ) \right ) \), therefore the above integral becomes

\begin{align} a_{n} & =\frac{2A}{\tau }\left ( \frac{1}{2}\int _{0}^{\frac{\tau }{2}}\cos \left ( \frac{2\pi }{\tau }t-\frac{2\pi }{\tau }nt\right ) dt-\frac{1}{2}\int _{0}^{\frac{\tau }{2}}\cos \left ( \frac{2\pi }{\tau }t+\frac{2\pi }{\tau }nt\right ) dt\right ) \nonumber \\ & =\frac{A}{\tau }\left ( \int _{0}^{\frac{\tau }{2}}\cos \left ( \frac{2\pi }{\tau }\left ( 1-n\right ) t\right ) dt-\int _{0}^{\frac{\tau }{2}}\cos \left ( \frac{2\pi }{\tau }\left ( 1+n\right ) t\right ) dt\right ) \tag{6} \end{align}

For the first integral

\[ \int _{0}^{\frac{\tau }{2}}\cos \left ( \frac{2\pi }{\tau }\left ( 1-n\right ) t\right ) dt=\left ( \frac{\sin \frac{2\pi }{\tau }\left ( 1-n\right ) t}{\frac{2\pi }{\tau }\left ( 1-n\right ) }\right ) _{0}^{\frac{\tau }{2}}\]

But this is undefined for \(n=1\), since denominator is zero. Hence we need to handle \(n=1\) first on its own. At \(n=1\,\), since \(\cos \left ( 0\right ) =1\) then

\begin{equation} \int _{0}^{\frac{\tau }{2}}\cos \left ( \frac{2\pi }{\tau }\left ( 1-n\right ) t\right ) dt=\int _{0}^{\frac{\tau }{2}}dt=\frac{\tau }{2} \tag{7} \end{equation}

Now for \(n>1\)

\begin{align*} \int _{0}^{\frac{\tau }{2}}\cos \left ( \frac{2\pi }{\tau }\left ( 1-n\right ) t\right ) dt & =\left ( \frac{\sin \left ( \frac{2\pi }{\tau }\left ( 1-n\right ) t\right ) }{\frac{2\pi }{\tau }\left ( 1-n\right ) }\right ) _{0}^{\frac{\tau }{2}}\\ & =\frac{\tau }{2\pi \left ( 1-n\right ) }\left ( \sin \left ( \frac{2\pi }{\tau }\left ( 1-n\right ) t\right ) \right ) _{0}^{\frac{\tau }{2}}\\ & =\frac{\tau }{2\pi \left ( 1-n\right ) }\left ( \sin \left ( \frac{2\pi }{\tau }\left ( 1-n\right ) \frac{\tau }{2}\right ) -0\right ) \\ & =\frac{\tau }{2\pi \left ( 1-n\right ) }\left ( \sin \left ( \pi \left ( 1-n\right ) \right ) -0\right ) \end{align*}

Which is zero for all \(n\). For the second integral in (6)

\begin{align*} \int _{0}^{\frac{\tau }{2}}\cos \left ( \frac{2\pi }{\tau }\left ( 1+n\right ) t\right ) & =\left ( \frac{\sin \left ( \frac{2\pi }{\tau }\left ( 1+n\right ) t\right ) }{\frac{2\pi }{\tau }\left ( 1+n\right ) }\right ) _{0}^{\frac{\tau }{2}}\\ & =\frac{\tau }{2\pi \left ( 1+n\right ) }\left ( \sin \left ( \frac{2\pi }{\tau }\left ( 1+n\right ) t\right ) \right ) _{0}^{\frac{\tau }{2}}\\ & =\frac{\tau }{2\pi \left ( 1+n\right ) }\left ( \sin \left ( \frac{2\pi }{\tau }\left ( 1+n\right ) \frac{\tau }{2}\right ) -0\right ) \\ & =\frac{\tau }{2\pi \left ( 1+n\right ) }\left ( \sin \left ( \pi \left ( 1+n\right ) \right ) -0\right ) \end{align*}

Which is zero for all \(n\). Hence for \(b_{n}\) we have one term only

\[ b_{n}=\left \{ \begin{array} [c]{ccc}\frac{A}{2} & & n=1\\ 0 & & n=2,3,\cdots \end{array} \right . \]

Therefore the Fourier series approximation is

\begin{align*} x\left ( t\right ) & =\overset{\frac{a_{0}}{2}}{\overbrace{\frac{A}{\pi }}}+\overset{b_{1}}{\overbrace{\frac{A}{2}\sin \left ( \frac{2\pi }{\tau }t\right ) }}+{\displaystyle \sum \limits _{n=2,4,6,\cdots }^{\infty }} \overset{a_{n}}{\overbrace{A\left ( \frac{-2}{\pi \left ( 1+n\right ) \left ( n-1\right ) }\right ) }}\cos \left ( \frac{2\pi }{\tau }nt\right ) \\ & =\frac{A}{\pi }+\frac{A}{2}\sin \left ( \frac{2\pi }{\tau }t\right ) -\frac{2A}{\pi }{\displaystyle \sum \limits _{n=2,4,6,\cdots }^{\infty }} \frac{1}{\left ( 1+n\right ) \left ( n-1\right ) }\cos \left ( \frac{2\pi }{\tau }nt\right ) \end{align*}

Therefore \[ x\left ( t\right ) =\frac{A}{\pi }+\frac{A}{2}\sin \left ( \frac{2\pi }{\tau }t\right ) -\frac{2A}{\pi }{\displaystyle \sum \limits _{n=2,4,6,\cdots }^{\infty }} \frac{1}{\left ( 1+n\right ) \left ( n-1\right ) }\cos \left ( \frac{2\pi }{\tau }nt\right ) \]

To verify this result, the following is a plot of increasing \(n\), using \(A=2\) and \(\tau =1\) with the approximation superimposed on top of \(x\left ( t\right ) \). We notice that small number of terms is needed in this case to obtain a good approximation.

pict

pict

pict

pict

2.2.2 Problem 2

pict

The function to approximate is defined as

\[ y\left ( t\right ) =\left \{ \begin{array} [c]{ccc}A & & 0\leq t\leq \pi \\ -A & & \pi <t\leq 2\pi \end{array} \right . \]

With period \(\tau =2\pi \). This function is odd.

\begin{align*} c_{n} & =\frac{1}{\tau }\int _{-\frac{\tau }{2}}^{\frac{\tau }{2}}y\left ( t\right ) e^{-j\frac{2\pi }{\tau }nt}dt=\frac{1}{\tau }\int _{0}^{\tau }y\left ( t\right ) e^{-j\frac{2\pi }{\tau }nt}dt\\ & =\frac{1}{\tau }\left ( \int _{0}^{\pi }Ae^{-j\frac{2\pi }{\tau }nt}dt-\int _{\pi }^{2\pi }Ae^{-j\frac{2\pi }{\tau }nt}dt\right ) \\ & =\frac{A}{\tau }\left ( \left [ \frac{e^{-j\frac{2\pi }{\tau }nt}}{-j\frac{2\pi }{\tau }n}\right ] _{0}^{\pi }-\left [ \frac{e^{-j\frac{2\pi }{\tau }nt}}{-j\frac{2\pi }{\tau }n}\right ] _{\pi }^{2\pi }\right ) \\ & =\frac{A}{\tau }\left ( \frac{-1}{j\frac{2\pi }{\tau }n}\left [ e^{-j\frac{2\pi }{\tau }nt}\right ] _{0}^{\pi }+\frac{1}{j\frac{2\pi }{\tau }n}\left [ e^{-j\frac{2\pi }{\tau }nt}\right ] _{\pi }^{2\pi }\right ) \\ & =\frac{A}{\tau }\frac{\tau }{j2\pi n}\left ( -\left [ e^{-j\frac{2\pi }{\tau }nt}\right ] _{0}^{\pi }+\left [ e^{-j\frac{2\pi }{\tau }nt}\right ] _{\pi }^{2\pi }\right ) \end{align*}

But \(\tau =2\pi \) and the above simplifies to

\begin{align} c_{n} & =\frac{A}{j2\pi n}\left ( -\left [ e^{-jnt}\right ] _{0}^{\pi }+\left [ e^{-jnt}\right ] _{\pi }^{2\pi }\right ) \nonumber \\ & =\frac{A}{j2\pi n}\left ( \left [ 1-e^{-jn\pi }\right ] +\left [ e^{-j2n\pi }-e^{-jn\pi }\right ] \right ) \tag{1} \end{align}

But \begin{align*} e^{-jn\pi } & =\cos n\pi -j\sin n\pi \\ & =\cos n\pi \end{align*}

And \begin{align*} e^{-j2n\pi } & =\cos 2n\pi -j\sin 2n\pi \\ & =1 \end{align*}

Hence (1) becomes

\begin{align*} c_{n} & =\frac{A}{j2\pi n}\left ( \left [ 1-\cos n\pi \right ] +\left [ 1-\cos n\pi \right ] \right ) \\ & =\frac{A}{j\pi n}\left ( 1-\cos n\pi \right ) \end{align*}

For \(n\) odd \(\cos n\pi =-1\) and the above becomes

\[ c_{n}=\frac{2A}{j\pi n}\]

For \(n\) even \(\cos n\pi =1\) and \(c_{n}=0\) in this case. Therefore the approximation is

\begin{align} y\left ( t\right ) & \approx \sum _{n=\cdots -3,-1,1,3,\cdots }^{\infty }c_{n}e^{j2nt}\nonumber \\ & =\frac{2A}{j\pi }\sum _{n=\cdots -3,-1,1,3,\cdots }^{\infty }\frac{1}{n}e^{j2nt} \tag{2} \end{align}

We can now obtain the standard form of the series if needed. \(c_{-n}=c_{n}^{\ast }=\frac{2A}{-j\pi n}\) and hence

\begin{align*} a_{n} & =c_{n}+c_{-n}\\ & =0 \end{align*}

All \(a_{n}=0\), as expected, since this is an odd function.

\begin{align*} b_{n} & =j\left ( c_{n}-c_{-n}\right ) \\ & =j\left ( \frac{2A}{j\pi n}-\frac{2A}{-j\pi n}\right ) \\ & =j\left ( \frac{4A}{j\pi n}\right ) \\ & =\frac{4A}{\pi n} \end{align*}

Hence

\begin{equation} y\left ( t\right ) \approx \frac{4A}{\pi }\sum _{n=1,3,5,\cdots }^{\infty }\frac{1}{n}\sin \left ( nt\right ) \tag{3} \end{equation}

Both (2) and (3) are the same. (2) is complex form of (3).  To see the approximation, here are some plots with increasing number of terms for \(A=1\)

pict

pict

pict

pict

pict

pict