find_walking: Finds walking and calculate steps from raw acceleration data.

View source: R/find_walking.R

find_walkingR Documentation

Finds walking and calculate steps from raw acceleration data.

Description

Method finds periods of repetitive and continuous oscillations with predominant frequency occurring within know step frequency range. Frequency components are extracted with Continuous Wavelet Transform.

Usage

find_walking(
  data,
  sample_rate_analysis = 10L,
  min_amplitude = 0.3,
  step_frequency = c(1.4, 2.3),
  alpha = 0.6,
  beta = 2.5,
  min_duration_peak = 3L,
  delta = 20L,
  verbose = TRUE
)

Arguments

data

A data.frame with a column for time in POSIXct (usually HEADER_TIMESTAMP), and X, Y, Z

sample_rate_analysis

sampling frequency (in Hz) for analyzing walking. Note, this is NOT the sampling frequency of the data.

min_amplitude

minimum amplitude (in g)

step_frequency

step frequency range

alpha

maximum ratio between dominant peak below and within step frequency range

beta

maximum ratio between dominant peak above and within step frequency range

min_duration_peak

minimum duration of peaks (in seconds)

delta

maximum difference between consecutive peaks (in multiplication of 0.05Hz)

verbose

print diagnostic messages

Value

A vector of number of steps per second

Examples


  csv_file = system.file("test_data_bout.csv", package = "walking")
  if (requireNamespace("readr", quietly = TRUE) && reticulate::py_module_available("forest")) {
    x = readr::read_csv(csv_file)
    colnames(x)[colnames(x) == "UTC time"] = "time"
    res = find_walking(data = x)
  }


walking documentation built on Aug. 4, 2026, 1:07 a.m.