fix: xNoiseSanPlot refined negative noise read from wrong array#386
Open
lpatiny wants to merge 4 commits into
Open
fix: xNoiseSanPlot refined negative noise read from wrong array#386lpatiny wants to merge 4 commits into
lpatiny wants to merge 4 commits into
Conversation
The refined negative noise level was indexed out of cloneSignPositive (the positive signal) using the negative clone's length, a copy-paste error. It now reads from cloneSignNegative and negates it, matching the initial negative-noise formula, so with refine enabled the reported negative level reflects the negative signal.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #386 +/- ##
==========================================
+ Coverage 97.13% 97.15% +0.02%
==========================================
Files 207 209 +2
Lines 4147 4148 +1
Branches 1036 1030 -6
==========================================
+ Hits 4028 4030 +2
+ Misses 115 114 -1
Partials 4 4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jobo322
reviewed
Jul 10, 2026
| noiseLevelNegative = | ||
| cloneSignPositive[ | ||
| -1 * | ||
| cloneSignNegative[ |
Member
There was a problem hiding this comment.
seems to me that cutOffSignalsIndexNeg would be always zero. because cutOffSignals defined positive. So there is not a refinning for noiseLevelNegative.
…eNormInvRaw in xNoiseSanPlot
Member
Member
|
@lpatiny could you have a look, I propose use negative data to find the negative noise level |
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.




Bug
In the
refinebranch ofxNoiseSanPlot, the refined negative noise level was read fromcloneSignPositive(the positive signal) while indexing withcloneSignNegative.length— a copy-paste error from the positive branch just above. Withrefine: true(the default), the reportednegativelevel did not reflect the negative signal at all.The fix reads from
cloneSignNegativeand negates it, mirroring the initial negative-noise formula (-1 * signNegative[...]). Added a regression assertion: the refined negative level is now positive and of the same order as the positive one.All 2230 tests pass.
For your review, @jobo322 — a second, separate issue I did not touch
determineCutOffaccumulatesaverageValueas a plain sum and then uses it as a mean in(element[1] - averageValue)², sokiSqrtisn't the intended dispersion measure and the chosen cut-off is likely skewed. DividingaverageValuebyelementsOfCutOff.lengthlooks correct, but it changes the magnitude-mode SNR on the test spectrum from ~40.2 to ~63.5 — a real behavioral change to the published-method output. I left it as-is since that needs your domain judgment on what the reference value should be. Happy to open a follow-up if you confirm the intended behavior.