TITLE: How to generalise the Fourier transform
QUESTION [6 upvotes]: The Fourier transform approximates a signal using a bunch of sine and cosine waves. The inverse Fourier transform then reconstructs the original signal from this information.
I am told that it's possible to decompose a signal using some other set of functions, rather than the usual sine and cosine. My question is, how do you do this? 
For a start, I'm assuming that for your set of functions to be able to approximate every possible signal, you need to have "enough" of these functions, and ideally you want them to be "different" such that each one measures an unrelated aspect of the signal.
To be completely clear, I'm mostly interested in the case of digital sampled data. But the continuous case might be interesting too...

Edit:
I'm not sure why my question isn't producing any answers. Maybe it's because nobody actually knows the answer, or maybe it's because the answer is "too obvious" to somebody who actually possesses formal mathematical training. I'm not sure. But I've wanted to know the answer to this question for years, so let's try one more time...
The discrete Fourier transform works by computing the correlation of the input signal with several different sine waves. The inverse transform then adds together the specified amplitudes of those waves, recovering the original signal. That much seems clear.
It looks like I could just invent a family of functions to use instead of the sine and cosine functions, and do exactly the same process... except that when I do this, it doesn't work in any way, shape or form. If I transform and then inverse-transform, I get gibberish. And I don't know why... but it seems like the key phrase is "complete set of orthonormal functions", whatever that means.

Update:
I had assumed that if I could just find a system of basis functions such that none of them are correlated, and their number equals the number of points in the input, the transform would work. Apparently, it does not.
Consider the following set of functions:
$$f_1 = [1,1,1,1]$$
$$f_2 = [0,1,0,-1]$$
$$f_3 = [1,0,-1,0]$$
$$f_4 = [1,-1,1,-1]$$
Clearly, there are 4 functions. As far as I can tell, none of them are correlated. For example,
$$f_1 * f_4 = (1 * 1) + (1 * -1) + (1 * 1) + (1 * -1) = 1 - 1 + 1 - 1 = 0$$
If we take, say, $x = [1,2,3,4]$ and compute the correlations, we get
$$f_1 * x = 1 + 2 + 3 + 4 = 10$$
$$f_2 * x = 0 + 2 + 0 - 4 = -2$$
$$f_3 * x = 1 + 0 - 3 + 0 = -2$$
$$f_4 * x = 1 - 2 + 3 - 4 = -2$$
Now, computing $10 f_1 - 2 f_2 - 2 f_3 - 2 f_4$, we get
$$10 + 0 - 2 - 2 = 6$$
$$10 - 2 + 0 + 2 = 10$$
$$10 + 0 + 2 - 2 = 10$$
$$10 + 2 + 0 + 2 = 14$$
Clearly $[6, 10, 10, 14]$ is nothing like $[1,2,3,4]$, even with scaling. So... what am I missing?

REPLY [2 votes]: You can generalize the Fourier transform by using a family of complete orthogonal functions. For instance if I were interested in a series expansion for functions on the real line $(-\infty,\infty)$ I could use the Hermite polynomial basis. 
The polynomials are defined by,
$$
H_n = (-1)^ne^{x^2}\frac{d^n}{dx^n}e^{-x^2}.
$$ 
These polynomials have two important properties.

Orthogonality,
$$ \int_{-\infty}^{\infty} H_n(x) H_m(x) e^{-x^2}dx  = \begin{cases} \sqrt{\pi}2^n n! \text{ if } n=m \\ 0 \text{ otherwise} \end{cases}$$
Completeness,
$$ f(x) = \sum_{j=0}^\infty c_j H_j(x)e^{-x^2/2} \qquad \text{(most functions)}$$

If we want the coefficients in the expansion then we just exploit the orthogonality of the basis functions,
$$  c_n =\frac{1}{2^n  n! \sqrt{\pi}} \int_{-\infty}^{\infty} f(x) H_n(x) e^{-x^2/2} dx $$
There are other families of complete orthogonal functions which can do the same thing. There are some limitations to these types of series representations which are shared by fourier series. In the context of the series above you are guaranteed to be able to represent square integrable functions.
For more on orthogonal polynomials see the pdf: "Abromowitz and Stegun Handbook of Mathematical Functions" chapter 22.