SEL CWS / rolling phase estimator: V/I ordering fix, optimizations, missing-data handling, and unit tests#538
Merged
Merged
Conversation
…h optimizations - Remove duplicate reference-angle Atan2; replace publish-schedule zero-ns sentinel with a bool flag - Hoist constant subexpressions out of the per-sample/per-publish hot paths (RMS magnitude scale, 1-alpha EMA complements, frequency clamp bounds) - Replace per-sample buffer-index modulo with compare/reset and the recalc trigger with an aligned countdown - Simplify instantaneous frequency to deltaPhase/(2*pi*dt) (algebraically equivalent, fewer ops, better conditioning) - Add FUTURE notes for positive-sequence frequency source and quality reporting Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…hase estimator Detects dropped samples from the input timestamp cadence and either coasts small gaps with phase-continued synthesis or resynchronizes large ones; adds the MaxGapFillSamples parameter. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ator Adds GSF.PhasorProtocols.Tests (MSTest) covering frequency, magnitude, angle and the coast/resync gap handling; exposes internals via InternalsVisibleTo and retires the stale in-library test harness. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ard timestamp A non-increasing input timestamp (e.g., source restart/loop or a re-basing config frame) no longer wedges reporting: a backward jump resets onto the new timeline and a duplicate is skipped, so estimates resume after the window refills.
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.
Hardens the SEL CWS (continuous wave streaming) rolling phase estimator and adds test coverage. Built on the discovery that SEL CWS transmits voltages before currents (VA, VB, VC, IA, IB, IC) — the opposite of the original assumption: