Monitoring of fermentation by infrared spectrometry