From b4eea7f8fb0f9feecda5c261b37c9310d1d8fb02 Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Date: Mon, 24 Jun 2024 11:42:35 -0300 Subject: [PATCH] Change SMA smoothing to always include current point It is the common practice, and it works that way on forward mode, but in backward mode current point was excluded from the average. --- src/Core/Utils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Core/Utils.cpp b/src/Core/Utils.cpp index a374323d8..e4d9848bd 100644 --- a/src/Core/Utils.cpp +++ b/src/Core/Utils.cpp @@ -526,8 +526,8 @@ smooth_sma(QVector&data, int pos, int window, int samples) break; case GC_SMOOTH_BACKWARD: - window_end=0; - window_start=window *-1; + window_end=1; + window_start=window *-1 + 1; break; case GC_SMOOTH_CENTERED: // we should handle odd/even size better