Skip to content

Commit 8806b8a

Browse files
FIX: remap lowpass <= 0 to Nyquist in GDF/EDF reader (#13769)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 7e62d83 commit 8806b8a

3 files changed

Lines changed: 3 additions & 1 deletion

File tree

doc/changes/dev/13769.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix bug in when reading EDF/GDF files where non-positive lowpass values were not handled correctly, now mapping them to the Nyquist frequency to prevent errors during plotting, by :newcontrib:`Hansuja Budhiraja`.

doc/changes/names.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
.. _Hakimeh Pourakbari: https://github.com/Hpakbari
118118
.. _Hamid Maymandi: https://github.com/HamidMandi
119119
.. _Hamza Abdelhedi: https://github.com/BabaSanfour
120+
.. _Hansuja Budhiraja: https://github.com/HansujaB
120121
.. _Hari Bharadwaj: https://github.com/haribharadwaj
121122
.. _Harrison Ritz: https://github.com/harrisonritz
122123
.. _Hasrat Ali Arzoo: https://github.com/hasrat17

mne/io/edf/edf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ def _get_info(
975975
_set_prefilter(info, edf_info, filt_ch_idxs, "highpass")
976976
_set_prefilter(info, edf_info, filt_ch_idxs, "lowpass")
977977

978-
if np.isnan(info["lowpass"]):
978+
if np.isnan(info["lowpass"]) or info["lowpass"] <= 0:
979979
info["lowpass"] = info["sfreq"] / 2.0
980980

981981
if info["highpass"] > info["lowpass"]:

0 commit comments

Comments
 (0)