Add frequency-domain coherence estimation with resolution mapping#11
Draft
Copilot wants to merge 12 commits intofeature-freq-domain-shiftsfrom
Draft
Add frequency-domain coherence estimation with resolution mapping#11Copilot wants to merge 12 commits intofeature-freq-domain-shiftsfrom
Copilot wants to merge 12 commits intofeature-freq-domain-shiftsfrom
Conversation
Co-authored-by: Screeen <20363442+Screeen@users.noreply.github.com>
Co-authored-by: Screeen <20363442+Screeen@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add frequency-domain coherence shifts module
Implement frequency-domain coherence shifts with interpolation modes
Feb 18, 2026
Co-authored-by: Screeen <20363442+Screeen@users.noreply.github.com>
Copilot
AI
changed the title
Implement frequency-domain coherence shifts with interpolation modes
Fix spurious warning in coherence manager zero-frequency check
Feb 18, 2026
Co-authored-by: Screeen <20363442+Screeen@users.noreply.github.com>
Copilot
AI
changed the title
Fix spurious warning in coherence manager zero-frequency check
Enforce zero at first position in modulation sets and add high-res STFT config
Feb 18, 2026
Co-authored-by: Screeen <20363442+Screeen@users.noreply.github.com>
Co-authored-by: Screeen <20363442+Screeen@users.noreply.github.com>
Copilot
AI
changed the title
Enforce zero at first position in modulation sets and add high-res STFT config
Fix alpha ordering mismatch between coherence computation methods
Feb 18, 2026
…ameters and adjustments
…rison test Co-authored-by: Screeen <20363442+Screeen@users.noreply.github.com>
Copilot
AI
changed the title
Fix alpha ordering mismatch between coherence computation methods
Fix max_bin calculation for DFT coherence method
Feb 18, 2026
Copilot stopped work on behalf of
Screeen due to an error
February 18, 2026 12:58
Co-authored-by: Screeen <20363442+Screeen@users.noreply.github.com>
Copilot
AI
changed the title
Fix max_bin calculation for DFT coherence method
Implement frequency-domain coherence with DFT/STFT modes and fix alpha=0 selection
Feb 18, 2026
Co-authored-by: Screeen <20363442+Screeen@users.noreply.github.com>
Copilot
AI
changed the title
Implement frequency-domain coherence with DFT/STFT modes and fix alpha=0 selection
Add frequency-domain coherence estimation with resolution mapping
Feb 18, 2026
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.
Overview
Implements frequency-domain coherence path alongside existing time-domain modulation for A/B verification. Fixes critical bugs in alpha selection, frequency resolution handling, and bin mapping that caused IndexError crashes and poor performance.
Implementation
New coherence method (
coherence_manager.py):compute_coherence_freq_shifted(): Computes coherence via frequency shifts instead of time-domain modulationConfiguration (
default.yaml):Bug Fixes
1. Alpha ordering mismatch
Time-domain sorts alphas via
Modulator.unique_with_relative_tolerance_fast(), freq-domain was using input order. Now both sort identically (correlation: -0.39 → 0.87).2. Wrong max_bin calculation
DFT was using STFT's delta_f instead of its own, analyzing 3× too much data. Now calculates method-specific delta_f (70% fewer bins for DFT).
3. Alpha=0 exclusion from unstable sort
When 6+ alphas have coherence=1.0 and P_max_cfg=5, numpy's argsort could arbitrarily exclude alpha=0. Now explicitly reserves first slot for alpha=0.
4. Frequency bin resolution mismatch (IndexError)
Coherence computed at high-res (e.g., 2048 FFT → 1025 bins), but beamforming uses low-res (512 FFT → 257 bins). Indexing
harmonic_sets[1036]crashed. Now maps via frequency:Test Coverage
27 new tests covering interpolation modes, resolution mapping, alpha selection edge cases, and method equivalence. All 100 tests passing.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.