Wikipedia:Reference desk/Archives/Mathematics/2022 January 21

= January 21 =

Where do $2⁄P$ in Fourier coefficients come from?
✅

Equantions for are

I cannot figure out the equations above because of the occurrence of $$\frac 2 P$$. I guess $$\frac 2 P$$ comes from the being used for normalizing basis functions $$\cos\left( \tfrac{2\pi}{P} nx \right)$$ and $$\sin\left( \tfrac{2\pi}{P} nx \right)$$. Accroding to this, if I understand correctly, the inner product of $$\cos\left( \tfrac{2\pi}{P} nx \right)$$ with itself is

where $$P_0 \in \mathbb{R}$$. Therefore

The normalized basis functions are

So the Fourier coefficients I get should be like the scalar projection of $$s(x)$$ onto orthonormal basis in $$

Unluckily, $$ is different from $$. Any idea? - Justin545 (talk) 17:02, 21 January 2022 (UTC)
 * It is not defined symmetrically. So
 * $$s(x) =\frac{a_0}{2}+\sum_{n=1}^\infty\left(a_n\cos\frac{2\pi}{p}x+b_n\sin\frac{2\pi}{p}x\right)$$
 * Ruslik_ Zero 20:17, 21 January 2022 (UTC)
 * I still don't get it. Could you provide further explanation? - Justin545 (talk) 21:22, 21 January 2022 (UTC)
 * The basis for Fourier analysis of a periodic function is given by the following orthogonality properties of the sine and cosine functions. Let $$m$$ and $$n$$ be positive integers. Then
 * $$\int_0^{2\pi}\sin mx \sin nx~dx = \int_0^{2\pi}\cos mx \cos nx~dx =

\begin{cases} 0 & \mbox{if } m \ne n, \\ \pi & \mbox{if } m = n, \end{cases}$$
 * $$\int_0^{2\pi}\sin mx \cos nx~dx = 0.$$
 * For the sake of simplicity, let us fix the period as $$2\pi$$. Let function $$s$$ be given by
 * $$s(x) =\frac{1}{2}a_0+\sum_{m=1}^\infty(a_m\cos mx+b_m\sin mx).$$
 * Let us also assume the infinite summations converge. Now consider what happens if we multiply $$s(x)$$ by $$\cos nx$$, $$n > 0$$, and integrate over the period:
 * $$\int_0^{2\pi}s(x)\cos nx~dx$$
 * $$= \int_0^{2\pi}\left(\frac{1}{2}a_0+\sum_{m=1}^\infty(a_m\cos mx+b_m\sin mx)\right)\cos nx~dx$$
 * $$= \int_0^{2\pi}\left(\frac{1}{2}a_0\cos nx+\sum_{m=1}^\infty(a_m\cos mx\cos nx+b_m\sin mx\cos nx)\right)dx$$
 * $$= \int_0^{2\pi}\frac{1}{2}a_0\cos nx~dx+\sum_{m=1}^\infty\left(a_m\int_0^{2\pi}\cos mx\cos nx~dx+b_m\int_0^{2\pi}\sin mx\cos nx~dx\right)$$
 * $$= \pi a_n.$$
 * (For the last step, split the summation into the cases $$m=n$$ and $$m\ne n$$ and apply the orthogonality formulas.) So, to find the value of $$a_n$$, we need to divide to result of the integral by $$\pi$$, that is, half the period. For $$b_n$$ we have the same story, except that we multiply $$s(x)$$ by $$\cos nx.$$ --Lambiam 07:29, 22 January 2022 (UTC)

Thanks guys, in particular Lambiam. The answer for $$P = 2 \pi$$ is understandable and crystal clear. I may try to figure out the term $$\frac {a_0} 2$$ of $$s(x)$$ and ask for help if I'm stuck again. - Justin545 (talk) 10:23, 22 January 2022 (UTC)
 * For $$a_0$$, just integrate $$s(x)$$ without multiplier – which is equivalent to multiplying it by $$\cos 0x.$$ --Lambiam 14:26, 22 January 2022 (UTC)