Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eda/_eda_findpeaks_vanhalem2020 function does not calculate Skin conductance height correctly #780

Closed
GanshengT opened this issue Feb 14, 2023 · 1 comment

Comments

@GanshengT
Copy link

The recovery of skin conductance response is miscalculated in eda_peaks() when using vanhalem2020 method. I think the problem is that the height of the skin conductance response is miscalculated or defined incorrectly in eda/_eda_findpeaks_vanhalem2020.

Describe the bug
info = {
"SCR_Onsets": info["Onsets"][idx],
"SCR_Peaks": info["Peaks"][idx],
"SCR_Height": info["Height"][idx],
}
info["Height"][idx] is calculated with nk.signal_findpeak(). I think in eda_peaks() function, the offset/recovery of skin conductance response is based on the peak value of each peak, instead of the height of the peak defined in nk.signal_findpeak().

To Reproduce
eda_signal = nk.data("bio_eventrelated_100hz")["EDA"]
_, vanhalem2020 = nk.eda_peaks(data2plot['cda_phasic'], method="vanhalem2020", sampling_rate=100)

Expected behaviour
I think "SCR_Height": eda_phasic[peaks["Peaks"]] might fix the problem.

Screenshots
purple denotes the onsets from vanhalem2020, and red lines denote the recovery/offset.
Screen Shot 2023-02-14 at 4 48 33 PM

@GanshengT
Copy link
Author

Mentioned issue has been fixed. There is another concern left for discussion: in the current script, if eda signals ends before the peak recovers, the offset will not be detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant