Spectroscopic method of determining the amount of a pre-selected analyte in a mixture of analytes in a sample with the help of a regression vector, said regression vector being associated with the pre-selected analyte by means of multivariate calibration on optical spectra of a training set, a) whereby the determination of the amount of the pre-selected analyte comprises a pre-processing step of differentiating the optical spectrum of an optical signal from the sample, and wherein the identical pre-processing step is performed on the optical spectra of the tranining set prior to the mathematical derivation of the regression vector, b) whereby the calculations for carrying out the pre-processing step are at least partially substituted by a measurement of the optical signal from the sample, c) whereby the measurement comprises transmitting or reflecting the optical signal from the sample by an optical element, thereby weighing the optical signal by a spectral weighing function according to the regression vector, wherein weighing the optical signal by the spectral weighing function is performed by a spatial light modulator; and measuring the weighted optical signal with a detector that is not a multi-channel detector; wherein determining the amount of the pre-selected analyte includes a calculation of a difference between two mathematical terms, and wherein the difference between the two mathematical terms is replaced by the difference between a first measurement value and a second measurement value; and wherein either in the first measurement value the optical signal is arranged to impinge on a dispersive element, whereby the dispersed signal is transmitted or reflected by the SLM and is focussed on the detector, and the second measurement value is carried out with the dispersive element being turned along a predefined axis by a fixed angle, or in the first measurement value the optical signal is arranged to impinge on a dispersive element, whereby the dispersed signal is transmitted or reflected by the SLM and is focussed on the detector, then the SLM is modified after the first measurement value, the modification consisting in an arrangement of the SLM to weigh the optical signal by a spectral weighing function with a lateral offset of at least one SLM pixel in comparison to the first measurement value, and whereby a second measurement value is performed with the modified SLM. a) whereby the determination of the amount of the pre-selected analyte comprises a pre-processing step of differentiating the optical spectrum of an optical signal from the sample, and wherein the identical pre-processing step is performed on the optical spectra of the tranining set prior to the mathematical derivation of the regression vector, b) whereby the calculations for carrying out the pre-processing step are at least partially substituted by a measurement of the optical signal from the sample, c) whereby the measurement comprises transmitting or reflecting the optical signal from the sample by an optical element, thereby weighing the optical signal by a spectral weighing function according to the regression vector, wherein weighing the optical signal by the spectral weighing function is performed by a spatial light modulator; and measuring the weighted optical signal with a detector that is not a multi-channel detector; wherein determining the amount of the pre-selected analyte includes a calculation of a difference between two mathematical terms, and wherein the difference between the two mathematical terms is replaced by the difference between a first measurement value and a second measurement value; and wherein either in the first measurement value the optical signal is arranged to impinge on a dispersive element, whereby the dispersed signal is transmitted or reflected by the SLM and is focussed on the detector, and the second measurement value is carried out with the dispersive element being turned along a predefined axis by a fixed angle, or in the first measurement value the optical signal is arranged to impinge on a dispersive element, whereby the dispersed signal is transmitted or reflected by the SLM and is focussed on the detector, then the SLM is modified after the first measurement value, the modification consisting in an arrangement of the SLM to weigh the optical signal by a spectral weighing function with a lateral offset of at least one SLM pixel in comparison to the first measurement value, and whereby a second measurement value is performed with the modified SLM.