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

Computation of window size based on cutoff frequency in local detrend method #125

Open
danibene opened this issue Oct 19, 2022 · 1 comment
Labels
Matlab PREP Needs coordination/clarification with Matlab PREP

Comments

@danibene
Copy link

Hello :)

I was wondering if it is normal that frequencies below the detrendCutoff in removeTrend() are not completely attenuated, see e.g.: https://gist.github.com/danibene/e3ed1200a75ea72a3c52bfb0ac248a2c

If not, maybe this has something to do with how the windowSize is computed? https://github.com/sappelhoff/pyprep/blob/master/pyprep/removeTrend.py#L92

For more context you can also see neuropsychology/NeuroKit#734 (comment)

@sappelhoff
Copy link
Owner

Hi, thanks for the report!

PyPREP is a port of PREP in MATLAB (https://github.com/VisLab/EEG-Clean-Tools), and I believe the way we calculate the window size has been taken directly from the original PREP code, see:

https://github.com/VisLab/EEG-Clean-Tools/blob/9ac9ea0c21d44b57f9e9f93b62ca727c7b75c73e/PrepPipeline/utilities/removeTrend.m#L79

It's entirely possible that it's wrong in the original PREP code ... if so, I would be open to fixing it here, and documenting it as one further deviation from the original code, as the other listed here: https://pyprep.readthedocs.io/en/latest/matlab_differences.html

Also, you could consider raising this issue at the original PREP repository that I mention above, ... if they also recognize this as an error, they might fix it there, and we can mirror the fix here, without an entry to the "matlab differences" section in the docs that I linked above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Matlab PREP Needs coordination/clarification with Matlab PREP
Projects
None yet
Development

No branches or pull requests

2 participants