Measurement of heart rate variability and stress