Spectroscopy of mixed material If there is an unknown sample $X$ consisting of various molecules, is there a general method to determine the molecules making up the sample using spectroscopy?
Details. This is my naive guess on how this could work. We are given the absorption spectrum of the unknown sample $X$, given as a real-valued function $s_X$ valued in the interval $[f_{\text{low}}, f_{\text{high}}]$ of frequencies. We know that $X$ consists of a subset of some molecules $M_1, \ldots M_n$, each with absorption spectrum $s_1, \ldots s_n$. My naive guess then is that we want to write $$s = \rho_1 s_1 + \cdots + \rho_n s_n $$
so that we can know the true densities $\rho_1, \ldots \rho_n$ of the molecules $M_1, \ldots M_n$ making up the unknown sample $X$. Here, the true densities can take zero values as well, so that we include the possibility that $X$ consists only of a few of the molecules $M_1, \ldots M_n$. In reality, since linear combinations of $s_1, \ldots s_N$ doesn't span all of the real-valued functions, we would be looking for a projection to the subspace spanned by the $s_1, \ldots s_N$.
Is this method I just described what roughly happens in practice?
*I'm a math PhD student with no background in physical chemistry.
 A: As @EdV mentioned, there are some complicating effects such as interactions, etc., in some mixtures. But let’s assume, perhaps, that you have noninteracting gasses of an unknown composition (not a terrible assumption in many cases). And we’ll further assume that you have a well-calibrated spectrometer with all systematic errors removed. Then your description is pretty much correct.
The main difference between what you describe and what happens in practice is an accounting for the non-idealities of the real-world experiment. A big one is noise. You don’t measure a linear combination of idealized spectral functions; rather, you collect noisy discrete data. So, the data analysis will involve some sort of statistical treatment. Usually, people will perform something like a least-squares fit and then report a goodness-of-fit measure.
In reality, with a high-frequency-resolution spectrometer and gaseous samples, the spectral lines are so sharp that the position of a single line can uniquely identify a molecular constituent from the possible subset. And it may be the case that, $s_i \cdot s_j =0$ for pretty much all $i$ and $j$.
