From fa90bc4424167928eb884e11a71e4944e7254427 Mon Sep 17 00:00:00 2001 From: Marc Majoral Date: Fri, 30 Aug 2019 17:02:17 +0200 Subject: [PATCH] fixed cn0_and_tracking_lock_status --- .../tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc index 2dfb88d7e..f5a556abd 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc @@ -600,11 +600,12 @@ bool dll_pll_veml_tracking_fpga::cn0_and_tracking_lock_status(double coh_integra if (d_cn0_estimation_counter < trk_parameters.cn0_samples) { // fill buffer with prompt correlator output values - d_Prompt_buffer[d_cn0_estimation_counter++] = d_P_accu; + d_Prompt_buffer[d_cn0_estimation_counter] = d_P_accu; + d_cn0_estimation_counter++; return true; } - d_cn0_estimation_counter = 0; - d_Prompt_buffer[d_cn0_estimation_counter++] = d_P_accu; + d_Prompt_buffer[d_cn0_estimation_counter % trk_parameters.cn0_samples] = d_P_accu; + d_cn0_estimation_counter++; // Code lock indicator float d_CN0_SNV_dB_Hz_raw = cn0_svn_estimator(d_Prompt_buffer.data(), trk_parameters.cn0_samples, static_cast(coh_integration_time_s)); d_CN0_SNV_dB_Hz = d_cn0_smoother.smooth(d_CN0_SNV_dB_Hz_raw);