Fourier expansion of a piecewise function and writing the result as a summation?

41 Views Asked by At

I have been trying to find the fourier expansion of the below piecewise function but I'm a bit stuck. I've been able to determine its an odd function and have therefore calculated the odd coefficients , but writing the result in a summation format has me confused.

$$f(x)=\begin{cases}1+x/\pi& -\pi\le x<0 \\ 1-x/\pi & 0\le x\le\pi\end{cases} $$

I found the odd coefficients to be :

$\dfrac4{\pi^2(2n-1)^2}$

And I also worked out the first term of the expansion will be $1/2$.

Any help will be appreciated.

1

There are 1 best solutions below

0
On

Okay. Your function is \begin{align} f(x) = \begin{cases} 1-\frac{x}{\pi}, & x\in[0,\pi)\\ 1+\frac{x}{\pi}, &x\in(-\pi,0] \end{cases} \end{align} This is an example of a sawtooth function. We have \begin{align} \hat f[k] = \frac{1}{{2\pi}} \int_{x=-\pi}^{\pi} \exp(-i kx)f(x) \, \mathrm dx, \end{align} which concludes \begin{align} \hat f[k] &= \frac1\pi \Re\left(\int_{x=0}^\pi \frac{x}{\pi}\cdot \exp(-i k x) \, \mathrm dx\right) + \delta_{k,0}\\ &= \frac1{\pi^2}\, \frac{1}{k^2} \Re\left( \int_{0}^{k\pi} y\exp(-iy) \, \mathrm dy\right) + \delta_{k,0} \end{align} Using $\int_{0}^{k\pi} y\exp(-iy) \, \mathrm dy = iy\exp(-iy)|_{0}^{k\pi}-i\int_{0}^{k\pi} \exp(-iy)\mathrm dy=i(-1)^{k}k\pi + (-1)^{k}-1$, we get $$ \hat f[k] = \begin{cases} 1, & k=0\\ -\frac{2}{\pi^2 k^2} , &k\in\mathrm{odd}\\ 0, & \mathrm{otherwise} \end{cases} $$ for