Skip to content

fix: only prepend zeros in polyphase non-streaming when mode="full"#488

Open
robrui wants to merge 1 commit into
mhostetter:mainfrom
robrui:fix/polyphase-rate-mode-alignment
Open

fix: only prepend zeros in polyphase non-streaming when mode="full"#488
robrui wants to merge 1 commit into
mhostetter:mainfrom
robrui:fix/polyphase-rate-mode-alignment

Conversation

@robrui
Copy link
Copy Markdown

@robrui robrui commented May 6, 2026

Fixes the non-streaming polyphase commutate path in _polyphase_input_commutate. When mode="rate", B-1 zeros were incorrectly prepended before commuting, misaligning the signal with the decimation. Now fixed — zeros are only prepended in mode="full".

The streaming path uses separate padding logic and is not affected by this change. All 29 multirate tests pass.

The non-streaming _polyphase_input_commutate path unconditionally prepended B-1 zeros before commuting the signal. This is correct for "full" mode (first sample sits alone in the first commutated column) but incorrect for "rate" mode, where the zeros misalign the signal with decimation.

Only the non-streaming path was modified. The streaming path uses separate padding logic and is unaffected.

Fixes mhostetter#471
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 82.13%. Comparing base (8b8b0b3) to head (ea0d918).
⚠️ Report is 66 commits behind head on main.

Files with missing lines Patch % Lines
src/sdr/_filter/_polyphase.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #488      +/-   ##
==========================================
+ Coverage   81.81%   82.13%   +0.31%     
==========================================
  Files          63       63              
  Lines        3960     4108     +148     
==========================================
+ Hits         3240     3374     +134     
- Misses        720      734      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@robrui robrui marked this pull request as ready for review May 12, 2026 23:21
@mhostetter
Copy link
Copy Markdown
Owner

Thanks. This implements the fix in #471. I'll merge soon.

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.

3 participants