Principles, techniques and limitations of near infrared spectroscopy