neuropsychology / NeuroKit

NeuroKit2: The Python Toolbox for Neurophysiological Signal Processing
https://neuropsychology.github.io/NeuroKit
MIT License
1.46k stars 397 forks source link

Filtering EDA peaks in long signals #1003

Open manasa-kalanadhabhatta opened 1 week ago

manasa-kalanadhabhatta commented 1 week ago

Describe the solution you'd like When using the kim2004 (and possibly neurokit) method in eda_peaks(), the min amplitude threshold of 10% for filtering SCR peaks is based on the maximum peak amplitude in the entire signal. This makes sense for a signal that is a few seconds long (like the 50s windows in Kim et al.). However, for arbitrarily long signals (> few minutes), this filters out valid peaks if the peak amplitudes change with time or if there are signal artifacts that are recognized as the largest peak.

How could we do it? Filtering peaks should be done based on local maxima, possibly using a sliding window. Or, it could be useful to update the documentation to recommend applying eda_peaks() on smaller chunks when dealing with longer signals.

welcome[bot] commented 1 week ago

Hi 👋 Thanks for reaching out and opening your first issue here! We'll try to come back to you as soon as possible. ❤️ kenobi

DominiqueMakowski commented 1 week ago

That sounds like a good idea. Would you mind making a PR to mention this in the function documentation?