Let's say we have two functions $f:[-1,1]\rightarrow \mathbb{R}$ and $g:[-1,1]\rightarrow \mathbb{R}$. Suppose furthermore that one can write down $f,g$ in terms of a linear sum of basis functions that span the domain $[-1,1]$ (like Fourier Series)
$$ f(x) = \sum_n a_ne^{i\omega_n x} \\ g(x) = \sum_mb_me^{i\omega_m x} $$
Does there exist a matrix $M_{nm}$ that transforms $f(x)$ to $g(x)$? Do there exist some functions where a linear transformation $M:f\rightarrow g$ cannot exist? Under the case where this kind of transformation is possible, how would one compute $M$?
We can easily create a linear transformation between vector spaces that maps the vector $\{a_n\}$ to the vector $ \{b_m\}$, but in general this will not translate into a linear transformation in function space i.e. this does not mean that $g$ is a linear function of $f$.