An intelligent acquisition system for near infrared spectroscopy