Linear least-square method resolves complex pulse height spectra, allowing for calculation of relative intensity, of statistical variance based on counting statistics of the correlation between library components, and of the goodness-of-fit chi square. Some applications are to gamma-ray, X ray, and charged-particle spectroscopy