Electrodermal Activity Analysis for PhysioExperiment Objects
PhysioEDA provides electrodermal activity (EDA / skin conductance) analysis functions for the PhysioExperiment ecosystem. With 19 exported functions, it delivers a complete EDA processing pipeline -- from preprocessing (filtering, downsampling, artifact handling) through tonic/phasic decomposition (highpass, median, CDA, cvxEDA), SCR peak detection, feature extraction, event-related SCR analysis, and visualization. All functions operate on PhysioExperiment objects and store results as new assays for seamless integration with downstream analysis.
You can install PhysioEDA 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("PhysioEDA",
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/PhysioEDA")
library(PhysioEDA)
# Generate a simulated EDA signal (10 minutes at 10 Hz, 5 embedded SCRs)
pe <- edaSimulate(n_time = 6000, sr = 10, scr_count = 5, seed = 42)
# Lowpass filter to remove high-frequency noise
pe <- edaFilter(pe, type = "lowpass", cutoff = 1.0)
# Decompose into tonic (SCL) and phasic (SCR) components
pe <- edaDecompose(pe, method = "highpass", cutoff = 0.05)
# Detect SCR peaks in the phasic signal
peaks <- edaPeaks(pe, amplitude_min = 0.01)
head(peaks)
#> channel onset_sample onset_sec peak_sample peak_sec amplitude rise_time recovery_time
#> 1 EDA1 587 58.6 602 60.1 0.482 1.50 3.20
#> ...
# Extract comprehensive features per channel
features <- edaFeatures(pe, peaks)
features
#> channel scr_count scr_rate_per_min mean_amplitude mean_scl scl_sd auc_phasic ns_scr_freq
#> 1 EDA1 5 0.50 0.453 5.02 0.21 4.32 0.50
# Visualize decomposition
plotDecompose(pe)
Frequency-domain filtering and downsampling with anti-aliasing:
edaFilter() -- FFT-based lowpass, highpass, or bandpass filter with smooth frequency-domain transitionedaDownsample() -- reduce sampling rate with automatic anti-aliasing lowpass filter and event preservationDetection and correction of motion artifacts and signal dropouts:
edaArtifact() -- detect artifacts (amplitude spikes, rapid transients) and correct them via interpolation or replacementSeparate the slow-varying skin conductance level (SCL) from fast-varying skin conductance responses (SCR) using four methods:
edaDecompose() with method = "highpass" -- FFT-based highpass/lowpass separation at a configurable cutoff frequencyedaDecompose() with method = "median" -- sliding median filter for tonic extractionedaDecompose() with method = "cda" -- Continuous Decomposition Analysis (Benedek & Kaernbach, 2010) using Bateman impulse response deconvolution with non-negativity constraintedaDecompose() with method = "cvxeda" -- convex optimization approach (Greco et al., 2016) using iterative ADMM with Wiener deconvolution and L1 sparsityDetect individual skin conductance responses with configurable criteria:
edaPeaks() -- detect SCR peaks using gradient-based (first-derivative zero-crossing) or amplitude threshold methodsComprehensive per-channel summary metrics:
edaFeatures() -- SCR count, SCR rate per minute, mean SCR amplitude, mean SCL, SCL standard deviation, phasic area under curve (AUC), non-specific SCR frequencyedaQuality() -- assess EDA signal quality per channelNormalize and transform EDA signals for statistical analysis:
edaTransform() -- apply log, sqrt, range normalization, or z-score transformationsedaUntransform() -- reverse transformations to recover original scaleTime-locked SCR analysis for experimental paradigms:
edaErscr() -- event-related SCR analysis with configurable onset and peak windows, returning per-event amplitude, latency, rise time, and recovery timePublication-ready plotting functions using base R graphics:
plotEda() -- plot raw or processed EDA signalplotPeaks() -- overlay detected SCR peaks on the signalplotDecompose() -- multi-panel plot showing original signal, tonic, and phasic componentsSynthetic EDA generators with known ground truth for testing and validation:
edaSimulate() -- generate EDA with configurable SCR count, amplitude, SCL level, and noise using biexponential (Bateman function) impulse responsesmake_eda() -- create a basic simulated EDA PhysioExperimentmake_eda_with_scr() -- create EDA with embedded SCR events at specified timesPhysioEDA is the electrodermal activity analysis module 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 |
| PhysioECG | ECG analysis and HRV |
| PhysioEDA | Electrodermal activity analysis |
Visit the r-universe page to browse all available packages.
MIT License. See LICENSE for details.
Yusuke Matsui
Part of the Physio ecosystem. Community and policy documents live in the umbrella repository: