Learn R Programming

heartbeatr (version 1.0.0)

pulse_interpolate: Increase the number of data points in PULSE data through interpolation

Description

The performance of the algorithm employed in the downstream function pulse_heart() for the detection of heart beat wave crests depends significantly on there being a sufficient number of data points around each crest. pulse_interpolate() reshapes the data non-destructively and improves the likelihood of pulse_heart() successfully estimating the inherent heartbeat rates.

  • INTERPOLATION is highly recommended because tests on real data have shown that a frequency of at least 40 Hz is crucial to ensure wave crests can be discerned even when the underlying heartbeat rate is high (i.e., at rates above 2-3 Hz). Since the PULSE multi-channel system is not designed to capture data at such high rates (partially because it would generate files unnecessarily large), pulse_interpolate() is used instead to artificially increase the temporal resolution of the data by linearly interpolating to the target frequency. It is important to note that this process DOES NOT ALTER the shape of the heart beat wave, it just introduces intermediary data points. Also, the only downside to using very high values for interpolation_freq is the proportional increase in computing time and size of the outputs together with minimal improvements in the performance of pulse_heart() - but no artefacts are expected.

Usage

pulse_interpolate(split_window, interpolation_freq = 40, multi)

Value

The same PULSE tibble supplied in split_window, but now with data interpolated to interpolation_freq (i.e., with more data points)

Arguments

split_window

one element of the pulse_data_split list() (which is the output from pulse_split()).

interpolation_freq

numeric, defautls to 40; value expressing the frequency (in Hz) to which PULSE data should be interpolated. Can be set to 0 (zero) or any value equal or greater than 40 (the default). If set to zero, no interpolation is performed.

multi

logical; was the data generated by a multi-channel system (TRUE) or a one-channel system (FALSE)?

See Also

  • approx() is used for the linear interpolation of PULSE data

  • pulse_optimize() is a wrapper function that executes pulse_interpolate and pulse_smooth() sequentially

  • pulse_read(), pulse_split(), pulse_heart(), pulse_doublecheck() and pulse_choose_keep() are the other functions needed for the complete PULSE processing workflow

  • PULSE() is a wrapper function that executes all the steps needed to process PULSE data at once

Examples

Run this code
## Begin prepare data ----
pulse_data_sub <- pulse_data
pulse_data_sub$data <- pulse_data_sub$data[,1:5]
pulse_data_split <- pulse_split(pulse_data_sub)
## End prepare data ----

# Interpolate data to 40 Hz
pulse_interpolate(pulse_data_split$data[[1]], 40, multi = pulse_data$multi)

Run the code above in your browser using DataLab