# Discrepancies in maxwell\_filter vs MaxFilter with movement compensation

**URL:** https://mne.discourse.group/t/discrepancies-in-maxwell-filter-vs-maxfilter-with-movement-compensation/11695
**Category:** Support & Discussions
**Created:** [February 18, 2026, 6:19pm UTC](https://mne.discourse.group/t/discrepancies-in-maxwell-filter-vs-maxfilter-with-movement-compensation/11695 "2026-02-18T18:19:35Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rhancock](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/rhancock/32/4634_2.png) [@rhancock](https://mne.discourse.group/u/rhancock)
#### Post date: [February 18, 2026, 6:19pm UTC](https://mne.discourse.group/t/discrepancies-in-maxwell-filter-vs-maxfilter-with-movement-compensation/11695/1 "2026-02-18T18:19:36Z")

</div>

When applying SSS and movement compensation, the MNE `maxwell_filter` implementation (v1.11) introduces broadband noise into the spectra which is not seen using (I think) the equivalent MaxFilter command. Is there a difference in the Maxwell-filter implementation that would account for this?

 ![PSD of raw data](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/e/eeb36e2a70c4e9c3eba365a9e782160c007af8f3.jpeg)

 ![PSD after MNE maxwell_filter](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/5/5896d90534e2bbced9109b080ac18260443f62e2.jpeg)

 ![PSD after MaxFilters](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/a/a2b7297a4cf47282228f74b81251fe2023de386c.jpeg)

# MNE code:

```python
import mne
import matplotlib.pyplot as plt
raw = mne.io.read_raw('test_raw.fif')
fig = raw.compute_psd().plot()
fig.savefig('psd_raw.png')
plt.close()
amp = mne.chpi.compute_chpi_amplitudes(raw)
locs = mne.chpi.compute_chpi_locs(raw.info, amp)
pos = mne.chpi.compute_head_pos(raw.info, locs)

bads_noisy, bads_flat = mne.preprocessing.find_bad_channels_maxwell(raw)
raw.info['bads'] = bads_noisy + bads_flat

raw_sss = mne.preprocessing.maxwell_filter(raw, origin='auto', coord_frame='head', head_pos=pos)
raw_sss.save('mne_sss.fif', overwrite=True)
fig = raw_sss.compute_psd().plot()
fig.savefig('psd_maxwell_filter.png')
plt.close()

megin_sss = mne.io.read_raw('megin_sss.fif')
fig = megin_sss.compute_psd().plot()
fig.savefig('psd_megin_sss.png')
plt.close()

```

# MaxFilter command:

```shell
/neuro/bin/util/maxfilter \
-f /neuro/data/sinuhe/test_raw.fif \
-o /neuro/data/sinuhe/megin_sss.fif \
-movecomp \
-autobad on \
-frame head \
-origin fit \
-hp /neuro/data/sinuhe/test_hp.pos -v > /neuro/data/sinuhe/test_sss.log 2>&1

```

[Data files](https://drive.google.com/drive/folders/1SEzF3FSHKM9oPYK1rFsRWhqgF8Ic52pL?usp=share_link)

# Sytem information

```python
Platform macOS-26.2-arm64-arm-64bit-Mach-O
Python 3.14.3 | packaged by conda-forge | (main, Feb 9 2026, 22:09:14) [Clang 20.1.8]
Executable /Users/rh687/miniconda3/envs/mne/bin/python
CPU Apple M2 (8 cores)
Memory 24.0 GiB

Core
├☑ mne 1.11.0 (latest release)
├☑ numpy 2.4.2 (unknown linalg bindings (threadpoolctl module not found: No module named 'threadpoolctl'))
├☑ scipy 1.17.0
└☑ matplotlib 3.10.8 (backend=macosx)

```

---

<div class="post-metadata">

### Author: ![wmvanvliet](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/wmvanvliet/32/100_2.png) [@wmvanvliet](https://mne.discourse.group/u/wmvanvliet)
#### Post date: [February 20, 2026, 1:56pm UTC](https://mne.discourse.group/t/discrepancies-in-maxwell-filter-vs-maxfilter-with-movement-compensation/11695/2 "2026-02-20T13:56:48Z")

</div>

Do MNE-Python and maxfilter find the same bad channels?

---

<div class="post-metadata">

### Author: ![rhancock](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/rhancock/32/4634_2.png) [@rhancock](https://mne.discourse.group/u/rhancock)
#### Post date: [March 2, 2026, 9:12pm UTC](https://mne.discourse.group/t/discrepancies-in-maxwell-filter-vs-maxfilter-with-movement-compensation/11695/3 "2026-03-02T21:12:16Z")

</div>

Yes, the discrepancy is not due to bad channel selection.
