PhysioEMG PhysioEMG logo

EMG Analysis Functions for PhysioExperiment Objects

PhysioEMG provides 21 exported functions for electromyography (EMG) analysis, built on top of PhysioCore. It covers the complete EMG analysis pipeline from signal conditioning through clinical interpretation: envelope extraction and amplitude normalization, spectral analysis, muscle activation onset detection, fatigue monitoring, muscle synergy decomposition, and inter-muscular connectivity network analysis -- all operating directly on PhysioExperiment objects.

Installation

You can install PhysioEMG from r-universe:

# the containers build on Bioconductor, so its repositories are needed too
install.packages("BiocManager", repos = "https://cloud.r-project.org")
install.packages("PhysioEMG",
  repos = c("https://x-biosignal.r-universe.dev", BiocManager::repositories()))

Or install the development version from GitHub:

# install.packages("remotes", repos = "https://cloud.r-project.org")
remotes::install_github("x-biosignal/PhysioEMG")

Quick Start

library(PhysioEMG)

# Generate simulated EMG with muscle bursts
pe <- make_emg(n_time = 5000, n_channels = 4, sr = 1000)

# Detect muscle activation onsets
onsets <- emgOnsetDetect(pe, method = "hodges_bui")

# Extract RMS envelope and normalize
pe_env <- emgEnvelope(pe, method = "rms", window_ms = 50)
pe_norm <- emgAmplitudeNormalize(pe_env, method = "peak")

# Decompose into muscle synergies
syn <- muscleSynergy(pe, n_synergies = 3, method = "nmf")

# Analyze inter-muscular coordination network
net <- emgCoherenceNetwork(pe, freq_band = c(10, 50))
coord <- emgCoordinationStructure(net)

Features

Envelope Extraction and Amplitude Normalization

Signal conditioning for amplitude analysis:

Spectral Analysis

Frequency-domain characterization of EMG signals:

Onset Detection

Automatic identification of muscle activation timing:

Fatigue Analysis

Monitor neuromuscular fatigue during sustained or repeated contractions:

Muscle Synergy Decomposition

Extract coordinated muscle activation patterns underlying motor control:

Inter-Muscular Network Analysis

Characterize functional connectivity and coordination between muscles:

Simulated Data Generators

Ready-to-use data for testing, demonstration, and teaching:

Dependencies

PhysioExperiment Ecosystem

PhysioEMG is the EMG analysis layer of the PhysioExperiment ecosystem, a suite of R packages for multi-modal physiological signal analysis:

Package Description
PhysioCore Core data structures and accessors
PhysioIO File I/O (EDF, HDF5, BIDS, CSV, MAT)
PhysioPreprocess Preprocessing (filters, ICA, resampling)
PhysioAnalysis Analysis and visualization
PhysioEEG EEG analysis (ICA, ERP, source, BCI, sleep)
PhysioEMG EMG analysis (synergy, fatigue, onset)
PhysioECG ECG and HRV analysis

Visit the r-universe page to browse all available packages.

License

MIT License. See LICENSE for details.

Author

Yusuke Matsui

Governance & support

Part of the Physio ecosystem. Community and policy documents live in the umbrella repository: