Skip to contents

Identifies SCR peaks in an EDA signal using either a gradient-based zero-crossing method or an amplitude threshold method. Returns onset, peak, amplitude, rise time, and recovery time for each detected SCR.

Usage

edaPeaks(
  x,
  method = c("gradient", "threshold"),
  amplitude_min = 0.01,
  rise_time_min = 0.1,
  rise_time_max = 5,
  assay_name = NULL
)

Arguments

x

A PhysioExperiment object containing EDA data.

method

Detection method: "gradient" (first-derivative zero-crossing) or "threshold" (amplitude threshold). Default is "gradient".

amplitude_min

Minimum SCR amplitude in microsiemens (default: 0.01).

rise_time_min

Minimum rise time in seconds (default: 0.1).

rise_time_max

Maximum rise time in seconds (default: 5.0).

assay_name

Name of the input assay. If NULL, uses "phasic" if available, otherwise defaultAssay(x).

Value

A data.frame with one row per detected SCR and the following columns:

channel

Character channel label.

onset_sample

Integer sample index of SCR onset.

onset_sec

Numeric onset time in seconds.

peak_sample

Integer sample index of SCR peak.

peak_sec

Numeric peak time in seconds.

amplitude

Numeric SCR amplitude in microsiemens (peak minus onset).

rise_time

Numeric rise time from onset to peak in seconds.

recovery_time

Numeric 50% recovery time in seconds, or NA.

Returns an empty data.frame with the same columns if no peaks are found.

References

Bach, D.R., et al. (2010). "Modelling event-related skin conductance responses." International Journal of Psychophysiology, 75(3), 349-356. doi:10.1016/j.ijpsycho.2010.01.005

Benedek, M., & Kaernbach, C. (2010). "A continuous measure of phasic electrodermal activity." Journal of Neuroscience Methods, 190(1), 80-91. doi:10.1016/j.jneumeth.2010.04.028

See also

edaDecompose for tonic/phasic decomposition (run first), edaFeatures for summary feature extraction, plotPeaks for peak visualization, edaErscr for event-related SCR analysis

Examples

x <- edaSimulate(n_time = 600, sr = 10, seed = 1)
x <- edaDecompose(x)
head(edaPeaks(x))
#>   channel onset_sample onset_sec peak_sample peak_sec  amplitude rise_time
#> 1    EDA1            3       0.2           4      0.3 0.03436609       0.1
#> 2    EDA1            5       0.4           7      0.6 0.01179763       0.2
#> 3    EDA1           13       1.2          14      1.3 0.02700405       0.1
#> 4    EDA1           17       1.6          20      1.9 0.03094935       0.3
#> 5    EDA1           24       2.3          28      2.7 0.02815182       0.4
#> 6    EDA1           31       3.0          32      3.1 0.01031976       0.1
#>   recovery_time
#> 1           0.9
#> 2           0.6
#> 3           0.3
#> 4           0.4
#> 5          39.2
#> 6           0.2