Skip to content

BUG: Fix bug with minimum phase filters#12507

Merged
drammock merged 6 commits intomne-tools:mainfrom
larsoner:minimum_phase
Mar 19, 2024
Merged

BUG: Fix bug with minimum phase filters#12507
drammock merged 6 commits intomne-tools:mainfrom
larsoner:minimum_phase

Conversation

@larsoner
Copy link
Copy Markdown
Member

Closes #12267

No need to wait for the SciPy PR I think since the tests there (and here, including the updated tutorial) show this works correctly.

@larsoner larsoner added this to the 1.7 milestone Mar 19, 2024
Comment on lines +3 to +4
compromised attenuation. Now ``phase="minimum"`` has the same length and comparable
suppression as ``phase="minimum"``, and the old (incorrect) behavior can be achieved
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
compromised attenuation. Now ``phase="minimum"`` has the same length and comparable
suppression as ``phase="minimum"``, and the old (incorrect) behavior can be achieved
compromised attenuation. Now ``phase="minimum"`` has the same length and comparable
suppression as ``phase="zero"``, and the old (incorrect) behavior can be achieved

tautology; I think this is the right repair but @larsoner please confirm

Comment on lines +324 to +328
# that the falloff is not as steep (though here we use a temporary workaround
# version vendored by MNE until https://github.com/scipy/scipy/pull/19706 is
# merged and released):

h_min = signal.minimum_phase(h)
h_min = minimum_phase(h, half=False)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure we want to talk about "vendoring" in our tutorials. Seems like a detail users shouldn't need to know about. Maybe instead just mention which SciPy / MNE versions & params are necessary to get the correct behavior?

@larsoner
Copy link
Copy Markdown
Member Author

Fixed, can you see if the wording is good enough now @drammock ?

@drammock drammock enabled auto-merge (squash) March 19, 2024 16:42
@drammock drammock merged commit 415e7f6 into mne-tools:main Mar 19, 2024
@drammock drammock deleted the minimum_phase branch March 19, 2024 17:27
snwnde pushed a commit to snwnde/mne-python that referenced this pull request Mar 20, 2024
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Daniel McCloy <dan@mccloy.info>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Potential problem with causal filters

2 participants