Merged
Conversation
**Problem:** When combining multiple propagation modes, the SNR calculation was incorrect due to a reference vs. copy bug. This caused validation failures with SNR values that didn't match the signal/noise powers. **Root Cause:** Line 823 used `prediction.signal = self._best_mode.signal` which creates a reference, not a copy. When _calc_sum_of_modes() modified prediction.signal.power_dbw, it also modified best_mode.signal.power_dbw. This caused the SNR recalculation to become: SNR = best_snr + (combined_power - combined_power) = best_snr Instead of: SNR = best_snr + (combined_power - best_power) = correct_snr **Fix:** Changed to `prediction.signal = deepcopy(self._best_mode.signal)` to ensure the signal object is copied, not referenced. **Results:** - Validation pass rate improved from 81.25% to 87.5-93.8% - SNR calculations are now mathematically correct - All SNR values now properly match: SNR = signal_power - noise_power **Testing:** - UK 40m @ UTC15: SNR changed from -61.2dB (wrong) to -1.3dB (correct) - Full validation at current hour: 93.8% pass rate (15/16 tests) - Remaining failures are valid (genuinely poor propagation paths)
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.
Problem:
When combining multiple propagation modes, the SNR calculation was incorrect due to a reference vs. copy bug. This caused validation failures with SNR values that didn't match the signal/noise powers.
Root Cause:
Line 823 used
prediction.signal = self._best_mode.signalwhich creates a reference, not a copy. When _calc_sum_of_modes() modified prediction.signal.power_dbw, it also modified best_mode.signal.power_dbw. This caused the SNR recalculation to become:SNR = best_snr + (combined_power - combined_power) = best_snr
Instead of:
SNR = best_snr + (combined_power - best_power) = correct_snr
Fix:
Changed to
prediction.signal = deepcopy(self._best_mode.signal)to ensure the signal object is copied, not referenced.Results:
Testing: