Method for lifetime-based chemical sensing using the demodulation of the luminescence signal