Normalizes EMG signals using various methods to allow comparison across channels, subjects, or sessions.
Arguments
- data
EMG signal. Can be a numeric vector (single channel), a matrix (T x M, time x channels), or a list of matrices.
- method
Normalization method:
"max": Divide by maximum value (default)"mvc": Divide by Maximum Voluntary Contraction reference"mean": Divide by mean value"zscore": Z-score standardization (subtract mean, divide by SD)"range": Min-max normalization to [0, 1]"median": Divide by median value (robust to outliers)
- reference
Reference values for MVC normalization. Can be a single value (applied to all channels) or a vector (one value per channel). Only used when
method = "mvc".- per_channel
Logical. If TRUE (default), normalize each channel independently. If FALSE, use global statistics across all channels.
Details
Normalization is essential for:
Comparing EMG across different muscles
Comparing EMG across different subjects
Comparing EMG across different recording sessions
MVC normalization (method = "mvc") is the gold standard
in EMG research, expressing activation as a percentage of maximum
voluntary contraction. Requires separate MVC trials for reference.
Max normalization (method = "max") is useful when MVC
data is not available, normalizing to the peak value in the data.
Examples
# Max normalization (0 to 1 range)
emg <- matrix(rnorm(1000), ncol = 4)
norm_emg <- normalize_emg(emg, method = "max")
# MVC normalization (% MVC)
mvc_values <- c(100, 150, 80, 120) # MVC for each channel
norm_emg <- normalize_emg(emg, method = "mvc", reference = mvc_values)
# Z-score normalization
norm_emg <- normalize_emg(emg, method = "zscore")