Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

Commit 396bff2

Browse files
committed
Merge branch 'pr/24'
2 parents 1917f67 + baed303 commit 396bff2

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

AUTHORS renamed to AUTHORS.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ various contributors:
44
Development Lead
55
----------------
66

7-
- Carlos Carreiras <[email protected]>
7+
- Carlos Carreiras (<[email protected]>)
88

99
Main Contributors
1010
-----------------
1111

12-
- Ana Priscila Alves <[email protected]>
13-
- André Lourenço <[email protected]>
14-
- Filipe Canento <[email protected]>
15-
- Hugo Silva <[email protected]>
12+
- Ana Priscila Alves (<[email protected]>)
13+
- André Lourenço (<[email protected]>)
14+
- Filipe Canento (<[email protected]>)
15+
- Hugo Silva (<[email protected]>)
1616

1717
Scientific Supervision
1818
----------------------
@@ -24,4 +24,4 @@ Patches and Suggestions
2424

2525
- Hayden Ball (PR/7)
2626
- Jason Li (PR/13)
27-
- Dominique Makowski (PR/15)
27+
- Dominique Makowski (<[email protected]>) (PR/15, PR/24)
File renamed without changes.

biosppy/signals/eda.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# -*- coding: utf-8 -*-
1+
# -*- coding: utf-8 -*-
22
"""
33
biosppy.signals.eda
44
-------------------
@@ -23,7 +23,7 @@
2323
from .. import plotting, utils
2424

2525

26-
def eda(signal=None, sampling_rate=1000., show=True):
26+
def eda(signal=None, sampling_rate=1000., show=True, min_amplitude=0.1):
2727
"""Process a raw EDA signal and extract relevant signal features using
2828
default parameters.
2929
@@ -35,6 +35,8 @@ def eda(signal=None, sampling_rate=1000., show=True):
3535
Sampling frequency (Hz).
3636
show : bool, optional
3737
If True, show a summary plot.
38+
min_amplitude : float, optional
39+
Minimum treshold by which to exclude SCRs.
3840
3941
Returns
4042
-------
@@ -76,7 +78,7 @@ def eda(signal=None, sampling_rate=1000., show=True):
7678
mirror=True)
7779

7880
# get SCR info
79-
onsets, peaks, amps = kbk_scr(signal=filtered, sampling_rate=sampling_rate)
81+
onsets, peaks, amps = kbk_scr(signal=filtered, sampling_rate=sampling_rate, min_amplitude=min_amplitude)
8082

8183
# get time vectors
8284
length = len(signal)
@@ -169,7 +171,7 @@ def basic_scr(signal=None, sampling_rate=1000.):
169171
return utils.ReturnTuple(args, names)
170172

171173

172-
def kbk_scr(signal=None, sampling_rate=1000.):
174+
def kbk_scr(signal=None, sampling_rate=1000., min_amplitude=0.1):
173175
"""KBK method to extract Skin Conductivity Responses (SCR) from an
174176
EDA signal.
175177
@@ -181,7 +183,9 @@ def kbk_scr(signal=None, sampling_rate=1000.):
181183
Input filterd EDA signal.
182184
sampling_rate : int, float, optional
183185
Sampling frequency (Hz).
184-
186+
min_amplitude : float, optional
187+
Minimum treshold by which to exclude SCRs.
188+
185189
Returns
186190
-------
187191
onsets : array
@@ -218,7 +222,7 @@ def kbk_scr(signal=None, sampling_rate=1000.):
218222
zeros = zeros[:-1]
219223

220224
# exclude SCRs with small amplitude
221-
thr = 0.1 * np.max(df)
225+
thr = min_amplitude * np.max(df)
222226

223227
scrs, amps, ZC, pks = [], [], [], []
224228
for i in range(0, len(zeros) - 1, 2):

0 commit comments

Comments
 (0)