I've been reading about how the Fourier Series works, so like how the orthogonality cancels out all but the one that we're looking for. I've read derivations of the Fourier Series. What I would like is, a more pictorial/conceptual understanding of what is physically going on in my head so that this all seems more logical to me. $$ a_n = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x) \cdot \cos(nx)\,\mathrm{d}x\ \forall\ n\ge 0 $$
I would like to pictorially understand this equation. I can see that the equation is basically saying that the average value of multiplying a function, $f(x)$, by $\cos(nx)$ will give the amplitude of $\cos(nx)$. Now here's my specific question: why is this so? Why does finding that average value give the amplitude that the cosine should have? (In a geometric/pictorial/graphical sense.)
I hope what I'm saying makes sense.
Thanks for you time.
I answered a related question on dsp.SE in which I pointed out that the Fourier coefficient $a_n$ is the number that minimizes the squared error $$\int_{-\pi}^{\pi} (f(x) - a_n\cos (nx))^2 \ \mathrm dx$$ between the function $f(x)$ and its approximation in terms of a multiple of $\cos (nx)$. The notation is slightly different and more engineering-oriented, though.