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

nt_zapline_plus: nremove checked on wrong dimension #12

Open
0xlevel opened this issue Sep 18, 2022 · 4 comments
Open

nt_zapline_plus: nremove checked on wrong dimension #12

0xlevel opened this issue Sep 18, 2022 · 4 comments

Comments

@0xlevel
Copy link

0xlevel commented Sep 18, 2022

In v1.2.1 nt_zapline_plus, line 54, if nremove>=size(x,1); error('!'); end checks the wrong dimension. I think, it should be size(x,2).

I encountered this when trying to use zapline plus to clean two channels, only. An exception will be thrown later (in line 146), but I thought, you might want to know. The error can be bypassed by using fixed error components (= 1), but can perhaps be addressed, when set to adaptive.
It is also possible, that I missed something and in that case I would be glad for advice.
Cheers!

@MariusKlug
Copy link
Owner

I can confirm this, I think you are right. I recommend setting this to the second dimension and using adaptive cleaning instead of fixed cleaning with 1 dimension.

Although I do think that using zapline-plus for two channels only will likely to be problematic as spatial filtering requires at least some precision there. Where does your EEG data come from?

@0xlevel
Copy link
Author

0xlevel commented Sep 19, 2022

Hi, thank you for your reply. I agree, that the 2 ch setup was indeed a very special case (see below). ;) I wanted to quickly pass on my observation, though, as adaptive cleaning also failed in my case.
My use case was somewhat abductive, to put it mildly: I was briefly looking into methods to remove power line interference from EMG(!) data. A notch around 50 Hz (in my case) would already destroy too much information.

@MariusKlug
Copy link
Owner

Yeah it is a valid bug report, so thanks :)

I see. Hmm, maybe in your case the cleanline function of EEGLAB might be more useful, or did zapline in the end work for you?

@0xlevel
Copy link
Author

0xlevel commented Sep 19, 2022

You are welcome. :) Yes, cleanline works fine, but has trouble working with non-stationary noise. I also looked into PREP’s cleanLineNoise, which seems a bit excessive and the implementation of the Regression-Subtraction method (Mewett, 2001) by Eiber & Pietersen, which also works, but would require some additional effort.
So, yeah, Zapline plus is still tempting, but perhaps later™. Cheers!

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

2 participants