# Visualize Fourier Series

How do you go about visualizing Fourier functions, this is probably easy to do at least in the following case, it's a part of a lecture and I can't get my head around this task.

They might be $-1,0$ or $1$ all coefficients for $n > 2$ are $0$.

I know that for the left graph $a_0 = 1$ and for the right graph $a_0 = 0$. Since those are the offset on the $y$-axis but I dont know how to get the other values.

For the first graph, it is easy to see that it is a negative sine wave shifted up by $1/2$. So $a_1=0$, $b_1=-1$. Since there are no other signals added, $a_2=b_2=0$.

To find the unknown values of the second graph, first look at the basic shape. The graph's basic shape resembles a sine wave with period $2\pi$. There is no other effects on this frequency, so $a_1=0$ and $b_1=1$. Now look at the higher frequency effects. Since $n=2$, the period of these waves is half the period of the $n=1$ wave. With $y(0)=0$, we know the cosine term $a_2=0$ (since adding them together would yield a non-zero result at $x=0$). The sharp peaks seem to indicate that the sine term should be positive. This can be verified by inspecting the region around $x=\pi$. You can see that $y(\pi)=0$ and the function is increasing at that point, indicating that $b_2=1$.