[ PROMPT_NODE_26869 ]
Eda
[ SKILL_DOCUMENTATION ]
# Electrodermal Activity (EDA) Analysis
## Overview
Electrodermal Activity (EDA), also known as Galvanic Skin Response (GSR) or Skin Conductance (SC), measures the electrical conductance of the skin, reflecting sympathetic nervous system arousal and sweat gland activity. EDA is widely used in psychophysiology, affective computing, and lie detection.
## Main Processing Pipeline
### eda_process()
Automated processing of raw EDA signals returning tonic/phasic decomposition and SCR features.
```python
signals, info = nk.eda_process(eda_signal, sampling_rate=100, method='neurokit')
```
**Pipeline steps:**
1. Signal cleaning (low-pass filtering)
2. Tonic-phasic decomposition
3. Skin conductance response (SCR) detection
4. SCR feature extraction (onset, peak, amplitude, rise/recovery times)
**Returns:**
- `signals`: DataFrame with:
- `EDA_Clean`: Filtered signal
- `EDA_Tonic`: Slow-varying baseline
- `EDA_Phasic`: Fast-varying responses
- `SCR_Onsets`, `SCR_Peaks`, `SCR_Height`: Response markers
- `SCR_Amplitude`, `SCR_RiseTime`, `SCR_RecoveryTime`: Response features
- `info`: Dictionary with processing parameters
**Methods:**
- `'neurokit'`: cvxEDA decomposition + neurokit peak detection
- `'biosppy'`: Median smoothing + biosppy approach
## Preprocessing Functions
### eda_clean()
Remove noise through low-pass filtering.
```python
cleaned_eda = nk.eda_clean(eda_signal, sampling_rate=100, method='neurokit')
```
**Methods:**
- `'neurokit'`: Low-pass Butterworth filter (3 Hz cutoff)
- `'biosppy'`: Low-pass Butterworth filter (5 Hz cutoff)
**Automatic skipping:**
- If sampling rate < 7 Hz, cleaning is skipped (already low-pass)
**Rationale:**
- EDA frequency content typically 0-3 Hz
- Remove high-frequency noise and motion artifacts
- Preserve slow SCRs (typical rise time 1-3 seconds)
### eda_phasic()
Decompose EDA into tonic (slow baseline) and phasic (rapid responses) components.
```python
tonic, phasic = nk.eda_phasic(eda_cleaned, sampling_rate=100, method='cvxeda')
```
**Methods:**
**1. cvxEDA (default, recommended):**
```python
tonic, phasic = nk.eda_phasic(eda_cleaned, sampling_rate=100, method='cvxeda')
```
- Convex optimization approach (Greco et al., 2016)
- Sparse phasic driver model
- Most physiologically accurate
- Computationally intensive but superior decomposition
**2. Median smoothing:**
```python
tonic, phasic = nk.eda_phasic(eda_cleaned, sampling_rate=100, method='smoothmedian')
```
- Median filter with configurable window
- Fast, simple
- Less accurate than cvxEDA
**3. High-pass filtering (Biopac's Acqknowledge):**
```python
tonic, phasic = nk.eda_phasic(eda_cleaned, sampling_rate=100, method='highpass')
```
- High-pass filter (0.05 Hz) extracts phasic
- Fast computation
- Tonic derived by subtraction
**4. SparsEDA:**
```python
tonic, phasic = nk.eda_phasic(eda_cleaned, sampling_rate=100, method='sparseda')
```
- Sparse deconvolution approach
- Alternative optimization method
**Returns:**
- `tonic`: Slow-varying skin conductance level (SCL)
- `phasic`: Fast skin conductance responses (SCRs)
**Physiological interpretation:**
- **Tonic (SCL)**: Baseline arousal, general activation, hydration
- **Phasic (SCR)**: Event-related responses, orienting, emotional reactions
### eda_peaks()
Detect Skin Conductance Responses (SCRs) in phasic component.
```python
peaks, info = nk.eda_peaks(eda_phasic, sampling_rate=100, method='neurokit',
amplitude_min=0.1)
```
**Methods:**
- `'neurokit'`: Optimized for reliability, configurable thresholds
- `'gamboa2008'`: Gamboa's algorithm
- `'kim2004'`: Kim's approach
- `'vanhalem2020'`: Van Halem's method
- `'nabian2018'`: Nabian's algorithm
**Key parameters:**
- `amplitude_min`: Minimum SCR amplitude (default: 0.1 µS)
- Too low: false positives from noise
- Too high: miss small but valid responses
- `rise_time_max`: Maximum rise time (default: 2 seconds)
- `rise_time_min`: Minimum rise time (default: 0.01 seconds)
**Returns:**
- Dictionary with:
- `SCR_Onsets`: Indices where SCR begins
- `SCR_Peaks`: Indices of peak amplitude
- `SCR_Height`: Peak height above baseline
- `SCR_Amplitude`: Onset-to-peak amplitude
- `SCR_RiseTime`: Onset-to-peak duration
- `SCR_RecoveryTime`: Peak-to-recovery duration (50% decay)
**SCR timing conventions:**
- **Latency**: 1-3 seconds after stimulus (typical)
- **Rise time**: 0.5-3 seconds
- **Recovery time**: 2-10 seconds (to 50% recovery)
- **Minimum amplitude**: 0.01-0.05 µS (detection threshold)
### eda_fixpeaks()
Correct detected SCR peaks (currently placeholder for EDA).
```python
corrected_peaks = nk.eda_fixpeaks(peaks)
```
**Note:** Less critical for EDA than cardiac signals due to slower dynamics.
## Analysis Functions
### eda_analyze()
Automatically select appropriate analysis type based on data duration.
```python
analysis = nk.eda_analyze(signals, sampling_rate=100)
```
**Mode selection:**
- Duration 0.2 µS**: Large response
- **Context-dependent**: Normalize within-subject
**SCR frequency:**
- **Resting**: 1-3 SCRs per minute (typical)
- **Stressed**: >5 SCRs per minute
- **Non-specific SCRs**: Spontaneous (no identifiable stimulus)
**Tonic SCL:**
- **Range**: 2-20 µS (highly variable across individuals)
- **Within-subject changes** more interpretable than absolute levels
- **Increases**: arousal, stress, cognitive load
- **Decreases**: relaxation, habituation
## References
- Boucsein, W. (2012). Electrodermal activity (2nd ed.). Springer Science & Business Media.
- Greco, A., Valenza, G., & Scilingo, E. P. (2016). cvxEDA: A convex optimization approach to electrodermal activity processing. IEEE Transactions on Biomedical Engineering, 63(4), 797-804.
- Posada-Quintero, H. F., Florian, J. P., Orjuela-Cañón, A. D., Aljama-Corrales, T., Charleston-Villalobos, S., & Chon, K. H. (2016). Power spectral density analysis of electrodermal activity for sympathetic function assessment. Annals of biomedical engineering, 44(10), 3124-3135.
- Dawson, M. E., Schell, A. M., & Filion, D. L. (2017). The electrodermal system. In Handbook of psychophysiology (pp. 217-243). Cambridge University Press.
Source: claude-code-templates (MIT). See About Us for full credits.