From d7952b1a563134836881423488d8de94c1b5abbb Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Fri, 25 Sep 2020 17:33:05 +0200 Subject: [PATCH] Correct marker frequency error --- sa_core.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sa_core.c b/sa_core.c index 0555094..632ad3b 100644 --- a/sa_core.c +++ b/sa_core.c @@ -2338,20 +2338,26 @@ sweep_again: // stay in sweep loop when output mo } else if (setting.measurement == M_STOP_BAND && markers[0].index > 10) { // -------------Stop band measurement markers[1].index = marker_search_left_min(markers[0].index); if (markers[1].index < 0) markers[1].index = 0; + markers[1].frequency = frequencies[markers[1].index]; markers[2].index = marker_search_right_min(markers[0].index); if (markers[2].index < 0) markers[1].index = setting._sweep_points - 1; + markers[2].frequency = frequencies[markers[2].index]; } else if (setting.measurement == M_PASS_BAND && markers[0].index > 10) { // ----------------Pass band measurement int t = markers[0].index; float v = actual_t[t]; while (t > 0 && actual_t[t] > v - 6.0) // Find left -3dB point t --; - if (t > 0) + if (t > 0) { markers[1].index = t; + markers[1].frequency = frequencies[t]; + } t = markers[0].index; while (t < setting._sweep_points - 1 && actual_t[t] > v - 6.0) // find right -3dB point t ++; - if (t < setting._sweep_points - 1 ) + if (t < setting._sweep_points - 1 ) { markers[2].index = t; + markers[2].frequency = frequencies[t]; + } } else if (setting.measurement == M_AM) { // ----------------AM measurement if (S_IS_AUTO(setting.agc )) { if (actual_t[max_index[0]] - get_attenuation() > -20 ) {