Adaptive thresholding with inverted triangular area for real-time detection of the heart rate from photoplethysmogram