R/get_heartrate.R
get_heartrate.Rd
A convenience wrapper for extracting heart rate features for each color band from average pixel value per frame of video (processed hr) captured using smartphone cameras.
get_heartrate( heartrate_data, window_length = 10, window_overlap = 0.5, method = "acf" )
heartrate_data | A data frame with columns t, red, green and blue |
---|---|
window_length | Length of the time window in seconds, to be considered while calculating the heart rate for each channel. |
window_overlap | Fraction in the interval [0, 1) specifying the amount of window overlap. |
method | The algorithm used to calculate the heartrate, current methods include ('acf','psd') which stand for autocorrelation function, and power spectral density respectively. We will be adding support for peak picking algorithms, and wavelet methods later. |
list containing heart rate and confidence of the estimate for each color (red, green, blue)
The heartrate activity entails participants placing their finger over the camera for a period of time with the flash on.
heartrate_data = heartrate_data[,c('t', 'red', 'green', 'blue')] heartrate_ftrs = get_heartrate(heartrate_data)