Mne-python: RFC: Remove "spectrum_fit" from notch filter

Created on 7 Apr 2020  路  5Comments  路  Source: mne-tools/mne-python

I have never really gotten it to work in practice, and users on Gitter are unhappy that it takes ages to run. I wonder if we should deprecate and remove it, as I'm not sure if fixing it is even really feasible.

Most helpful comment

I just want to confirm, in case that can be useful, that, as it has been mentioned in #7598, at least part of the very long processing for this function comes from the fact that the algorithm is applied on the whole raw file (or at least, much too long part of it). I pinpointed for my case where it was hanging and it was at the line dpss = _get_dpss()(N, half_nbw, Kmax) in the function dpss_windows(...). It resulted in a call equivalent to scipy.signal.windows.dpss(100000, 3383.0, 6766) which takes forever. It now works quite well and within an acceptable time with #7609, using filter_length='10s'.

All 5 comments

Maybe we should move it to sandbox? But I'm fine either way.

this is relevant to https://github.com/sappelhoff/pyprep/issues/18

@yjmantilla

edit: This is the part in the gitter discussion that Eric referred to.

What I can contribute to this is that in the tests mentioned in sappelhoff/pyprep#21 it seems that the agreement between the prep cleanline method and the mne spectrum notch is high but I haven't really tested it focusing on that part. Maybe doing some simulations would help us determining if it is worthwhile leaving it there.

@mmagnuski suggested that this deficiency might be due to not operating on windows of raw data, which is entirely possible. I've opened a PR to make a general overlap-add processing class in #7598 that would hopefully make it easy to do so.

I just want to confirm, in case that can be useful, that, as it has been mentioned in #7598, at least part of the very long processing for this function comes from the fact that the algorithm is applied on the whole raw file (or at least, much too long part of it). I pinpointed for my case where it was hanging and it was at the line dpss = _get_dpss()(N, half_nbw, Kmax) in the function dpss_windows(...). It resulted in a call equivalent to scipy.signal.windows.dpss(100000, 3383.0, 6766) which takes forever. It now works quite well and within an acceptable time with #7609, using filter_length='10s'.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kingjr picture kingjr  路  36Comments

rob-luke picture rob-luke  路  51Comments

kingjr picture kingjr  路  66Comments

arthurlgk picture arthurlgk  路  33Comments

kingjr picture kingjr  路  35Comments