Outlier-search algorithm based on issue #385#388
Merged
tomeichlersmith merged 11 commits intomainfrom Apr 1, 2026
Merged
Conversation
…re still pending.
tomeichlersmith
approved these changes
Apr 1, 2026
Member
tomeichlersmith
left a comment
There was a problem hiding this comment.
Thank you :) plots look good
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.
Following the ADC irregularities for charge-injections found in Lund for some boards, I created an algorithm that scans parameter-time-scan data for outliers. The script assumes the irregularities to be less frequent than the "normal" results, and hence requires at least 10 samples per time-point for comparison. Using this data, the algorithm calculates the ADC mode for each time-point, as seen in the figure below.
Next, the script checks the ADC codes above and below the mode, one by one. If a gap of 2 or more is found (2+ ADC codes are not contained by any sample at the specific time-point), the points that follow are marked as an "outlier" or "potential outlier" cluster. Gaps of 1 are ignored to account for natural fluctuations or irregularities that can be found in any board, but this can be adjusted in the code. The resulting analysis can then be saved as a csv, with outlier frequency noted per sample. This can be used for quick board-evaluation, as the false-positive rate seems to be fairly low (about 1% from the tests I've done).
Taking the board from #385 as an example, the samples are split as follows.
The algorithm provides additional options for plotting and analysis. The samples can be viewed one-by-one with the "SINGULAR" option for plots:
A phase-analysis function (with plots) is also included:
Lastly, a somewhat deprecated method for finding outliers is left as an option. This method (the threshold scan), focuses on the ADC differences between subsequent time-points, marking differences larger than an arbitrary threshold as outliers, and does not require multiple samples. This method is fairly flawed, especially since it requires setting arbitrary thresholds, but I believe it could still be occasionally useful (though I can remove it).