Repository navigation
Conversation
multiple_band_pass only rejected frequency <= 0, so a center at or above fs/2 passed through to the sampled cosine/sine kernel, which aliases it onto a lower frequency instead of raising. high_fq_range ="auto" built its grid with np.linspace up to fs/2 inclusive, so it hit this exact case on its last point every time. Added the upper bound check and dropped the Nyquist point from the auto grid.
Author
|
Hi, just checking in on this one. It's a small, self-contained fix (rejecting bandpass centers at or above Nyquist, fixing the auto grid endpoint), still mergeable with no conflicts. Let me know if anything needs changing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #41
multiple_band_passonly checkedfrequency <= 0, with no upper bound. A center at or above the Nyquist frequency (fs / 2) passed straight through to the sampled cosine/sine kernel, which aliases it onto a lower frequency instead of raising:high_fq_range="auto"built its grid withnp.linspace(..., fs / 2.0, 80), which includesfs / 2as its last point by default, so the auto grid hit this exact case on every call.Fix:
multiple_band_passnow raisesValueErrorfor any center>= fs / 2, matching the existing style of thefrequency <= 0check right above it."auto"grid drops any point that landed at or pastfs / 2instead of including it.Verified against the reproduction from #41: centers at 500 and 550 Hz (fs=1000) now raise, the auto grid's last point is below Nyquist and the comodulogram still fits cleanly, and a normal below-Nyquist center is unaffected. Added a regression test (
test_high_fq_range_rejects_nyquist_and_above) that fails on the pre-fix code and passes after. Ran the fulltest_comodulogram.py: same pre-existing failures as on an unmodified checkout (dependency-version issues unrelated to this change), nothing new broken.flake8clean on the three changed files.I scoped this to the validation + auto-grid fix from the issue's first proposed point. Left the exact-Nyquist special-case documentation and the general bandwidth-margin-near-DC/Nyquist discussion (the issue's second and third points) out of this PR, since they're design questions rather than a single scoped fix.