From e1774ce6d93dc41074a7cf48447278209cce658c Mon Sep 17 00:00:00 2001 From: Mikolaj Wielgus Date: Tue, 4 Nov 2025 05:28:02 +0100 Subject: [PATCH] fix(stepper): Correct SMA rate formula to divide change by sampling time interval --- src/stepper.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stepper.rs b/src/stepper.rs index 8a0fc92..c61fae5 100644 --- a/src/stepper.rs +++ b/src/stepper.rs @@ -163,7 +163,7 @@ impl SmaRateReconfigurationTrigger { let mut total_popped = 0.0; for _ in 0..count { - let pushed = delta / count as f64; + let pushed = (delta / count as f64) / self.sampling_interval_secs; self.sample_buffer.push_back(delta / count as f64); total_pushed += pushed;