A system and optimization algorithm for determining the preferred operational wavelengths of a device configured for measurement of molecular analytes in a sample. Operational wavelengths are determined by solving a system of equations linking empirically defined functions representative of these analytes, spectrally dependent coefficients corresponding to these analytes, path lengths traversed by waves probing the analytes at wavelengths corresponding to the absorption level described by the functions representative of these analytes, and, optionally, a cost-function taking into account at least one of spectral separation between the operational wavelengths, manufacturability of wave source(s) producing wave(s) at operational wavelength(s), and the noise factor associated with the operation of such wave source(s).