Fourier series of $|A\sin(wt)|$

4.4k Views Asked by At

I am having some trouble calculating the fourier series of $x(t)=|A\sin(wt)|$. I have thought that the period is $T'=\frac{T}{2}=\frac{\pi}{w}$ so the result that i ended up was $c[n]=\dfrac{-A}{\pi} \dfrac{(-1)^n+1}{(n+1)(n-1)}$ but i thing it's wrong. I tried ploting $x(t)$ using this $c[n]$ in Matlab for $n=25$, $50$ or $100$ but the results were "correct" only when i ploted using plot(A-abs(x)), otherwise there were upside down. Any suggestions?

1

There are 1 best solutions below

2
On BEST ANSWER

You messed up some factors of $2$: check the formula for cosine series.

I get the series $$\frac{2|A|}{\pi} -\frac{4|A|}{\pi} \sum_{n\ge 2, \text{ even}} \frac{1}{n^2-1}\cos nwt$$ With $A=1$ and $w=1$, the partial sum computed in Sage with

2/pi+sum([-4/(pi*((2*k)^2-1))*cos(2*k*x) for k in range(1,5)])

matched the function pretty well:

partial