From fcdf763166e74f4b7227a66540dd27d652106c76 Mon Sep 17 00:00:00 2001 From: Oleksandr Suvorov Date: Tue, 27 Oct 2026 13:12:23 +0200 Subject: [PATCH 1/3] tracking: add an option to dump every code period Once a DLL/PLL channel reaches symbol synchronization, the tracking dump gets one record per data symbol, so the prompt correlator output of the code periods inside a symbol is not stored: each of the 20 periods of a GPS L1 C/A bit, or the secondary code chips of a BeiDou B1I symbol. Tracking_XX.dump_every_code_period=true writes a record for every code period in the extended-integration and narrow-tracking states as well. The default is false, and the record layout is the same either way. Signed-off-by: Oleksandr Suvorov --- docs/CHANGELOG.md | 7 +++++++ .../gnuradio_blocks/dll_pll_veml_tracking.cc | 14 +++++++++++--- src/algorithms/tracking/libs/dll_pll_conf.cc | 1 + src/algorithms/tracking/libs/dll_pll_conf.h | 1 + 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 62c1e754d..b6c19f1a4 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -371,6 +371,13 @@ All notable changes to GNSS-SDR will be documented in this file. latest antenna calibration (ANTEX) and satellite metadata (SINEX) files published by the International GNSS Service and the European GNSS Service Centre, for the antenna models of the PPP positioning modes. +- A new tracking parameter `Tracking_XX.dump_every_code_period` (default + `false`) makes the DLL/PLL tracking dump (`Tracking_XX.dump=true`) write a + record for every code period also once the channel has reached symbol + synchronization. By default the dump then gets one record per symbol, so the + prompt correlator output of the code periods inside a symbol (for instance, + each of the 20 periods of a GPS L1 C/A bit, or the secondary code chips of a + BeiDou B1I symbol) is not stored. The record layout is the same in both cases. See the definitions of concepts and metrics at https://gnss-sdr.org/design-forces/ diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index 3921d5bbb..a997e8fb6 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -2847,9 +2847,13 @@ int dll_pll_veml_tracking::process_input(int noutput_items __attribute__((unused do_correlation_step(in); save_correlation_results(); update_tracking_vars(); - if (d_current_data_symbol == 0) + // dump_every_code_period also logs the code periods inside a symbol + if (d_current_data_symbol == 0 || d_trk_parameters.dump_every_code_period) { log_data(); + } + if (d_current_data_symbol == 0) + { // ########### Output the tracking results to Telemetry block ########## // Fill the acquisition data current_synchro_data = *d_acquisition_gnss_synchro; @@ -2889,10 +2893,14 @@ int dll_pll_veml_tracking::process_input(int noutput_items __attribute__((unused run_dll_pll(); update_tracking_vars(); check_carrier_phase_coherent_initialization(); + // enable write dump file this cycle (valid DLL/PLL cycle); + // dump_every_code_period also logs the code periods inside a symbol + if (d_current_data_symbol == 0 || d_trk_parameters.dump_every_code_period) + { + log_data(); + } if (d_current_data_symbol == 0) { - // enable write dump file this cycle (valid DLL/PLL cycle) - log_data(); // ########### Output the tracking results to Telemetry block ########## // Fill the acquisition data current_synchro_data = *d_acquisition_gnss_synchro; diff --git a/src/algorithms/tracking/libs/dll_pll_conf.cc b/src/algorithms/tracking/libs/dll_pll_conf.cc index 69e4f78ca..ea08ef461 100644 --- a/src/algorithms/tracking/libs/dll_pll_conf.cc +++ b/src/algorithms/tracking/libs/dll_pll_conf.cc @@ -63,6 +63,7 @@ void Dll_Pll_Conf::SetFromConfiguration(const ConfigurationInterface *configurat f_error_dump = configuration->property(role + ".f_error_dump", f_error_dump); f_error_dump_filename = configuration->property(role + ".f_error_dump_filename", f_error_dump_filename); dump_mat = configuration->property(role + ".dump_mat", dump_mat); + dump_every_code_period = configuration->property(role + ".dump_every_code_period", dump_every_code_period); pll_bw_hz = configuration->property(role + ".pll_bw_hz", pll_bw_hz); #if USE_GLOG_AND_GFLAGS if (FLAGS_pll_bw_hz != 0.0) diff --git a/src/algorithms/tracking/libs/dll_pll_conf.h b/src/algorithms/tracking/libs/dll_pll_conf.h index edece922e..7b527ad49 100644 --- a/src/algorithms/tracking/libs/dll_pll_conf.h +++ b/src/algorithms/tracking/libs/dll_pll_conf.h @@ -93,6 +93,7 @@ public: bool dump{false}; bool dump_mat{true}; bool f_error_dump{false}; + bool dump_every_code_period{false}; bool tow_to_trk{false}; bool bs_use_phase_dot_detector{true}; // GPS L1C-specific options. From 4eb1894b4b50d3f5107f489a72502215bc5c7502 Mon Sep 17 00:00:00 2001 From: Oleksandr Cryo Suvorov Date: Thu, 12 Nov 2026 16:42:49 +0200 Subject: [PATCH 2/3] tests: ignore RINEX headers when checking navigation exponents The RINEX 4 exponent check searches the version comment as well as navigation records. The CI version ending in HEAD-068cc29 contains D-0, so the test fails even though the data use the correct exponent. Limit these checks to records after END OF HEADER. Cover a matching version comment and ensure D exponents in data are still detected. Fixes: e52191d476c6252e2e71708619d319bf1bfe244e ("Add support for RINEX 4.02 observation and navigation files") Signed-off-by: Oleksandr Cryo Suvorov Signed-off-by: Oleksandr Suvorov --- .../pvt/rinex_printer_test.cc | 51 +++++++++++++++++-- 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc b/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc index 7dcd7a6e6..6dcebd6b3 100644 --- a/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc +++ b/tests/unit-tests/signal-processing-blocks/pvt/rinex_printer_test.cc @@ -276,7 +276,7 @@ std::string find_line_starting_with(const std::string& filename, const std::stri } -std::string find_line_containing(const std::string& filename, const std::string& text) +std::string find_line_containing(const std::string& filename, const std::string& text, bool data_records_only = false) { std::fstream fstr(filename.c_str(), std::fstream::in); if (!fstr.is_open()) @@ -286,9 +286,18 @@ std::string find_line_containing(const std::string& filename, const std::string& fstr.seekg(0); std::string line_str; + bool in_header = data_records_only; while (!fstr.eof()) { std::getline(fstr, line_str); + if (in_header) + { + if (line_str.find("END OF HEADER", 60) != std::string::npos) + { + in_header = false; + } + continue; + } if (line_str.find(text) != std::string::npos) { return line_str; @@ -564,10 +573,42 @@ TEST_F(RinexPrinterTest, Rinex4GpsNavAndObs) const std::string sto_line = find_line_containing(navfile, "GPUT"); EXPECT_NE(std::string::npos, sto_line.find("UTC(USNO)")); - // RINEX 4 navigation records use the 'e' exponent indicator instead of 'D' - EXPECT_TRUE(find_line_containing(navfile, "D+0").empty()); - EXPECT_TRUE(find_line_containing(navfile, "D-0").empty()); - EXPECT_FALSE(find_line_containing(navfile, "e+0").empty()); + // RINEX 4 navigation records use the 'e' exponent indicator instead of 'D'. + // Ignore header comments: a version containing HEAD-0 is not an exponent. + EXPECT_TRUE(find_line_containing(navfile, "D+0", true).empty()); + EXPECT_TRUE(find_line_containing(navfile, "D-0", true).empty()); + EXPECT_FALSE(find_line_containing(navfile, "e+0", true).empty()); +} + + +TEST_F(RinexPrinterTest, NavigationExponentSearchSkipsHeader) +{ + auto rp = make_rinex_printer(GPS_1C, 4); + const std::string navfile = rp->get_navfilename()[0]; + rp = nullptr; + + { + std::ofstream out(navfile); + ASSERT_TRUE(out.is_open()); + const std::string version = "GNSS-SDR VERSION 0.0.22.git-HEAD-068cc29"; + out << version << std::string(60 - version.size(), ' ') << "COMMENT\n"; + out << std::string(60, ' ') << "END OF HEADER\n"; + out << "> EPH G01 LNAV\n 1.000000000000e+00\n"; + } + + EXPECT_FALSE(find_line_containing(navfile, "D-0").empty()); + EXPECT_TRUE(find_line_containing(navfile, "D-0", true).empty()); + EXPECT_TRUE(find_line_containing(navfile, "D+0", true).empty()); + EXPECT_FALSE(find_line_containing(navfile, "e+0", true).empty()); + + { + std::ofstream out(navfile, std::ios::app); + ASSERT_TRUE(out.is_open()); + out << " 1.000000000000D-01\n 1.000000000000D+01\n"; + } + + EXPECT_EQ(" 1.000000000000D-01", find_line_containing(navfile, "D-0", true)); + EXPECT_EQ(" 1.000000000000D+01", find_line_containing(navfile, "D+0", true)); } From be7fc0a1cd143bccd8e7cc7c76f31cca8dd204e5 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 24 Nov 2026 18:27:09 +0100 Subject: [PATCH 3/3] Tracking: extend dump_every_code_period to the KF and FPGA blocks --- .../dll_pll_veml_tracking_fpga.cc | 28 +++++++++++++++---- .../tracking/gnuradio_blocks/kf_tracking.cc | 14 ++++++++-- .../tracking/libs/dll_pll_conf_fpga.cc | 1 + .../tracking/libs/dll_pll_conf_fpga.h | 1 + src/algorithms/tracking/libs/kf_conf.cc | 2 ++ src/algorithms/tracking/libs/kf_conf.h | 1 + 6 files changed, 38 insertions(+), 9 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 da36bb97b..018036430 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 @@ -1854,9 +1854,13 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un save_correlation_results(); update_tracking_vars(); - if (d_current_data_symbol == 0) + // dump_every_code_period also logs the correlations inside a symbol + if (d_current_data_symbol == 0 || d_trk_parameters.dump_every_code_period) { log_data(); + } + if (d_current_data_symbol == 0) + { // ########### Output the tracking results to Telemetry block ########## // Fill the acquisition data current_synchro_data = *d_acquisition_gnss_synchro; @@ -1909,10 +1913,14 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un run_dll_pll(); update_tracking_vars(); check_carrier_phase_coherent_initialization(); + // enable write dump file this cycle (valid DLL/PLL cycle); + // dump_every_code_period also logs the correlations inside a symbol + if (d_current_data_symbol == 0 || d_trk_parameters.dump_every_code_period) + { + log_data(); + } if (d_current_data_symbol == 0) { - // enable write dump file this cycle (valid DLL/PLL cycle) - log_data(); // ########### Output the tracking results to Telemetry block ########## // Fill the acquisition data current_synchro_data = *d_acquisition_gnss_synchro; @@ -1967,9 +1975,13 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un save_correlation_results(); update_tracking_vars(); - if (d_current_data_symbol == 0) + // dump_every_code_period also logs the correlations inside a symbol + if (d_current_data_symbol == 0 || d_trk_parameters.dump_every_code_period) { log_data(); + } + if (d_current_data_symbol == 0) + { // ########### Output the tracking results to Telemetry block ########## // Fill the acquisition data current_synchro_data = *d_acquisition_gnss_synchro; @@ -2032,10 +2044,14 @@ int dll_pll_veml_tracking_fpga::general_work(int noutput_items __attribute__((un update_tracking_vars(); check_carrier_phase_coherent_initialization(); + // enable write dump file this cycle (valid DLL/PLL cycle); + // dump_every_code_period also logs the correlations inside a symbol + if (d_current_data_symbol == 0 || d_trk_parameters.dump_every_code_period) + { + log_data(); + } if (d_current_data_symbol == 0) { - // enable write dump file this cycle (valid DLL/PLL cycle) - log_data(); // ########### Output the tracking results to Telemetry block ########## // Fill the acquisition data current_synchro_data = *d_acquisition_gnss_synchro; diff --git a/src/algorithms/tracking/gnuradio_blocks/kf_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/kf_tracking.cc index 2989cd8f3..6a148fc83 100644 --- a/src/algorithms/tracking/gnuradio_blocks/kf_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/kf_tracking.cc @@ -2016,9 +2016,13 @@ int kf_tracking::process_input(int noutput_items __attribute__((unused)), gr_vec save_correlation_results(); // run_Kf(); update_tracking_vars(); // ? - if (d_current_data_symbol == 0) + // dump_every_code_period also logs the code periods inside a symbol + if (d_current_data_symbol == 0 || d_trk_parameters.dump_every_code_period) { log_data(); + } + if (d_current_data_symbol == 0) + { // ########### Output the tracking results to Telemetry block ########## // Fill the acquisition data current_synchro_data = *d_acquisition_gnss_synchro; @@ -2066,10 +2070,14 @@ int kf_tracking::process_input(int noutput_items __attribute__((unused)), gr_vec run_Kf(); update_tracking_vars(); check_carrier_phase_coherent_initialization(); + // enable write dump file this cycle (valid DLL/PLL cycle); + // dump_every_code_period also logs the code periods inside a symbol + if (d_current_data_symbol == 0 || d_trk_parameters.dump_every_code_period) + { + log_data(); + } if (d_current_data_symbol == 0) { - // enable write dump file this cycle (valid DLL/PLL cycle) - log_data(); // ########### Output the tracking results to Telemetry block ########## // Fill the acquisition data current_synchro_data = *d_acquisition_gnss_synchro; diff --git a/src/algorithms/tracking/libs/dll_pll_conf_fpga.cc b/src/algorithms/tracking/libs/dll_pll_conf_fpga.cc index d17d353cf..6307b5d21 100644 --- a/src/algorithms/tracking/libs/dll_pll_conf_fpga.cc +++ b/src/algorithms/tracking/libs/dll_pll_conf_fpga.cc @@ -60,6 +60,7 @@ void Dll_Pll_Conf_Fpga::SetFromConfiguration(const ConfigurationInterface *confi } dump = configuration->property(role + ".dump", dump); dump_mat = configuration->property(role + ".dump_mat", dump_mat); + dump_every_code_period = configuration->property(role + ".dump_every_code_period", dump_every_code_period); keep_phase_at_secondary_lock = configuration->property(role + ".keep_phase_at_secondary_lock", keep_phase_at_secondary_lock); dump_filename = configuration->property(role + ".dump_filename", dump_filename); enable_fll_pull_in = configuration->property(role + ".enable_fll_pull_in", enable_fll_pull_in); diff --git a/src/algorithms/tracking/libs/dll_pll_conf_fpga.h b/src/algorithms/tracking/libs/dll_pll_conf_fpga.h index bb193c3cd..46e749fe9 100644 --- a/src/algorithms/tracking/libs/dll_pll_conf_fpga.h +++ b/src/algorithms/tracking/libs/dll_pll_conf_fpga.h @@ -105,6 +105,7 @@ public: bool high_dyn{false}; bool dump{false}; bool dump_mat{true}; + bool dump_every_code_period{false}; bool keep_phase_at_secondary_lock{false}; bool bs_use_phase_dot_detector{true}; }; diff --git a/src/algorithms/tracking/libs/kf_conf.cc b/src/algorithms/tracking/libs/kf_conf.cc index a90e277f9..809f4865a 100644 --- a/src/algorithms/tracking/libs/kf_conf.cc +++ b/src/algorithms/tracking/libs/kf_conf.cc @@ -82,6 +82,7 @@ Kf_Conf::Kf_Conf() : item_type("gr_complex"), high_dyn(false), dump(false), dump_mat(true), + dump_every_code_period(false), keep_phase_at_secondary_lock(false) { signal[0] = '1'; @@ -106,6 +107,7 @@ void Kf_Conf::SetFromConfiguration(const ConfigurationInterface *configuration, dump = configuration->property(role + ".dump", dump); dump_filename = configuration->property(role + ".dump_filename", dump_filename); dump_mat = configuration->property(role + ".dump_mat", dump_mat); + dump_every_code_period = configuration->property(role + ".dump_every_code_period", dump_every_code_period); keep_phase_at_secondary_lock = configuration->property(role + ".keep_phase_at_secondary_lock", keep_phase_at_secondary_lock); pull_in_time_s = configuration->property(role + ".pull_in_time_s", pull_in_time_s); diff --git a/src/algorithms/tracking/libs/kf_conf.h b/src/algorithms/tracking/libs/kf_conf.h index 1842eb484..cbc763e23 100644 --- a/src/algorithms/tracking/libs/kf_conf.h +++ b/src/algorithms/tracking/libs/kf_conf.h @@ -81,6 +81,7 @@ public: bool high_dyn; bool dump; bool dump_mat; + bool dump_every_code_period; bool keep_phase_at_secondary_lock; };