# spectral\_connectivity\_time(faverage=True) averages over roughly twice the requested band when a band does not end at the top of the frequency grid

**URL:** <https://mne.discourse.group/t/spectral-connectivity-time-faverage-true-averages-over-roughly-twice-the-requested-band-when-a-band-does-not-end-at-the-top-of-the-frequency-grid/11964>\
**Category:** Support & Discussions\
**Tags:** connectivity\
**Created:** [September 25, 2026, 1:55pm UTC](https://mne.discourse.group/t/spectral-connectivity-time-faverage-true-averages-over-roughly-twice-the-requested-band-when-a-band-does-not-end-at-the-top-of-the-frequency-grid/11964 "2026-09-25T13:55:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marieke.devylder](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@marieke.devylder](https://mne.discourse.group/u/marieke.devylder)\
**Post date:** [September 25, 2026, 1:55pm UTC](https://mne.discourse.group/t/spectral-connectivity-time-faverage-true-averages-over-roughly-twice-the-requested-band-when-a-band-does-not-end-at-the-top-of-the-frequency-grid/11964/1 "2026-09-25T13:55:51Z")

</div>

In mne\_connectivity/spectral/time.py, \_foi\_average contains

`f_e += 1 if f_s == f_e else f_e`

Since Python parses this as f\_e += (1 if f\_s == f\_e else f\_e), a band whose start and end bins differ gets its end index doubled instead of incremented. With freqs = np.linspace(1, 45, 133) and fmin=(1, 8, 13), fmax=(4, 13, 30), the delta average covers 1 to 7 Hz, alpha 8 to 24.7 Hz while you expect 8 to 13 Hz.

Introduced in commit 4476efae (PR #104), released in 0.5 (2023-01-14); still present on main at the same line. spectral\_connectivity\_epochs has its own averaging and is not affected. Is this a real bug or am I missing something?

Thank you!

Marieke

---

<div class="post-metadata">

**Author:** ![tsbinns](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/tsbinns/32/4543_2.png) [@tsbinns](https://mne.discourse.group/u/tsbinns)\
**Post date:** [September 25, 2026, 4:54pm UTC](https://mne.discourse.group/t/spectral-connectivity-time-faverage-true-averages-over-roughly-twice-the-requested-band-when-a-band-does-not-end-at-the-top-of-the-frequency-grid/11964/2 "2026-09-25T16:54:04Z")

</div>

Hi Marieke,

Welcome to the forums, and thanks for raising this!

That’s not the intended behaviour, and should be fixed. I’ve opened an [issue](https://github.com/mne-tools/mne-connectivity/issues/477) to track this.

A PR would be welcome, if you are comfortable submitting one. Otherwise, I could pick this up.

Cheers,  
Thomas

---

<div class="post-metadata">

**Author:** ![marieke.devylder](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@marieke.devylder](https://mne.discourse.group/u/marieke.devylder)\
**Post date:** [September 25, 2026, 7:16pm UTC](https://mne.discourse.group/t/spectral-connectivity-time-faverage-true-averages-over-roughly-twice-the-requested-band-when-a-band-does-not-end-at-the-top-of-the-frequency-grid/11964/3 "2026-09-25T19:16:37Z")

</div>

Hi Thomas,

Thanks a lot for your quick reply and for confirming. I opened a PR: [[MRG] Fix faverage end index in spectral\_connectivity\_time by mariekedevylder · Pull Request #479 · mne-tools/mne-connectivity · GitHub](https://github.com/mne-tools/mne-connectivity/pull/479) . It applies the change you proposed, adds a test comparing faverage=True against the mean of the per-frequency output, and includes the changelog entry. It is my first contribution here, so please let me know if I missed anything.

Thank you!

Marieke
