Notch filter to remove power-line noise

Hi all,

I’m trying to apply a notch filter to remove power-line noise using the method described here.

Here’s my signal before the filter:

I then apply the notch filter and get this:

The notch filter seems to work “too well” and instead of removing the noise, it removes the entire band. Is there a better way to “regress” or attenuate the power-line noise without losing the entire frequency band?


Hi @MichaelSel it’d be helpful if you could share the exact filter call that you are using. Furthermore, the example that you linked to is about MNE version 0.17 … could you try this with the current stable MNE version 0.23?

That’s exactly what notch filters are supposed to do. They attenuate the frequency band, which implies that you cannot use it for further analysis. There are alternative methods that try to remove just the power line signal, for example ZapLine and CleanLine, but they are not available in MNE.

I remember some discussions that MNE-Python’s notch_filter with method=="spectrum_fit" as a parameter was supposed to be a “cleanline”-like approach.

See also the parameter description from the docstring:

‘spectrum_fit’ will use multi-taper estimation of sinusoidal components. If freqs=None and method=’spectrum_fit’, significant sinusoidal components are detected using an F test, and noted by logging.

However, this method for notch filtering in MNE-Python is probably still suffering from some bugs, see also: MNE Multitaper notch filter consumes a lot of RAM. · Issue #18 · sappelhoff/pyprep · GitHub

1 Like