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?
Asked
Active
Viewed 4,470 times
1
-
What is this number you're calling $T$? The period of $t\mapsto A\sin(wt)$ is $2\pi/w$, and the period of $t\mapsto|A\sin(wt)|$ is $\pi/w$. – Michael Hardy Jun 10 '13 at 03:15
-
the period $T=pi/w$. – Bill Skiadas Jun 10 '13 at 03:16
-
Is there any change you saw $\sin(\omega t)$ and copied it as $\sin(wt)$? In some fields, notably electrical engineering, the letter $\omega$ is often used for frequency. – Michael Hardy Jun 10 '13 at 03:16
-
In this case the letter $w$ stands for angular frequency. For frequency i prefer to use $f$. – Bill Skiadas Jun 10 '13 at 03:20
-
@BillSkiadas Michael's point is that the letter "double u" is not the same as the letter "omega", that is, $w\neq\omega$. – Jun 10 '13 at 14:40
-
I got it. Thanks for the tip. I'll be more careful next time. – Bill Skiadas Jun 11 '13 at 00:43
1 Answers
0
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:

ˈjuː.zɚ79365
- 3,004
-
-
@BillSkiadas There is $(-1)^n+1$ in the formula for $c_n$. This is zero when $n$ is odd, and $2$ when $n$ is even. I decided to save the computer the trouble of multiplying things by zero. This is why I replaced $n$ with $2k$ in my Sage command. – ˈjuː.zɚ79365 Jun 11 '13 at 13:22