Learn R Programming

MIMSunit (version 0.11.1)

remove_average: Remove constant component of the signal

Description

remove_average function takes a multi-channel signal and removes the average value over a filtering window.

Usage

remove_average(df, sr, order = 0.5)

Arguments

df

dataframe. The input multi-channel signal. The first column is timestamps in POSXlct format. The rest columns are signal values.

sr

number. Sampling rate in Hz of the input signal.

order

number. Window size (in seconds) of the filter. Default is 500 ms.

Value

dataframe. Filtered signal.

How is it used in MIMS-unit algorithm?

This function has been considered as one of filtering options during the development of MIMS-unit algorithm. But the released version of MIMS-unit algorithm does not use this function for filtering.

Details

This function filters the input multi-channel signal by removing the average value within each sliding window. The sliding window size is decided by \(w = sr * order\).

See Also

Other filtering functions: bandlimited_interp(), bessel(), iir()

Examples

Run this code
# NOT RUN {
  # Use sample data
  df = sample_raw_accel_data

  # View input
  illustrate_signal(df, plot_maxed_out_line = FALSE)

  # Apply filtering
  output = remove_average(df, sr=80, order=0.5)

  # View output
  illustrate_signal(output, plot_maxed_out_line = FALSE)
# }

Run the code above in your browser using DataLab