Forum Replies Created
-
AuthorPosts
-
Aha, I got it to work for my test file. Thanks for the help 😀
To give a more geometric analogy, suppose we have a point in a 2D vector space (I wish I could show pictures and stuff here, but following along with pencil/paper should be fine too):
x = (1,1)
We can view this vector space as having two basis vectors,
b1 = (1,0)
b2 = (0,1)so that this point can be written
(1,1) = 1*b1) + 1*b2
However, it’s not always immediately obvious what the decomposition of a point is. If our basis vectors had been
b1 = (1/sqrt(2),1/sqrt(2))
b2 = (-1/sqrt(2), 1/sqrt(2))the decomposition by basis vectors isn’t as simple as reading off the indices.
Luckily, the “dot product” can come to the rescue. Glossing over some details, the dot product between a vector x and a basis vector b gives the coefficient of b in the decomposition of x. In our example,
dot(x,b1) = 1/sqrt(2) + 1/sqrt(2) = sqrt(2)
dot(x,b2) = 1/sqrt(2) – 1/sqrt(2) = 0giving us the decomposition:
x = sqrt(2)*b1 + 0*b2
More generally, if we have a vector space with n dimensions and basis vectors b1,b2,…,bn, then a vector x decomposes as
x = dot(x,b1)*b1 + dot(x,b2)*b2 + dot(x,b3)*b3 + …
Which is pretty cool.
Going back to Fourier analysis, let’s look at another vector space. In this case, points in the vector space refer to functions. For example, if
b1 = sin(x)
b2 = sin(2x)then the point (2,3) would correspond to the function
f(x) = sin(2) + sin(3x)
In the case of Fourier analysis, the basis vectors are the basis functions
sin(x), sin(2x), etc
as in the lectures. Then to get the decomposition of a function in terms of these basis functions, we again take the dot product:
x = dot(x,b1)*b1 + dot(x,b2)*b2 + …
But what’s the dot product of two functions? It’s defined to be the integral of their product (it’s a bit more complicated than this, but let’s not get too carried away):
dot(f,g) = integral(f*g)
As we’re dealing with samples we can approximate this with sums:
dot(f,g) ~ \sum_x f(x)*g(x)
obtaining the algorithm shown in the lectures, where the the coefficients for each of the basis functions is found by multiplying the values of the basis functions and the values of the function at the sample points.
As to your original question, not every set of functions is a valid basis. For example, in our original set, the vectors b1 = (1,0) and b2 = (2,0) are not a valid basis, as they are multiples of each other, are not orthogonal, and don’t span the vector space (for example, no combination of these vectors could ever produce (0,1)). Your example is the analog in the function space, as Simon noted.
-
AuthorPosts