From 764bce52fe239f04038fbb9f86152bc4866e60b0 Mon Sep 17 00:00:00 2001 From: Jon Beniston Date: Thu, 31 Oct 2024 12:42:46 +0000 Subject: [PATCH] Fix spectrum peak measurement for SSB spectra. Fixes #2282. --- sdrgui/gui/glspectrumview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdrgui/gui/glspectrumview.cpp b/sdrgui/gui/glspectrumview.cpp index 1df1d9d54..4ec3cc976 100644 --- a/sdrgui/gui/glspectrumview.cpp +++ b/sdrgui/gui/glspectrumview.cpp @@ -2423,7 +2423,8 @@ void GLSpectrumView::peakWidth(const Real *spectrum, int center, int &left, int float prevRight = spectrum[center]; left = center - 1; right = center + 1; - while ((left > maxLeft) && (spectrum[left] < prevLeft) && (right < maxRight) && (spectrum[right] < prevRight)) + // Use <= as SSB spectrums have duplicated values + while ((left > maxLeft) && (spectrum[left] <= prevLeft) && (right < maxRight) && (spectrum[right] <= prevRight)) { prevLeft = spectrum[left]; left--;