From ba7a938304d5d63fc19b1ba08bc8bc28e8313d2f Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 24 Feb 2020 20:18:28 +0100 Subject: [PATCH] Add option to enable/disable carrier aiding in the code loop (enabled by default) --- .../tracking/gnuradio_blocks/dll_pll_veml_tracking.cc | 6 +++++- .../tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.cc | 6 +++++- src/algorithms/tracking/libs/dll_pll_conf.cc | 2 ++ src/algorithms/tracking/libs/dll_pll_conf.h | 1 + src/algorithms/tracking/libs/dll_pll_conf_fpga.cc | 2 ++ src/algorithms/tracking/libs/dll_pll_conf_fpga.h | 1 + 6 files changed, 16 insertions(+), 2 deletions(-) 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 3d159fd69..64464f9df 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -991,7 +991,11 @@ void dll_pll_veml_tracking::run_dll_pll() // Code discriminator filter d_code_error_filt_chips = d_code_loop_filter.apply(d_code_error_chips); // [chips/second] // New code Doppler frequency estimation - d_code_freq_chips = (1.0 + (d_carrier_doppler_hz / d_signal_carrier_freq)) * d_code_chip_rate - d_code_error_filt_chips; + d_code_freq_chips = d_code_chip_rate - d_code_error_filt_chips; + if (trk_parameters.carrier_aiding) + { + d_code_freq_chips += d_carrier_doppler_hz * d_code_chip_rate / d_signal_carrier_freq; + } // Experimental: detect Carrier Doppler vs. Code Doppler incoherence and correct the Carrier Doppler if (trk_parameters.enable_doppler_correction == true) 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 c7f341d6f..0f0939fc8 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 @@ -738,7 +738,11 @@ void dll_pll_veml_tracking_fpga::run_dll_pll() // Code discriminator filter d_code_error_filt_chips = d_code_loop_filter.apply(d_code_error_chips); // [chips/second] // New code Doppler frequency estimation - d_code_freq_chips = (1.0 + (d_carrier_doppler_hz / d_signal_carrier_freq)) * d_code_chip_rate - d_code_error_filt_chips; + d_code_freq_chips = d_code_chip_rate - d_code_error_filt_chips; + if (trk_parameters.carrier_aiding) + { + d_code_freq_chips += d_carrier_doppler_hz * d_code_chip_rate / d_signal_carrier_freq; + } // Experimental: detect Carrier Doppler vs. Code Doppler incoherence and correct the Carrier Doppler if (trk_parameters.enable_doppler_correction == true) diff --git a/src/algorithms/tracking/libs/dll_pll_conf.cc b/src/algorithms/tracking/libs/dll_pll_conf.cc index cc9a9fbae..dc2c729cd 100644 --- a/src/algorithms/tracking/libs/dll_pll_conf.cc +++ b/src/algorithms/tracking/libs/dll_pll_conf.cc @@ -55,6 +55,7 @@ Dll_Pll_Conf::Dll_Pll_Conf() slope = 1.0; spc = 0.5; y_intercept = 1.0; + carrier_aiding = true; extend_correlation_symbols = 1; cn0_samples = FLAGS_cn0_samples; cn0_smoother_samples = 200; @@ -152,6 +153,7 @@ void Dll_Pll_Conf::SetFromConfiguration(ConfigurationInterface *configuration, max_code_lock_fail = configuration->property(role + ".max_lock_fail", max_code_lock_fail); max_carrier_lock_fail = configuration->property(role + ".max_carrier_lock_fail", max_carrier_lock_fail); carrier_lock_th = configuration->property(role + ".carrier_lock_th", carrier_lock_th); + carrier_aiding = configuration->property(role + ".carrier_aiding", carrier_aiding); // tracking lock tests smoother parameters cn0_smoother_samples = configuration->property(role + ".cn0_smoother_samples", cn0_smoother_samples); diff --git a/src/algorithms/tracking/libs/dll_pll_conf.h b/src/algorithms/tracking/libs/dll_pll_conf.h index 1fa6e18b6..83ac7d4e6 100644 --- a/src/algorithms/tracking/libs/dll_pll_conf.h +++ b/src/algorithms/tracking/libs/dll_pll_conf.h @@ -60,6 +60,7 @@ public: float spc; float y_intercept; int32_t extend_correlation_symbols; + bool carrier_aiding; bool high_dyn; std::string item_type; int32_t cn0_samples; diff --git a/src/algorithms/tracking/libs/dll_pll_conf_fpga.cc b/src/algorithms/tracking/libs/dll_pll_conf_fpga.cc index d984ac0a0..cafe62f45 100644 --- a/src/algorithms/tracking/libs/dll_pll_conf_fpga.cc +++ b/src/algorithms/tracking/libs/dll_pll_conf_fpga.cc @@ -56,6 +56,7 @@ Dll_Pll_Conf_Fpga::Dll_Pll_Conf_Fpga() slope = 1.0; spc = 0.5; y_intercept = 1.0; + carrier_aiding = true; extend_correlation_symbols = 1; cn0_samples = FLAGS_cn0_samples; cn0_smoother_samples = 200; @@ -157,6 +158,7 @@ void Dll_Pll_Conf_Fpga::SetFromConfiguration(ConfigurationInterface *configurati very_early_late_space_narrow_chips = configuration->property(role + ".very_early_late_space_narrow_chips", very_early_late_space_narrow_chips); extend_correlation_symbols = configuration->property(role + ".extend_correlation_symbols", extend_correlation_symbols); cn0_samples = configuration->property(role + ".cn0_samples", cn0_samples); + carrier_aiding = configuration->property(role + ".carrier_aiding", carrier_aiding); // tracking lock tests smoother parameters cn0_smoother_samples = configuration->property(role + ".cn0_smoother_samples", cn0_smoother_samples); diff --git a/src/algorithms/tracking/libs/dll_pll_conf_fpga.h b/src/algorithms/tracking/libs/dll_pll_conf_fpga.h index fabad6429..90a9bff2c 100644 --- a/src/algorithms/tracking/libs/dll_pll_conf_fpga.h +++ b/src/algorithms/tracking/libs/dll_pll_conf_fpga.h @@ -63,6 +63,7 @@ public: float spc; float y_intercept; int32_t extend_correlation_symbols; + bool carrier_aiding; bool high_dyn; int32_t cn0_samples; int32_t cn0_min;