Using an iterative linear least-squares algorithm it is possible to selectively subtract known spectral components from a mixture in an automated procedure. The proposed approach circumvents the subjective decisions encountered with interactive real-time graphics programs and enables simultaneous removal and/or optimization of scaling coefficients of multiple known pure components in order to yield the difference spectrum.
P. C. Gillette and J. L. Koenig, "Objective Criteria for Absorbance Subtraction," Appl. Spectrosc. 38, 334-337 (1984)