When one expands a function defined on the circle $S^1$ into its Fourier series what is really being done is to consider the expansion on the complete set of function $\{\phi_n\}$ with $\phi_n(x) = e^{in x}$, so that in the end we have for $f\in L^2(S^1)$
$$f=\sum_{n}c_n\phi_n.$$
The same can also be done in the sphere $S^2$. There we have the spherical harmonics $Y^m_l$ and they can be seen as just generalizing the Fourier series for the two dimensional case of the sphere. In that case $\{Y^m_l\}$ gives a complete set of functions on the sphere and we can expand $f\in L^2(S^2)$
$$f=\sum_{l=0}^\infty\sum_{m=-l}^l c_{ml}Y^m_l.$$
Now these are not just any complete sets of function, they are rather "special".
My question is: given a smooth manifold $M$, is there some known construction that yields a complete set of functions $\{\psi_n\}$ so that we can write for any $f\in L^2(M)$
$$f=\sum_{n}c_n \psi_n,$$
and so that the construction reduces to the spherical harmonics and to the Fourier series when $M=S^2$ and $M=S^1$?