Hacker News new | ask | show | jobs
by ColinWright 4939 days ago
This was Fourier's big theorem, that every periodic, non-pathological function is "simply" the sum of phase-shifted sine waves of all necessary frequencies. You can remove the "periodic" if you allow infinitely many frequencies, and so on. The phase-shifting is taken care of by having a sine and a cosine at the same frequency, but (possibly) different amplitudes.

So start with a periodic wave and look at how much sin(x) is in it. Do this by integrating:

    Integral from 0 to 2.pi of f(x)*sin(x) dx
That's a dot product of your function f(x) with the sine wave, and that tells you how much of the first frequency you need. Subtract off the result, and then go again with sin(2x). You find the residuals get less and less. More, for something nice like a square wave or triangular wave the coefficients you get form a predictable sequence.

Interesting note:

    integral sin(k.x)*sin(m.x)
is 0 if k != m, and 1 otherwise, so the basis elements have dot-product 0, and hence are thought of as being at right angles. They also have "length" 1, since the dot-product with themselves is 1. So they are an ortho-normal basis.

So the question is: what functions can be reached by adding and subtracting multiples of sine (and cosine) functions of different frequencies? In Linear Algebra terms, what is the space of functions spanned by these basis functions?

That's harder, but it turns out to be "everything non-pathological".

http://en.wikipedia.org/wiki/Fourier_series#Hilbert_space_in...

http://en.wikipedia.org/wiki/Hilbert_space#Fourier_analysis

Edited for typos

1 comments

ah thanks for answering the other questions I hadn't gotten around to asking (the reason why it's an orthonormal basis).

I think I need to go home and have a play with this now!

For an orthonormal set, one also gets another answer to your question: how can you see how much such a set spans?

Theorem: If S is an orthonormal (or even orthogonal) set in a Hilbert space V (here, L^2 functions on R/Z), then put S^\perp = {v in V : v is orthogonal to every s in S}. Then the span of S is (S^\perp)^\perp. (The containment of the span in the double-orthocomplement is formal; the other direction requires a supplemental theorem on the geometry of Hilbert spaces.)

With this in mind, we see that S is a topological basis (spans everything) when S^\perp = 0; so, to show that the sine and cosine functions span, it suffices to show that nothing (non-0) is orthogonal to all of them. This still requires computation, but at least it's easier to imagine doing this than somehow finding a Fourier series for any L^2 function.