lciti / cvxEDA

Algorithm for the analysis of electrodermal activity (EDA) using convex optimization
GNU General Public License v3.0
63 stars 28 forks source link

Issue with t plot #6

Open frank984 opened 4 years ago

frank984 commented 4 years ago

I have read your article entitled "cvxEDA: A Convex Optimization Approach to Electrodermal Activity Precessing" and then I tried to use cvxEDA in order to decompose an Empatica E4 EDA file in: -raw SC signal -phasic component -tonic component. The result is here below: image I don't understand why the tonic component is is practically equal to phasic component x -1 The code I used is as follow:

yn = (y - y.mean()) / y.std()
Fs = 25.
#Fs = 125.
[r, p, t, l, d, e, obj] = cvxEDA.cvxEDA(yn, 1./Fs)
import pylab as pl
tm = pl.arange(1., len(y)+1.) / Fs
pl.plot(tm, yn, label='yn')
pl.plot(tm, r, label='phasic component')
#pl.plot(tm, p, label='sparse SMNA driver of phasic component')  #sudomotor nerve activity = (SMNA)
pl.plot(tm, t, label='tonic component')
pl.legend()
pl.xlabel("T(sec)")
pl.ylabel("\u03BCS")  ## 'mu: \u03BC' for other special characters: //https://pythonforundergradengineers.com/unicode-characters-in-python.html
pl.show()

The raw EDA file is reported here below: EDA.zip

lciti commented 4 years ago

Hi Frank. It looks like the data are affected by some baseline shift artifacts. Possibly the electrical contact between pad and skin weakens around t=375 and goes back to normal at about t=433 (same thing happens between t=903 and t=932). artifact This could be due to the participants moving their hands, etc. Unfortunately the algorithm is not robust to such artifacts. In addition to these more evident cases, there are a number of smaller artifacts that lead the algorithm astray such as this: artifact That downward step cannot be explained by a change in skin conductance (as SC can only increase rapidly due to sweat gland activation and decrease slowly due to evaporation) and must be caused by a sudden decrease in the skin-to-electrode conductance. We are working on some improvement of the algorithm and hopefully will be able to address these cases in a future version.

frank984 commented 4 years ago

Thank you for your prompt reply. I tried to use also your script in combination with the artifact detection capability offered by EDA artifacts. But the EDA-Artifact-Detection-Script.py output classifies the data over a 5 sec period. It would be very great to combine the functionality of the two scripts.

ManonPeeters commented 7 months ago

hi @lciti our research group is trying to apply the cvxEda on EDA data collected in the field. We also see profound negative tonic values, not matching what one would expect given what the tonic values should represent. The phasic values hower seem feasible. My question: if you see tonic values which are deviant from what one would expect (like in the case of frank984), can you still use the phasic driver? Are there any solutions for this problem? Best, Manon