extrapolate applies the extrapolation algorithm to a multi-channel
accelerometer data, trying to reconstruct the true movement from the
extrapolate(df, ...) extrapolate_single_col( t, value, range, noise_level = 0.03, k = 0.05, spar = 0.6 )
dataframe. Input multi-channel accelerometer data. Used in
see following parameter list.
POSIXct or numeric vector. Input index or timestamp sequence Used in
numeric vector. Value vector used in
numeric vector. The dynamic ranges of the input signal. Should
be a 2-element numeric vector.
number. The tolerable noise level in \(g\) unit, should be between 0 and 1. Default is 0.03, which applies to most devices.
number. Duration of neighborhood to be used in local spline regression for each side, in seconds. Default is 0.05, as optimized by MIMS-unit algorithm.
number. Between 0 and 1, to control how smooth we want to fit local spline regression, 0 is linear and 1 matches all local points. Default is 0.6, as optimized by MIMS-unit algorithm.
extraplate returns a dataframe with extrapolated multi-channel
extrapolate_single_col returns a dataframe with extrapolated
single-channel signal, the timestamp col is in numeric values instead of
This function first linearly interpolates the input signal to 100Hz, and then applies the extrapolation algorithm (see the manuscript) to recover the maxed-out samples. Maxed-out samples are samples that are cut off because the intensity of the underlying movement exceeds the dynamic range of the device.
extrapolate processes a dataframe of a multi-channel accelerometer
extrapolate_single_col processes a single-channel signal with
its timestamps and values specified in the first and second arguments.
This function is the first step during MIMS-unit algorithm, applied before filtering.
Other extrapolation related functions:
# Use the maxed-out data for the conceptual diagram df = conceptual_diagram_data[ conceptual_diagram_data['GRANGE'] == 4, c("HEADER_TIME_STAMP", "X")] # Plot input illustrate_signal(df, range=c(-4, 4))# Use the default parameter settings as in MIMunit algorithms # The dynamic range of the input data is -4g to 4g. output = extrapolate(df, range=c(-4, 4))#> Warning: `tbl_df()` is deprecated as of dplyr 1.0.0. #> Please use `tibble::as_tibble()` instead. #> This warning is displayed once every 8 hours. #> Call `lifecycle::last_warnings()` to see where this warning was generated.