PhysioCrossModal PhysioCrossModal logo

Cross-Modal Coupling Analysis for PhysioExperiment Objects

PhysioCrossModal provides cross-modal coupling, connectivity, and synchrony analysis between physiological signals of different modalities (EEG, EMG, ECG, EDA, MoCap, fNIRS, etc.). It introduces the MultiPhysioExperiment container class for holding multiple PhysioExperiment objects at different sampling rates with temporal alignment. Its exported analysis surface supports spectral coherence, phase synchrony (PLV, PLI, wPLI), phase-amplitude coupling, directed coupling (Granger causality), time-domain coupling (cross-correlation), surrogate-based statistical testing, and publication-ready visualization.

Installation

You can install PhysioCrossModal 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("PhysioCrossModal",
  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/PhysioCrossModal")

Quick Start

library(PhysioCrossModal)

# Create simulated EEG + EMG data with known corticomuscular coupling
sim <- make_eeg_emg(
  n_sec = 10,
  sr_eeg = 500,
  sr_emg = 1000,
  cmc_freq = 20   # beta-band coupling
)

# Build a MultiPhysioExperiment from the two modalities
mpe <- MultiPhysioExperiment(
  streams = list(EEG = sim$eeg, EMG = sim$emg)
)

# Inspect the container
mpe
modalities(mpe)      # c("EEG", "EMG")
nModalities(mpe)     # 2
samplingRates(mpe)   # named vector of sampling rates

# Compute corticomuscular coherence between the two modalities
coh <- coherence(
  mpe,
  modality_x = "EEG",
  modality_y = "EMG",
  method = "welch"
)

# Peak coherence and the frequency at which it occurs
peak <- which.max(coh$coherence)
coh$frequencies[peak]

# Test statistical significance with phase-shuffled surrogates
sig <- surrogateTest(
  mpe,
  method = "coherence",
  modality_x = "EEG",
  modality_y = "EMG",
  n_surrogates = 200
)
sig$p_value

Features

MultiPhysioExperiment Class

The MultiPhysioExperiment S4 class is a container for multiple PhysioExperiment objects recorded at different sampling rates. It maintains temporal alignment metadata so that cross-modal analyses operate on correctly synchronized signals.

Signal Alignment

Temporal synchronization across modalities with different sampling rates:

Spectral Coupling

Frequency-domain coupling measures for identifying shared oscillatory activity:

Phase Synchrony

Phase-based coupling measures robust to amplitude variations:

Phase-Amplitude Coupling

PAC is an association, not evidence of a biological mechanism. Waveform shape, filter leakage and transients, non-stationarity, and common inputs can all produce high or significant values. Inspect the realized pass bands and the returned diagnostic strings before interpreting a significance mask.

Directed Coupling

Methods for inferring directional (causal) interactions between signals:

Granger causality is a stationary linear predictive-direction measure. It does not establish physical or interventional causality and does not remove confounding, common-driver, volume-conduction, or instantaneous-mixing bias.

Time-Domain Coupling

Coupling measures operating directly on the time series:

Unified Coupling API

High-level wrappers that dispatch to specific coupling methods:

Statistical Inference

Non-parametric significance testing and generalization assessment:

Visualization

Publication-ready plotting functions for coupling results:

Simulated Data

Helper functions for generating test data with known coupling properties:

Use Cases

Application Methods
Corticomuscular coherence (EEG-EMG) coherence(), multitaperCoherence()
EEG inter-regional connectivity phaseLockingValue(), phaseLagIndex(), weightedPLI()
Brain-heart coupling (EEG-ECG) crossCorrelation(), waveletCoherence()
Neurovascular coupling (EEG-fNIRS) coherence(), grangerCausality()
EDA-EMG sympathetic co-activation slidingCrossCorrelation(), couplingMatrix()
Movement-brain synchrony (MoCap-EEG) waveletPLV(), waveletCoherence()

Dependencies

Optional (in Suggests):

PhysioExperiment Ecosystem

PhysioCrossModal is part 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
PhysioCrossModal Cross-modal coupling and connectivity
PhysioMoCap Motion capture and biomechanics

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: