Given a processed time series find its period using autocorrelation and then convert it to heart rate (bpm)

get_hr_from_time_series(
  x,
  sampling_rate,
  method = "acf",
  min_hr = 40,
  max_hr = 200
)

Arguments

x

A time series numeric data

sampling_rate

The sampling rate (fs) of the time series data

method

The algorithm used to estimate the heartrate, because the preprocessing steps are different for each. method can be any of 'acf','psd' or 'peak' for algorithms based on autocorrelation, power spectral density and peak picking respectively

min_hr

Minimum expected heart rate

max_hr

Maximum expected heart rate

Value

A named vector containing heart rate and the confidence of the result