1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-21 15:51:47 -05:00

Merge pull request #2299 from srcejon/fix_2282

Fix spectrum peak measurement for SSB spectra.
This commit is contained in:
Edouard Griffiths 2024-10-31 16:25:14 +01:00 committed by GitHub
commit 618e234d6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2423,7 +2423,8 @@ void GLSpectrumView::peakWidth(const Real *spectrum, int center, int &left, int
float prevRight = spectrum[center]; float prevRight = spectrum[center];
left = center - 1; left = center - 1;
right = 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]; prevLeft = spectrum[left];
left--; left--;