Fourier Series of mod sinx

294 Views Asked by At

The definition given on wikipedia for Fourier Coefficients is as follows:

$a_n=\frac{2}{P}\int_{P}^{} s(x)cos(\frac{2\pi xn}{P})dx$

where $P$= Period

Now, then while solving for Fourier series of $|sinx|$ I equated it to:

$\frac {a_o}{2} + \sum cos(\frac{2\pi xn}{P})dx$

Here, I got confused whether to take P as $\pi$ or $2\pi$ even when I know that the period of $|sinx|$ is $\pi$. This is is because most of the solution online equate the function to the series:

$\frac {a_o}{2} + \sum cos(nx)dx$ and then proceed while it should be $cos(2nx)$ according to me since period is $\pi$.

Also, in other places I have found the definiton as:

$a_n=\frac{2}{P}\int_{P}^{} s(x)cos(\frac{\pi xn}{P})dx$ which differs from wikipedia which has a 2 in the argument of $cos$.

What do I don't understand here?

1

There are 1 best solutions below

7
On

In general, and for a periodic function $\;f(x+2a)=f(x)\;$ defined on $\;[-a,a]\,,\,\,\,a\in (0,\infty)\;$, we get

$$f(x)\sim \frac{a_0}2+\sum_{n=1}^\infty a_n\cos\frac{n\pi x}L+b_n\sin\frac{n\pi x}L\;,\;\;L=a=\frac12\left|[-a,a]\right|\;$$

and

$$a_n=\frac1L\int_{-a}^a f(x)\cos\frac{n\pi x}L\,dx\;,\;\;a_n=\frac1L\int_{-a}^a f(x)\sin\frac{n\pi x}L\,dx$$