-
-
Notifications
You must be signed in to change notification settings - Fork 437
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
Problem with EDA analysis because of low sampling rate (Empatica E4) #554
Comments
Hi @FMJanot, welcome to github As you can see; the SR of your data is below NK's default cleaning method filtering range: NeuroKit/neurokit2/eda/eda_clean.py Lines 81 to 84 in c110438
You could try using the other method, biosppy. The two other possible workarounds that I see currently are:
Few things for us (@zen-juen @Tam-Pham):
NeuroKit/neurokit2/eda/eda_clean.py Lines 100 to 101 in c110438
|
Like @DominiqueMakowski suggested you can use your own custom processing pipeline. Here is what I used instead of the 'eda_process' function. Every other EDA function can work as expected if you use this custom processing pipeline for data from Empatica. def eda_custom_process(eda_signal, sampling_rate=4, method="neurokit"):
eda_signal = nk.signal_sanitize(eda_signal)
# Series check for non-default index
if type(eda_signal) is pd.Series and type(eda_signal.index) != pd.RangeIndex:
eda_signal = eda_signal.reset_index(drop=True)
# Preprocess
eda_cleaned = eda_signal #Add your custom cleaning module here or skip cleaning
eda_decomposed = nk.eda_phasic(eda_cleaned, sampling_rate=sampling_rate)
# Find peaks
peak_signal, info = nk.eda_peaks(
eda_decomposed["EDA_Phasic"].values,
sampling_rate=sampling_rate,
method=method,
amplitude_min=0.1,
)
info['sampling_rate'] = sampling_rate # Add sampling rate in dict info
# Store
signals = pd.DataFrame({"EDA_Raw": eda_signal, "EDA_Clean": eda_cleaned})
signals = pd.concat([signals, eda_decomposed, peak_signal], axis=1)
return signals, info I basically skip the |
Hi everyone,
I am trying to use NeuroKit2 for EDA analysis. However, there is one problem I have encountered: When trying to process the data, I get an error message that says:
Apparently the sampling rate is too low. I am working with the Empatica E4 wristband. The E4 has a sampling rate of 4 Hz, which cannot be customized. Do you happen to know any way how to solve this problem so that we can continue to work with the NeuroKit2 package? Is it possible to adjust the code in such a way that it will work with 4 Hz?
I'd be happy about any hints or recommendations! Thanks!
The text was updated successfully, but these errors were encountered: