Skip to contents

Computes Maximum Voluntary Contraction (MVC) reference values from MVC trial data for use in EMG normalization.

Usage

compute_mvc_reference(
  mvc_data,
  method = "peak",
  window_ms = 500,
  top_percent = 5,
  sampling_rate = NULL
)

Arguments

mvc_data

MVC trial data. Can be a matrix (T x M) or a list of matrices (multiple MVC trials).

method

Method to compute MVC:

  • "peak": Maximum value (default)

  • "mean_peak": Mean of top N

  • "rms_peak": RMS of the peak window

window_ms

Window size in ms for peak detection (used with "rms_peak"). Default is 500 ms.

top_percent

Percentage of top values to average (used with "mean_peak"). Default is 5.

sampling_rate

Sampling rate in Hz (required for "rms_peak").

Value

Numeric vector of MVC values, one per channel.

Examples

# From single MVC trial
mvc_trial <- matrix(abs(rnorm(1000 * 4)), ncol = 4)
mvc_ref <- compute_mvc_reference(mvc_trial)

# From multiple MVC trials (takes maximum across trials)
mvc_trials <- list(
  trial1 = matrix(abs(rnorm(1000 * 4)), ncol = 4),
  trial2 = matrix(abs(rnorm(1000 * 4)), ncol = 4)
)
mvc_ref <- compute_mvc_reference(mvc_trials)