A wavelength modulation spectroscopy method for measuring the
concentration of a gas component is provided. A gas sample portion of the
light is passed through a reference gas comprising the gas component in a
constant concentration. Afterwards, the light is detected by a reference
detector. Another portion of the light is passed through the gas sample
and thereafter to a measuring detector. The light emitted by the light
source is modulated with a frequency, while the wavelength is swept over
a molecular absorption line of the gas component. Demodulation of the
detector outputs is made at a higher harmonic. In order to compensate for
variations of the modulation parameters of the light source in real time,
a mathematical description of the demodulated reference detector output
based on Fourier analysis of the modulated light and on a mathematical
expression for the absorption line is provided.