Skip to contents

Find peaks in the acceleration signal.

Usage

find_peaks(data, vector, min_height = 1.3, min_dist = 0.4)

Arguments

data

An impactr_data object, as obtained with read_acc().

vector

A character string indicating in which acceleration vector to find the peaks. Can be "resultant", "vertical" or "all".

min_height

The minimum height of the peaks (in g).

min_dist

The minimum horizontal distance between peaks (in seconds).

Value

An object of class impactr_peaks with the peaks magnitude stored in the columns.

Details

The default values of the filter parameters are matching the filter used in the paper by Veras et al. that developed the mechanical loading prediction equations (see References). When the vector parameter is set to "all", there may contain NA values in the resultant_peak_acc and/or vertical_peak_acc at the timestamps in which a peak value for that vector could not be identified.

The default values of min_height and min_dist are matching the criteria used in the paper by Veras et al. that developed the mechanical loading prediction equations (see References)

References

  • Veras L, Diniz-Sousa F, Boppre G, Devezas V, Santos-Sousa H, Preto J, Machado L, Vilas- Boas JP, Oliveira J, Fonseca H. Accelerometer-based prediction of skeletal mechanical loading during walking in normal weight to severely obese subjects. Osteoporosis International. 2020. 31(7):1239- 1250. doi:10.1007/s00198-020-05295-2 .

Examples

data <- read_acc(impactr_example("hip-raw.csv"))
data <- use_resultant(data)
find_peaks(data, vector = "resultant")
#> # Start time:              2021-04-06 15:43:00
#> # Sampling frequency:      100Hz
#> # Accelerometer placement: Non-specified
#> # Subject body mass:       Non-specified
#> # Filter:                  No filter applied
#> # Data dimensions:         303 × 2
#>    timestamp           resultant_peak_acc
#>    <dttm>                           <dbl>
#>  1 2021-04-06 15:43:00               2.24
#>  2 2021-04-06 15:43:00               1.43
#>  3 2021-04-06 15:43:02               1.49
#>  4 2021-04-06 15:43:03               1.68
#>  5 2021-04-06 15:43:04               1.49
#>  6 2021-04-06 15:43:04               1.30
#>  7 2021-04-06 15:43:05               2.13
#>  8 2021-04-06 15:43:05               1.34
#>  9 2021-04-06 15:43:06               1.39
#> 10 2021-04-06 15:43:07               1.46
#> # … with 293 more rows
#> # ℹ Use `print(n = ...)` to see more rows