Hacker News new | ask | show | jobs
by apw 4453 days ago
While the visualization is attractive, my fear is that it cannot convey the deeper reason why those sine and cosine waves magically sum to the desired function.

Leaving rigour aside for the moment: think of functions f : R -> R as infinite-dimensional vectors. The integer harmonics of sine and cosine comprise a set of orthonormal "vectors" that form a basis for all functions on R (some fine print goes here).

Now compute the inner product of your desired function with every element of that basis. Each such inner product is a real number which we will call a coefficient. The list of nonzero coefficients, once you have computed them, is a complete description of your function.

Now it is clear why those sine and cosine functions "magically" add up to your desired function, since we are simply multiplying each of them by their corresponding coefficient that we computed above.

That visualization is no more (or less!) amazing than the fact that (1, 2, 3) = 1(1, 0, 0) + 2(0, 1, 0) + 3(0, 0, 1).