From dc8e450c82c751fcf371e1f9867ad2e9205f0b3c Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 22 Jul 2022 08:15:35 +0200 Subject: [PATCH 01/11] Add work on KF tracking --- .../gnuradio_blocks/kf_vtl_tracking.cc | 309 +++++++++++------- .../gnuradio_blocks/kf_vtl_tracking.h | 2 + src/algorithms/tracking/libs/kf_conf.cc | 59 ++-- src/algorithms/tracking/libs/kf_conf.h | 21 +- 4 files changed, 229 insertions(+), 162 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.cc index a01caaf99..b24fe18e5 100644 --- a/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.cc @@ -18,7 +18,6 @@ * ----------------------------------------------------------------------------- */ -#include "kf_vtl_tracking.h" #include "Beidou_B1I.h" #include "Beidou_B3I.h" #include "GPS_L1_CA.h" @@ -40,6 +39,7 @@ #include "gps_l2c_signal_replica.h" #include "gps_l5_signal_replica.h" #include "gps_sdr_signal_replica.h" +#include "kf_vtl_tracking.h" #include "lock_detectors.h" #include "tracking_discriminators.h" #include "trackingcmd.h" @@ -537,6 +537,17 @@ kf_vtl_tracking::kf_vtl_tracking(const Kf_Conf &conf_) clear_tracking_vars(); + if (d_trk_parameters.smoother_length > 0) + { + d_carr_ph_history.set_capacity(d_trk_parameters.smoother_length * 2); + d_code_ph_history.set_capacity(d_trk_parameters.smoother_length * 2); + } + else + { + d_carr_ph_history.set_capacity(1); + d_code_ph_history.set_capacity(1); + } + if (d_dump) { d_dump_filename = d_trk_parameters.dump_filename; @@ -638,6 +649,8 @@ void kf_vtl_tracking::start_tracking() d_carrier_doppler_kf_hz = d_acq_carrier_doppler_hz; d_carrier_phase_step_rad = TWO_PI * d_carrier_doppler_kf_hz / d_trk_parameters.fs_in; d_carrier_phase_rate_step_rad = 0.0; + d_carr_ph_history.clear(); + d_code_ph_history.clear(); std::array Signal_{}; Signal_[0] = d_acquisition_gnss_synchro->Signal[0]; Signal_[1] = d_acquisition_gnss_synchro->Signal[1]; @@ -732,7 +745,7 @@ void kf_vtl_tracking::start_tracking() { beidou_b1i_code_gen_float(d_tracking_code, d_acquisition_gnss_synchro->PRN, 0); // GEO Satellites use different secondary code - if ((d_acquisition_gnss_synchro->PRN > 0 and d_acquisition_gnss_synchro->PRN < 6) or d_acquisition_gnss_synchro->PRN > 58) + if (d_acquisition_gnss_synchro->PRN > 0 and d_acquisition_gnss_synchro->PRN < 6) { d_symbols_per_bit = BEIDOU_B1I_GEO_TELEMETRY_SYMBOLS_PER_BIT; // todo: enable after fixing beidou symbol synchronization d_correlation_length_ms = 1; @@ -765,7 +778,7 @@ void kf_vtl_tracking::start_tracking() { beidou_b3i_code_gen_float(d_tracking_code, d_acquisition_gnss_synchro->PRN, 0); // Update secondary code settings for geo satellites - if ((d_acquisition_gnss_synchro->PRN > 0 and d_acquisition_gnss_synchro->PRN < 6) or d_acquisition_gnss_synchro->PRN > 58) + if (d_acquisition_gnss_synchro->PRN > 0 and d_acquisition_gnss_synchro->PRN < 6) { d_symbols_per_bit = BEIDOU_B3I_GEO_TELEMETRY_SYMBOLS_PER_BIT; // todo: enable after fixing beidou symbol synchronization d_correlation_length_ms = 1; @@ -841,20 +854,21 @@ void kf_vtl_tracking::start_tracking() void kf_vtl_tracking::init_kf(double acq_code_phase_chips, double acq_doppler_hz) { // Kalman Filter class variables - const double Ti = d_correlation_length_ms * 0.001; - // state vector: code_phase_chips, carrier_phase_rads, carrier_freq_hz,carrier_freq_rate_hz, code_freq_chips_s - d_F = arma::mat(5, 5); - d_F = {{1, 0, 0, 0, Ti}, - {0, 1, 2.0 * GNSS_PI * Ti, GNSS_PI * (Ti * Ti), 0}, - {0, 0, 1, Ti, 0}, - {0, 0, 0, 1, 0}, - {0, 0, 0, 0, 1}}; + const double Ti = d_current_correlation_time_s; + const double TiTi = Ti * Ti; const double B = d_code_chip_rate / d_signal_carrier_freq; // carrier to code rate factor - d_H = arma::mat(2, 5); - d_H = {{1, 0, -B * Ti / 2.0, B * (Ti * Ti) / 6.0, 0}, - {0, 1, -GNSS_PI * Ti, GNSS_PI * (Ti * Ti) / 3.0, 0}}; + d_F = arma::mat(4, 4); + d_F = {{1, 0, B * Ti, B * TiTi / 2}, + {0, 1, 2.0 * GNSS_PI * Ti, GNSS_PI * TiTi}, + {0, 0, 1, Ti}, + {0, 0, 0, 1}}; + + d_H = arma::mat(2, 4); + d_H = {{1, 0, -B * Ti / 2.0, B * TiTi / 6.0}, + {0, 1, -GNSS_PI * Ti, GNSS_PI * TiTi / 3.0}}; + // Phase noise variance // const double CN0_lin = pow(10.0, d_trk_parameters.expected_cn0_dbhz / 10.0); // CN0 in Hz // const double N_periods = 1; // Only 1 interval @@ -862,35 +876,42 @@ void kf_vtl_tracking::init_kf(double acq_code_phase_chips, double acq_doppler_hz // const double Sigma2_Phase = 1.0 / (2.0 * CN0_lin * Ti) * (1.0 + 1.0 / (2.0 * CN0_lin * Ti)); // measurement covariance matrix (static) - d_R = arma::mat(2, 2); + // d_R = arma::mat(2, 2); // d_R << Sigma2_Tau << 0 << arma::endr // << 0 << Sigma2_Phase << arma::endr; + + d_R = arma::mat(2, 2); d_R = {{pow(d_trk_parameters.code_disc_sd_chips, 2.0), 0}, {0, pow(d_trk_parameters.carrier_disc_sd_rads, 2.0)}}; - // system covariance matrix (static) - d_Q = arma::mat(5, 5); - d_Q = {{pow(d_trk_parameters.code_phase_sd_chips, 2.0), 0, 0, 0, 0}, - {0, pow(d_trk_parameters.carrier_phase_sd_rad, 2.0), 0, 0, 0}, - {0, 0, pow(d_trk_parameters.carrier_freq_sd_hz, 2.0), 0, 0}, - {0, 0, 0, pow(d_trk_parameters.carrier_freq_rate_sd_hz_s, 2.0), 0}, - {0, 0, 0, 0, pow(d_trk_parameters.code_rate_sd_chips_s, 2.0)}}; + + // system cov11ariance matrix (static) + d_Q = arma::mat(4, 4); + d_Q = {{pow(d_trk_parameters.code_phase_sd_chips, 2.0), 0, 0, 0}, + {0, pow(d_trk_parameters.carrier_phase_sd_rad, 2.0), 0, 0}, + {0, 0, pow(d_trk_parameters.carrier_freq_sd_hz, 2.0), 0}, + {0, 0, 0, pow(d_trk_parameters.carrier_freq_rate_sd_hz_s, 2.0)}}; + // initial Kalman covariance matrix - d_P_old_old = arma::mat(5, 5); - d_P_old_old = {{pow(d_trk_parameters.init_code_phase_sd_chips, 2.0), 0, 0, 0, 0}, - {0, pow(d_trk_parameters.init_carrier_phase_sd_rad, 2.0), 0, 0, 0}, - {0, 0, pow(d_trk_parameters.init_carrier_freq_rate_sd_hz_s, 2.0), 0, 0}, - {0, 0, 0, pow(d_trk_parameters.init_carrier_freq_rate_sd_hz_s, 2.0), 0}, - {0, 0, 0, 0, pow(d_trk_parameters.init_code_rate_sd_chips_s, 2.0)}}; + d_P_old_old = arma::mat(4, 4); + d_P_old_old = {{pow(d_trk_parameters.init_code_phase_sd_chips, 2.0), 0, 0, 0}, + {0, pow(d_trk_parameters.init_carrier_phase_sd_rad, 2.0), 0, 0}, + {0, 0, pow(d_trk_parameters.init_carrier_freq_sd_hz, 2.0), 0}, + {0, 0, 0, pow(d_trk_parameters.init_carrier_freq_rate_sd_hz_s, 2.0)}}; + // d_R = arma::mat(2, 2); + // d_R << Sigma2_Tau << 0 << arma::endr + // << 0 << Sigma2_Phase << arma::endr; + // init state vector - d_x_old_old = arma::vec(5); - // states: code_phase_chips, carrier_phase_rads, carrier_freq_hz, carrier_freq_rate_hz_s, code_freq_rate_chips_s - d_x_old_old = {acq_code_phase_chips, 0, acq_doppler_hz, 0, 0}; - // std::cout << "F: " << d_F << "\n"; - // std::cout << "H: " << d_H << "\n"; - // std::cout << "R: " << d_R << "\n"; - // std::cout << "Q: " << d_Q << "\n"; - // std::cout << "P: " << d_P_old_old << "\n"; - // std::cout << "x: " << d_x_old_old << "\n"; + d_x_old_old = arma::vec(4); + // states: code_phase_chips, carrier_phase_rads, carrier_freq_hz, carrier_freq_rate_hz_s + d_x_old_old = {acq_code_phase_chips, 0, acq_doppler_hz, 0}; + + std::cout << "F: " << d_F << "\n"; + std::cout << "H: " << d_H << "\n"; + std::cout << "R: " << d_R << "\n"; + std::cout << "Q: " << d_Q << "\n"; + std::cout << "P: " << d_P_old_old << "\n"; + std::cout << "x: " << d_x_old_old << "\n"; } @@ -898,48 +919,76 @@ void kf_vtl_tracking::update_kf_narrow_integration_time() { // Kalman Filter class variables const double Ti = d_current_correlation_time_s; + const double TiTi = Ti * Ti; - // state vector: code_phase_chips, carrier_phase_rads, carrier_freq_hz,carrier_freq_rate_hz, code_freq_chips_s - d_F = {{1, 0, 0, 0, Ti}, - {0, 1, 2.0 * GNSS_PI * Ti, GNSS_PI * (Ti * Ti), 0}, - {0, 0, 1, Ti, 0}, - {0, 0, 0, 1, 0}, - {0, 0, 0, 0, 1}}; const double B = d_code_chip_rate / d_signal_carrier_freq; // carrier to code rate factor + arma::mat Qnew = arma::zeros(4, 4); + for (int i = 0; i < d_trk_parameters.extend_correlation_symbols; i++) + { + Qnew += d_F * d_Q * d_F.t(); + // d_F = d_F * d_F; + d_Q = d_F * d_Q * d_F.t(); + } + d_Q = Qnew; - d_H = {{1, 0, -B * Ti / 2.0, B * (Ti * Ti) / 6.0, 0}, - {0, 1, -GNSS_PI * Ti, GNSS_PI * (Ti * Ti) / 3.0, 0}}; + // state vector: code_phase_chips, carrier_phase_rads, carrier_freq_hz, carrier_freq_rate_hz + d_F = {{1, 0, B * Ti, B * TiTi / 2.0}, + {0, 1, 2.0 * GNSS_PI * Ti, GNSS_PI * TiTi}, + {0, 0, 1, Ti}, + {0, 0, 0, 1}}; - // measurement covariance matrix (static) - d_R = {{pow(d_trk_parameters.code_disc_sd_chips, 2.0), 0}, - {0, pow(d_trk_parameters.carrier_disc_sd_rads, 2.0)}}; + d_H = {{1, 0, -B * Ti / 2.0, B * TiTi / 6.0}, + {0, 1, -GNSS_PI * Ti, GNSS_PI * TiTi / 3.0}}; // system covariance matrix (static) - d_Q = {{pow(d_trk_parameters.narrow_code_phase_sd_chips, 2.0), 0, 0, 0, 0}, - {0, pow(d_trk_parameters.narrow_carrier_phase_sd_rad, 2.0), 0, 0, 0}, - {0, 0, pow(d_trk_parameters.narrow_carrier_freq_sd_hz, 2.0), 0, 0}, - {0, 0, 0, pow(d_trk_parameters.narrow_carrier_freq_rate_sd_hz_s, 2.0), 0}, - {0, 0, 0, 0, pow(d_trk_parameters.narrow_code_rate_sd_chips_s, 2.0)}}; + // d_Q << pow(d_trk_parameters.narrow_code_phase_sd_chips, 2.0) << 0 << 0 << 0 << arma::endr + // << 0 << pow(d_trk_parameters.narrow_carrier_phase_sd_rad, 2.0) << 0 << 0 << arma::endr + // << 0 << 0 << pow(d_trk_parameters.narrow_carrier_freq_sd_hz, 2.0) << 0 << arma::endr + // << 0 << 0 << 0 << pow(d_trk_parameters.narrow_carrier_freq_rate_sd_hz_s, 2.0) << arma::endr; + const double CN0_lin = pow(10.0, d_CN0_SNV_dB_Hz / 10.0); // CN0 in Hz + const double CN0_lin_Ti = CN0_lin * Ti; + // const double N_periods = 1; // Only 1 interval + // const double Sigma2_Tau = 0.25 * (1.0 + 2.0 * CN0_lin * Ti) / (N_periods * pow(CN0_lin * Ti, 2.0)) * (1.0 + (1.0 + 2.0 * CN0_lin * Ti) / (pow(N_periods * (CN0_lin * Ti), 2.0))); + const double Sigma2_Phase = (1.0 / (2.0 * CN0_lin_Ti)) * (1.0 + 1.0 / (2.0 * CN0_lin_Ti)); + // double prova = (1.0 / (CN0_lin * Ti)) * (0.5 + (0.5 / (1.0 - 0.5)) * (1.0 / (2.0 * CN0_lin * Ti))); + // std::cout << "Sigma2_Tau = " << Sigma2_Tau << ", prova: " << prova << std::endl; + const double Sigma2_Tau = (1.0 / CN0_lin_Ti) * (d_trk_parameters.spc + (d_trk_parameters.spc / (1.0 - d_trk_parameters.spc)) * (1.0 / (2.0 * CN0_lin_Ti))); + + d_R = arma::mat(2, 2); + d_R = {{Sigma2_Tau, 0}, + {0, Sigma2_Phase}}; + + // << 0 << 0 << 0 << 0 << pow(d_trk_parameters.narrow_code_rate_sd_chips_s, 2.0) << arma::endr; + std::cout << "Fu: " << d_F << "\n"; + std::cout << "Hu: " << d_H << "\n"; + std::cout << "Ru: " << d_R << "\n"; + std::cout << "Qu: " << d_Q << "\n"; + std::cout << "Pu: " << d_P_old_old << "\n"; + std::cout << "xu: " << d_x_old_old << "\n"; } void kf_vtl_tracking::update_kf_cn0(double current_cn0_dbhz) { // Kalman Filter class variables - const double Ti = d_correlation_length_ms * 0.001; + const double Ti = d_current_correlation_time_s; // d_correlation_length_ms * 0.001; + const double TiTi = Ti * Ti; const double B = d_code_chip_rate / d_signal_carrier_freq; // carrier to code rate factor - d_H = arma::mat(2, 5); - d_H = {{1, 0, -B * Ti / 2.0, B * (Ti * Ti) / 6.0, 0}, - {0, 1, -GNSS_PI * Ti, GNSS_PI * (Ti * Ti) / 3.0, 0}}; + d_H = arma::mat(2, 4); + d_H = {{1, 0, -B * Ti / 2.0, B * TiTi / 6.0}, + {0, 1, -GNSS_PI * Ti, GNSS_PI * TiTi / 3.0}}; // Phase noise variance const double CN0_lin = pow(10.0, current_cn0_dbhz / 10.0); // CN0 in Hz - const double N_periods = 1; // Only 1 interval - const double Sigma2_Tau = 0.25 * (1.0 + 2.0 * CN0_lin * Ti) / (N_periods * pow(CN0_lin * Ti, 2.0)) * (1.0 + (1.0 + 2.0 * CN0_lin * Ti) / (pow(N_periods * (CN0_lin * Ti), 2.0))); - const double Sigma2_Phase = 1.0 / (2.0 * CN0_lin * Ti) * (1.0 + 1.0 / (2.0 * CN0_lin * Ti)); - - // measurement covariance matrix (static) + const double CN0_lin_Ti = CN0_lin * Ti; + // const double N_periods = 1; // Only 1 interval + // const double Sigma2_Tau = 0.25 * (1.0 + 2.0 * CN0_lin * Ti) / (N_periods * pow(CN0_lin * Ti, 2.0)) * (1.0 + (1.0 + 2.0 * CN0_lin * Ti) / (pow(N_periods * (CN0_lin * Ti), 2.0))); + const double Sigma2_Phase = (1.0 / (2.0 * CN0_lin_Ti)) * (1.0 + 1.0 / (2.0 * CN0_lin_Ti)); + // double prova = (1.0 / (CN0_lin * Ti)) * (0.5 + (0.5 / (1.0 - 0.5)) * (1.0 / (2.0 * CN0_lin * Ti))); + // std::cout << "Sigma2_Tau = " << Sigma2_Tau << ", prova: " << prova << std::endl; + const double Sigma2_Tau = (1.0 / CN0_lin_Ti) * (d_trk_parameters.spc + (d_trk_parameters.spc / (1.0 - d_trk_parameters.spc)) * (1.0 / (2.0 * CN0_lin_Ti))); + // measurement covariance matrix (static)d_trk_parameters.spc d_R = arma::mat(2, 2); d_R = {{Sigma2_Tau, 0}, {0, Sigma2_Phase}}; @@ -1141,21 +1190,20 @@ void kf_vtl_tracking::run_Kf() d_code_error_disc_chips = dll_nc_e_minus_l_normalized(d_E_accu, d_L_accu, d_trk_parameters.spc, d_trk_parameters.slope, d_trk_parameters.y_intercept); // [chips/Ti] } - // Kalman loop + // Kalman loop // Prediction d_x_new_old = d_F * d_x_old_old; + d_P_new_old = d_F * d_P_old_old * d_F.t() + d_Q; - // Innovation - arma::vec z = {d_code_error_disc_chips, d_carr_phase_error_disc_hz * TWO_PI}; - // Measurement update + arma::vec z = {d_code_error_disc_chips, d_carr_phase_error_disc_hz * TWO_PI}; arma::mat K = d_P_new_old * d_H.t() * arma::inv(d_H * d_P_new_old * d_H.t() + d_R); // Kalman gain d_x_new_new = d_x_new_old + K * z; - d_P_new_new = (arma::eye(5, 5) - K * d_H) * d_P_new_old; + d_P_new_new = (arma::eye(4, 4) - K * d_H) * d_P_new_old; // new code phase estimation d_code_error_kf_chips = d_x_new_new(0); @@ -1165,30 +1213,36 @@ void kf_vtl_tracking::run_Kf() d_carrier_phase_kf_rad = d_x_new_new(1); // New carrier Doppler frequency estimation - d_carrier_doppler_kf_hz = d_x_new_new(2); // d_carrier_loop_filter.get_carrier_error(0, static_cast(d_carr_phase_error_hz), static_cast(d_current_correlation_time_s)); + d_carrier_doppler_kf_hz = d_x_new_new(2); + if (d_channel == 0) + { + // std::cout << "Doppler: " << d_carrier_doppler_kf_hz << '\n'; + } + // d_carr_freq_error_hz = fll_four_quadrant_atan(d_P_accu_old, d_P_accu, 0, d_current_correlation_time_s) / TWO_PI; + // d_x_new_new(2) = d_x_new_new(2) + fll_four_quadrant_atan(d_P_accu_old, d_P_accu, 0, d_current_correlation_time_s) / TWO_PI; + d_P_accu_old = d_P_accu; d_carrier_doppler_rate_kf_hz_s = d_x_new_new(3); // New code Doppler frequency estimation - if (d_trk_parameters.carrier_aiding) + d_code_freq_kf_chips_s = d_code_chip_rate + d_carrier_doppler_kf_hz * d_code_chip_rate / d_signal_carrier_freq; + + if (d_trk_parameters.high_dyn) { - // estimate the code rate exclusively based on the carrier Doppler - d_code_freq_kf_chips_s = d_code_chip_rate + d_carrier_doppler_kf_hz * d_code_chip_rate / d_signal_carrier_freq; + // d_x_new_new(3) = 0; + // std::cout << "d_carrier_doppler_rate_kf_hz_s: " << d_carrier_doppler_rate_kf_hz_s << '\n'; + // d_carrier_phase_rate_step_rad = TWO_PI * d_carrier_doppler_rate_kf_hz_s / d_trk_parameters.fs_in; + // d_carrier_phase_rate_step_rad = d_carrier_doppler_rate_kf_hz_s / d_trk_parameters.fs_in; } - else - { - // use its own KF code rate estimation - d_code_freq_kf_chips_s -= d_x_new_new(4); - } - d_x_new_new(4) = 0; - // Experimental: detect Carrier Doppler vs. Code Doppler incoherence and correct the Carrier Doppler - // if (d_trk_parameters.enable_doppler_correction == true) - // { - // if (d_pull_in_transitory == false and d_corrected_doppler == false) - // { - // todo: alforithm here... - // } - // } + // d_x_new_new(4) = 0; + // Experimental: detect Carrier Doppler vs. Code Doppler incoherence and correct the Carrier Doppler + // if (d_trk_parameters.enable_doppler_correction == true) + // { + // if (d_pull_in_transitory == false and d_corrected_doppler == false) + // { + // todo: algorithm here... + // } + // } // correct code and carrier phase d_rem_code_phase_samples += d_trk_parameters.fs_in * d_code_error_kf_chips / d_code_freq_kf_chips_s; @@ -1224,6 +1278,8 @@ void kf_vtl_tracking::clear_tracking_vars() d_Prompt_circular_buffer.clear(); d_carrier_phase_rate_step_rad = 0.0; d_code_phase_rate_step_chips = 0.0; + d_carr_ph_history.clear(); + d_code_ph_history.clear(); } @@ -1237,8 +1293,6 @@ void kf_vtl_tracking::update_tracking_vars() // keep alignment parameters for the next input buffer // Compute the next buffer length based in the new period of the PRN sequence and the code phase error estimation d_T_prn_samples = d_T_prn_seconds * d_trk_parameters.fs_in; - // d_K_blk_samples = d_T_prn_samples + d_rem_code_phase_samples + d_trk_parameters.fs_in * d_code_error_kf_chips / d_code_freq_kf_chips_s; - // KF will update d_rem_code_phase_samples d_K_blk_samples = d_T_prn_samples + d_rem_code_phase_samples; d_current_prn_length_samples = static_cast(std::floor(d_K_blk_samples)); // round to a discrete number of samples @@ -1247,16 +1301,37 @@ void kf_vtl_tracking::update_tracking_vars() d_carrier_phase_step_rad = TWO_PI * d_carrier_doppler_kf_hz / d_trk_parameters.fs_in; // d_rem_carr_phase_rad = d_carrier_phase_kf_rad; - // remnant carrier phase to prevent overflow in the code NCO - d_rem_carr_phase_rad += static_cast(d_carrier_phase_step_rad * static_cast(d_current_prn_length_samples) + - 0.5 * d_carrier_phase_rate_step_rad * static_cast(d_current_prn_length_samples) * static_cast(d_current_prn_length_samples)); - d_rem_carr_phase_rad = fmod(d_rem_carr_phase_rad, TWO_PI); - // carrier phase rate step (NCO phase increment rate per sample) [rads/sample^2] if (d_trk_parameters.high_dyn) { - d_carrier_phase_rate_step_rad = TWO_PI * d_carrier_doppler_rate_kf_hz_s / d_trk_parameters.fs_in; + // d_carrier_phase_rate_step_rad = TWO_PI * d_carrier_doppler_rate_kf_hz_s / d_trk_parameters.fs_in; + + // d_carrier_doppler_rate_kf_hz_s = d_carrier_phase_rate_step_rad * d_trk_parameters.fs_in / TWO_PI; + d_carr_ph_history.push_back(std::pair(d_carrier_phase_step_rad, static_cast(d_current_prn_length_samples))); + if (d_carr_ph_history.full()) + { + double tmp_cp1 = 0.0; + double tmp_cp2 = 0.0; + double tmp_samples = 0.0; + for (unsigned int k = 0; k < d_trk_parameters.smoother_length; k++) + { + tmp_cp1 += d_carr_ph_history[k].first; + tmp_cp2 += d_carr_ph_history[d_trk_parameters.smoother_length * 2 - k - 1].first; + tmp_samples += d_carr_ph_history[d_trk_parameters.smoother_length * 2 - k - 1].second; + } + tmp_cp1 /= static_cast(d_trk_parameters.smoother_length); + tmp_cp2 /= static_cast(d_trk_parameters.smoother_length); + d_carrier_phase_rate_step_rad = (tmp_cp2 - tmp_cp1) / tmp_samples; + d_x_old_old(3) = d_carrier_phase_rate_step_rad * d_trk_parameters.fs_in / TWO_PI; + } } + // remnant carrier phase to prevent overflow in the code NCO + auto remnant_carrier_phase = static_cast(d_carrier_phase_step_rad * static_cast(d_current_prn_length_samples) + + 0.5 * d_carrier_phase_rate_step_rad * static_cast(d_current_prn_length_samples) * static_cast(d_current_prn_length_samples)); + d_rem_carr_phase_rad += remnant_carrier_phase; + d_rem_carr_phase_rad = fmod(d_rem_carr_phase_rad, TWO_PI); + + // std::cout << d_carrier_phase_rate_step_rad * d_trk_parameters.fs_in * d_trk_parameters.fs_in / TWO_PI << '\n'; // remnant carrier phase to prevent overflow in the code NCO // d_rem_carr_phase_rad += static_cast(d_carrier_phase_step_rad * static_cast(d_current_prn_length_samples) + 0.5 * d_carrier_phase_rate_step_rad * static_cast(d_current_prn_length_samples) * static_cast(d_current_prn_length_samples)); @@ -1266,17 +1341,31 @@ void kf_vtl_tracking::update_tracking_vars() // double a = d_carrier_phase_step_rad * static_cast(d_current_prn_length_samples); // double b = 0.5 * d_carrier_phase_rate_step_rad * static_cast(d_current_prn_length_samples) * static_cast(d_current_prn_length_samples); // std::cout << fmod(b, TWO_PI) / fmod(a, TWO_PI) << '\n'; - d_acc_carrier_phase_rad -= (d_carrier_phase_step_rad * static_cast(d_current_prn_length_samples) + - 0.5 * d_carrier_phase_rate_step_rad * static_cast(d_current_prn_length_samples) * static_cast(d_current_prn_length_samples)); + d_acc_carrier_phase_rad -= remnant_carrier_phase; // ################### DLL COMMANDS ################################################# // code phase step (Code resampler phase increment per sample) [chips/sample] d_code_phase_step_chips = d_code_freq_kf_chips_s / d_trk_parameters.fs_in; // todo: extend kf to estimate code rate - // if (d_trk_parameters.high_dyn) - // { - // d_code_phase_rate_step_chips = d_code_freq_kf_rate_chips_s / d_trk_parameters.fs_in; - // } + if (d_trk_parameters.high_dyn) + { + d_code_ph_history.push_back(std::pair(d_code_phase_step_chips, static_cast(d_current_prn_length_samples))); + if (d_code_ph_history.full()) + { + double tmp_cp1 = 0.0; + double tmp_cp2 = 0.0; + double tmp_samples = 0.0; + for (unsigned int k = 0; k < d_trk_parameters.smoother_length; k++) + { + tmp_cp1 += d_code_ph_history[k].first; + tmp_cp2 += d_code_ph_history[d_trk_parameters.smoother_length * 2 - k - 1].first; + tmp_samples += d_code_ph_history[d_trk_parameters.smoother_length * 2 - k - 1].second; + } + tmp_cp1 /= static_cast(d_trk_parameters.smoother_length); + tmp_cp2 /= static_cast(d_trk_parameters.smoother_length); + d_code_phase_rate_step_chips = (tmp_cp2 - tmp_cp1) / tmp_samples; + } + } // remnant code phase [chips] d_rem_code_phase_samples = d_K_blk_samples - static_cast(d_current_prn_length_samples); // rounding error < 1 sample @@ -1792,17 +1881,6 @@ int kf_vtl_tracking::general_work(int noutput_items __attribute__((unused)), gr_ d_cn0_smoother.reset(); d_carrier_lock_test_smoother.reset(); - // init KF - // d_T_chip_seconds = 1.0 / d_code_freq_chips; - // d_T_prn_seconds = d_T_chip_seconds * static_cast(samples_offset); - // // keep alignment parameters for the next input buffer - // // Compute the next buffer length based in the new period of the PRN sequence and the code phase error estimation - // d_T_prn_samples = d_T_prn_seconds * d_trk_parameters.fs_in; - // d_K_blk_samples = d_T_prn_samples + d_rem_code_phase_samples; - // // remnant code phase [chips] - // d_rem_code_phase_samples = d_K_blk_samples - static_cast(d_current_prn_length_samples); // rounding error < 1 sample - // d_rem_code_phase_chips = d_code_freq_chips * d_rem_code_phase_samples / d_trk_parameters.fs_in; - init_kf(0, d_carrier_doppler_kf_hz); LOG(INFO) << "Number of samples between Acquisition and Tracking = " << acq_trk_diff_samples << " ( " << acq_trk_diff_seconds << " s)"; @@ -1956,7 +2034,8 @@ int kf_vtl_tracking::general_work(int noutput_items __attribute__((unused)), gr_ // perform a correlation step do_correlation_step(in); save_correlation_results(); - update_tracking_vars(); + // run_Kf(); + update_tracking_vars(); // ? if (d_current_data_symbol == 0) { log_data(); @@ -2003,13 +2082,7 @@ int kf_vtl_tracking::general_work(int noutput_items __attribute__((unused)), gr_ } else { - if (d_trk_parameters.use_estimated_cn0 == true) - { - if (d_CN0_SNV_dB_Hz > 0) - { - update_kf_cn0(d_CN0_SNV_dB_Hz); - } - } + update_kf_cn0(d_CN0_SNV_dB_Hz); run_Kf(); update_tracking_vars(); check_carrier_phase_coherent_initialization(); diff --git a/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.h b/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.h index eb3152ff2..9dd9f8317 100644 --- a/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.h +++ b/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.h @@ -112,6 +112,8 @@ private: volk_gnsssdr::vector d_Prompt_buffer; boost::circular_buffer d_Prompt_circular_buffer; + boost::circular_buffer> d_code_ph_history; + boost::circular_buffer> d_carr_ph_history; const size_t d_int_type_hash_code = typeid(int).hash_code(); diff --git a/src/algorithms/tracking/libs/kf_conf.cc b/src/algorithms/tracking/libs/kf_conf.cc index 735098008..ab3c5a6df 100644 --- a/src/algorithms/tracking/libs/kf_conf.cc +++ b/src/algorithms/tracking/libs/kf_conf.cc @@ -28,24 +28,20 @@ Kf_Conf::Kf_Conf() : item_type("gr_complex"), dump_filename("./Kf_dump.dat"), fs_in(2000000.0), carrier_lock_th(FLAGS_carrier_lock_th), - expected_cn0_dbhz(42.0), - code_disc_sd_chips(0.01), - carrier_disc_sd_rads(0.1), - code_phase_sd_chips(0.001), - code_rate_sd_chips_s(0.001), - carrier_phase_sd_rad(0.001), - carrier_freq_sd_hz(0.1), - carrier_freq_rate_sd_hz_s(1), - narrow_code_phase_sd_chips(0.001), - narrow_code_rate_sd_chips_s(0.001), - narrow_carrier_phase_sd_rad(0.001), - narrow_carrier_freq_sd_hz(0.1), - narrow_carrier_freq_rate_sd_hz_s(1), - init_code_phase_sd_chips(1), - init_code_rate_sd_chips_s(100), - init_carrier_phase_sd_rad(10), - init_carrier_freq_sd_hz(1000), - init_carrier_freq_rate_sd_hz_s(1000), + code_disc_sd_chips(0.2), + carrier_disc_sd_rads(0.3), + code_phase_sd_chips(0.15), + carrier_phase_sd_rad(0.25), + carrier_freq_sd_hz(0.6), + carrier_freq_rate_sd_hz_s(0.01), + // narrow_code_phase_sd_chips(0.1), + // narrow_carrier_phase_sd_rad(0.01), + // narrow_carrier_freq_sd_hz(0.01), + // narrow_carrier_freq_rate_sd_hz_s(0.1), + init_code_phase_sd_chips(0.5), + init_carrier_phase_sd_rad(0.7), + init_carrier_freq_sd_hz(5), + init_carrier_freq_rate_sd_hz_s(1), early_late_space_chips(0.25), very_early_late_space_chips(0.5), early_late_space_narrow_chips(0.15), @@ -69,12 +65,9 @@ Kf_Conf::Kf_Conf() : item_type("gr_complex"), system('G'), track_pilot(true), enable_doppler_correction(false), - carrier_aiding(true), high_dyn(false), dump(false), - dump_mat(true), - enable_dynamic_measurement_covariance(false), - use_estimated_cn0(false) + dump_mat(true) { signal[0] = '1'; signal[1] = 'C'; @@ -112,7 +105,7 @@ void Kf_Conf::SetFromConfiguration(const 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); + // 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); @@ -129,33 +122,33 @@ void Kf_Conf::SetFromConfiguration(const ConfigurationInterface *configuration, // Kalman filter covariances // Measurement covariances (R) - expected_cn0_dbhz = configuration->property(role + ".expected_cn0_dbhz", expected_cn0_dbhz); + // expected_cn0_dbhz = configuration->property(role + ".expected_cn0_dbhz", expected_cn0_dbhz); code_disc_sd_chips = configuration->property(role + ".code_disc_sd_chips", code_disc_sd_chips); carrier_disc_sd_rads = configuration->property(role + ".carrier_disc_sd_rads", carrier_disc_sd_rads); - enable_dynamic_measurement_covariance = configuration->property(role + ".enable_dynamic_measurement_covariance", enable_dynamic_measurement_covariance); - use_estimated_cn0 = configuration->property(role + ".use_estimated_cn0", use_estimated_cn0); + // enable_dynamic_measurement_covariance = configuration->property(role + ".enable_dynamic_measurement_covariance", enable_dynamic_measurement_covariance); + // use_estimated_cn0 = configuration->property(role + ".use_estimated_cn0", use_estimated_cn0); // System covariances (Q) code_phase_sd_chips = configuration->property(role + ".code_phase_sd_chips", code_phase_sd_chips); - code_rate_sd_chips_s = configuration->property(role + ".code_rate_sd_chips_s", code_rate_sd_chips_s); + // code_rate_sd_chips_s = configuration->property(role + ".code_rate_sd_chips_s", code_rate_sd_chips_s); carrier_phase_sd_rad = configuration->property(role + ".carrier_phase_sd_rad", carrier_phase_sd_rad); carrier_freq_sd_hz = configuration->property(role + ".carrier_freq_sd_hz", carrier_freq_sd_hz); carrier_freq_rate_sd_hz_s = configuration->property(role + ".carrier_freq_rate_sd_hz_s", carrier_freq_rate_sd_hz_s); // System covariances (narrow) (Q) - narrow_code_phase_sd_chips = configuration->property(role + ".narrow_code_phase_sd_chips", narrow_code_phase_sd_chips); - narrow_code_rate_sd_chips_s = configuration->property(role + ".narrow_code_rate_sd_chips_s", narrow_code_rate_sd_chips_s); + //narrow_code_phase_sd_chips = configuration->property(role + ".narrow_code_phase_sd_chips", narrow_code_phase_sd_chips); + // narrow_code_rate_sd_chips_s = configuration->property(role + ".narrow_code_rate_sd_chips_s", narrow_code_rate_sd_chips_s); - narrow_carrier_phase_sd_rad = configuration->property(role + ".narrow_carrier_phase_sd_rad", narrow_carrier_phase_sd_rad); - narrow_carrier_freq_sd_hz = configuration->property(role + ".narrow_carrier_freq_sd_hz", narrow_carrier_freq_sd_hz); - narrow_carrier_freq_rate_sd_hz_s = configuration->property(role + ".narrow_carrier_freq_rate_sd_hz_s", narrow_carrier_freq_rate_sd_hz_s); + //narrow_carrier_phase_sd_rad = configuration->property(role + ".narrow_carrier_phase_sd_rad", narrow_carrier_phase_sd_rad); + // narrow_carrier_freq_sd_hz = configuration->property(role + ".narrow_carrier_freq_sd_hz", narrow_carrier_freq_sd_hz); + // narrow_carrier_freq_rate_sd_hz_s = configuration->property(role + ".narrow_carrier_freq_rate_sd_hz_s", narrow_carrier_freq_rate_sd_hz_s); // initial Kalman covariance matrix (P) init_code_phase_sd_chips = configuration->property(role + ".init_code_phase_sd_chips", init_code_phase_sd_chips); - init_code_rate_sd_chips_s = configuration->property(role + ".init_code_rate_sd_chips_s", init_code_rate_sd_chips_s); + // init_code_rate_sd_chips_s = configuration->property(role + ".init_code_rate_sd_chips_s", init_code_rate_sd_chips_s); init_carrier_phase_sd_rad = configuration->property(role + ".init_carrier_phase_sd_rad", init_carrier_phase_sd_rad); init_carrier_freq_sd_hz = configuration->property(role + ".init_carrier_freq_sd_hz", init_carrier_freq_sd_hz); diff --git a/src/algorithms/tracking/libs/kf_conf.h b/src/algorithms/tracking/libs/kf_conf.h index 43c2ef0a5..1c8789fb4 100644 --- a/src/algorithms/tracking/libs/kf_conf.h +++ b/src/algorithms/tracking/libs/kf_conf.h @@ -40,30 +40,30 @@ public: // KF statistics // states: code_phase_chips, carrier_phase_rads, carrier_freq_hz, carrier_freq_rate_hz_s, code_freq_rate_chips_s // Measurement covariances (R) - double expected_cn0_dbhz; + // double expected_cn0_dbhz; double code_disc_sd_chips; double carrier_disc_sd_rads; // System covariances (Q) double code_phase_sd_chips; - double code_rate_sd_chips_s; + // double code_rate_sd_chips_s; double carrier_phase_sd_rad; double carrier_freq_sd_hz; double carrier_freq_rate_sd_hz_s; // System covariances (narrow) (Q) - double narrow_code_phase_sd_chips; - double narrow_code_rate_sd_chips_s; + // double narrow_code_phase_sd_chips; + // double narrow_code_rate_sd_chips_s; - double narrow_carrier_phase_sd_rad; - double narrow_carrier_freq_sd_hz; - double narrow_carrier_freq_rate_sd_hz_s; + // double narrow_carrier_phase_sd_rad; + // double narrow_carrier_freq_sd_hz; + //double narrow_carrier_freq_rate_sd_hz_s; // initial Kalman covariance matrix (P) double init_code_phase_sd_chips; - double init_code_rate_sd_chips_s; + // double init_code_rate_sd_chips_s; double init_carrier_phase_sd_rad; double init_carrier_freq_sd_hz; @@ -93,13 +93,12 @@ public: char system; bool track_pilot; bool enable_doppler_correction; - bool carrier_aiding; bool high_dyn; bool dump; bool dump_mat; - bool enable_dynamic_measurement_covariance; - bool use_estimated_cn0; + // bool enable_dynamic_measurement_covariance; + // bool use_estimated_cn0; }; #endif From 01fc2b1120fecb98b0c2e40dbe7c149e925fadc0 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 22 Jul 2022 13:20:25 +0200 Subject: [PATCH 02/11] Add work on KF tracking --- .../gnuradio_blocks/kf_vtl_tracking.cc | 53 ++----------------- src/algorithms/tracking/libs/kf_conf.cc | 22 -------- src/algorithms/tracking/libs/kf_conf.h | 18 ------- 3 files changed, 3 insertions(+), 90 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.cc index b24fe18e5..94eb6bc1e 100644 --- a/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.cc @@ -18,6 +18,7 @@ * ----------------------------------------------------------------------------- */ +#include "kf_vtl_tracking.h" #include "Beidou_B1I.h" #include "Beidou_B3I.h" #include "GPS_L1_CA.h" @@ -39,7 +40,6 @@ #include "gps_l2c_signal_replica.h" #include "gps_l5_signal_replica.h" #include "gps_sdr_signal_replica.h" -#include "kf_vtl_tracking.h" #include "lock_detectors.h" #include "tracking_discriminators.h" #include "trackingcmd.h" @@ -859,50 +859,29 @@ void kf_vtl_tracking::init_kf(double acq_code_phase_chips, double acq_doppler_hz const double B = d_code_chip_rate / d_signal_carrier_freq; // carrier to code rate factor - d_F = arma::mat(4, 4); d_F = {{1, 0, B * Ti, B * TiTi / 2}, {0, 1, 2.0 * GNSS_PI * Ti, GNSS_PI * TiTi}, {0, 0, 1, Ti}, {0, 0, 0, 1}}; - d_H = arma::mat(2, 4); d_H = {{1, 0, -B * Ti / 2.0, B * TiTi / 6.0}, {0, 1, -GNSS_PI * Ti, GNSS_PI * TiTi / 3.0}}; - // Phase noise variance - // const double CN0_lin = pow(10.0, d_trk_parameters.expected_cn0_dbhz / 10.0); // CN0 in Hz - // const double N_periods = 1; // Only 1 interval - // const double Sigma2_Tau = 0.25 * (1.0 + 2.0 * CN0_lin * Ti) / (N_periods * pow(CN0_lin * Ti, 2.0)) * (1.0 + (1.0 + 2.0 * CN0_lin * Ti) / (pow(N_periods * (CN0_lin * Ti), 2.0))); - // const double Sigma2_Phase = 1.0 / (2.0 * CN0_lin * Ti) * (1.0 + 1.0 / (2.0 * CN0_lin * Ti)); - - // measurement covariance matrix (static) - // d_R = arma::mat(2, 2); - // d_R << Sigma2_Tau << 0 << arma::endr - // << 0 << Sigma2_Phase << arma::endr; - - d_R = arma::mat(2, 2); d_R = {{pow(d_trk_parameters.code_disc_sd_chips, 2.0), 0}, {0, pow(d_trk_parameters.carrier_disc_sd_rads, 2.0)}}; - // system cov11ariance matrix (static) - d_Q = arma::mat(4, 4); + // system covariance matrix (static) d_Q = {{pow(d_trk_parameters.code_phase_sd_chips, 2.0), 0, 0, 0}, {0, pow(d_trk_parameters.carrier_phase_sd_rad, 2.0), 0, 0}, {0, 0, pow(d_trk_parameters.carrier_freq_sd_hz, 2.0), 0}, {0, 0, 0, pow(d_trk_parameters.carrier_freq_rate_sd_hz_s, 2.0)}}; // initial Kalman covariance matrix - d_P_old_old = arma::mat(4, 4); d_P_old_old = {{pow(d_trk_parameters.init_code_phase_sd_chips, 2.0), 0, 0, 0}, {0, pow(d_trk_parameters.init_carrier_phase_sd_rad, 2.0), 0, 0}, {0, 0, pow(d_trk_parameters.init_carrier_freq_sd_hz, 2.0), 0}, {0, 0, 0, pow(d_trk_parameters.init_carrier_freq_rate_sd_hz_s, 2.0)}}; - // d_R = arma::mat(2, 2); - // d_R << Sigma2_Tau << 0 << arma::endr - // << 0 << Sigma2_Phase << arma::endr; - // init state vector - d_x_old_old = arma::vec(4); // states: code_phase_chips, carrier_phase_rads, carrier_freq_hz, carrier_freq_rate_hz_s d_x_old_old = {acq_code_phase_chips, 0, acq_doppler_hz, 0}; @@ -940,25 +919,14 @@ void kf_vtl_tracking::update_kf_narrow_integration_time() d_H = {{1, 0, -B * Ti / 2.0, B * TiTi / 6.0}, {0, 1, -GNSS_PI * Ti, GNSS_PI * TiTi / 3.0}}; - // system covariance matrix (static) - // d_Q << pow(d_trk_parameters.narrow_code_phase_sd_chips, 2.0) << 0 << 0 << 0 << arma::endr - // << 0 << pow(d_trk_parameters.narrow_carrier_phase_sd_rad, 2.0) << 0 << 0 << arma::endr - // << 0 << 0 << pow(d_trk_parameters.narrow_carrier_freq_sd_hz, 2.0) << 0 << arma::endr - // << 0 << 0 << 0 << pow(d_trk_parameters.narrow_carrier_freq_rate_sd_hz_s, 2.0) << arma::endr; const double CN0_lin = pow(10.0, d_CN0_SNV_dB_Hz / 10.0); // CN0 in Hz const double CN0_lin_Ti = CN0_lin * Ti; - // const double N_periods = 1; // Only 1 interval - // const double Sigma2_Tau = 0.25 * (1.0 + 2.0 * CN0_lin * Ti) / (N_periods * pow(CN0_lin * Ti, 2.0)) * (1.0 + (1.0 + 2.0 * CN0_lin * Ti) / (pow(N_periods * (CN0_lin * Ti), 2.0))); const double Sigma2_Phase = (1.0 / (2.0 * CN0_lin_Ti)) * (1.0 + 1.0 / (2.0 * CN0_lin_Ti)); - // double prova = (1.0 / (CN0_lin * Ti)) * (0.5 + (0.5 / (1.0 - 0.5)) * (1.0 / (2.0 * CN0_lin * Ti))); - // std::cout << "Sigma2_Tau = " << Sigma2_Tau << ", prova: " << prova << std::endl; const double Sigma2_Tau = (1.0 / CN0_lin_Ti) * (d_trk_parameters.spc + (d_trk_parameters.spc / (1.0 - d_trk_parameters.spc)) * (1.0 / (2.0 * CN0_lin_Ti))); - d_R = arma::mat(2, 2); d_R = {{Sigma2_Tau, 0}, {0, Sigma2_Phase}}; - // << 0 << 0 << 0 << 0 << pow(d_trk_parameters.narrow_code_rate_sd_chips_s, 2.0) << arma::endr; std::cout << "Fu: " << d_F << "\n"; std::cout << "Hu: " << d_H << "\n"; std::cout << "Ru: " << d_R << "\n"; @@ -982,14 +950,9 @@ void kf_vtl_tracking::update_kf_cn0(double current_cn0_dbhz) // Phase noise variance const double CN0_lin = pow(10.0, current_cn0_dbhz / 10.0); // CN0 in Hz const double CN0_lin_Ti = CN0_lin * Ti; - // const double N_periods = 1; // Only 1 interval - // const double Sigma2_Tau = 0.25 * (1.0 + 2.0 * CN0_lin * Ti) / (N_periods * pow(CN0_lin * Ti, 2.0)) * (1.0 + (1.0 + 2.0 * CN0_lin * Ti) / (pow(N_periods * (CN0_lin * Ti), 2.0))); const double Sigma2_Phase = (1.0 / (2.0 * CN0_lin_Ti)) * (1.0 + 1.0 / (2.0 * CN0_lin_Ti)); - // double prova = (1.0 / (CN0_lin * Ti)) * (0.5 + (0.5 / (1.0 - 0.5)) * (1.0 / (2.0 * CN0_lin * Ti))); - // std::cout << "Sigma2_Tau = " << Sigma2_Tau << ", prova: " << prova << std::endl; const double Sigma2_Tau = (1.0 / CN0_lin_Ti) * (d_trk_parameters.spc + (d_trk_parameters.spc / (1.0 - d_trk_parameters.spc)) * (1.0 / (2.0 * CN0_lin_Ti))); - // measurement covariance matrix (static)d_trk_parameters.spc - d_R = arma::mat(2, 2); + d_R = {{Sigma2_Tau, 0}, {0, Sigma2_Phase}}; } @@ -1331,16 +1294,6 @@ void kf_vtl_tracking::update_tracking_vars() d_rem_carr_phase_rad += remnant_carrier_phase; d_rem_carr_phase_rad = fmod(d_rem_carr_phase_rad, TWO_PI); - - // std::cout << d_carrier_phase_rate_step_rad * d_trk_parameters.fs_in * d_trk_parameters.fs_in / TWO_PI << '\n'; - // remnant carrier phase to prevent overflow in the code NCO - // d_rem_carr_phase_rad += static_cast(d_carrier_phase_step_rad * static_cast(d_current_prn_length_samples) + 0.5 * d_carrier_phase_rate_step_rad * static_cast(d_current_prn_length_samples) * static_cast(d_current_prn_length_samples)); - // d_rem_carr_phase_rad = fmod(d_rem_carr_phase_rad, TWO_PI); - - // carrier phase accumulator - // double a = d_carrier_phase_step_rad * static_cast(d_current_prn_length_samples); - // double b = 0.5 * d_carrier_phase_rate_step_rad * static_cast(d_current_prn_length_samples) * static_cast(d_current_prn_length_samples); - // std::cout << fmod(b, TWO_PI) / fmod(a, TWO_PI) << '\n'; d_acc_carrier_phase_rad -= remnant_carrier_phase; // ################### DLL COMMANDS ################################################# diff --git a/src/algorithms/tracking/libs/kf_conf.cc b/src/algorithms/tracking/libs/kf_conf.cc index ab3c5a6df..80b049c38 100644 --- a/src/algorithms/tracking/libs/kf_conf.cc +++ b/src/algorithms/tracking/libs/kf_conf.cc @@ -34,10 +34,6 @@ Kf_Conf::Kf_Conf() : item_type("gr_complex"), carrier_phase_sd_rad(0.25), carrier_freq_sd_hz(0.6), carrier_freq_rate_sd_hz_s(0.01), - // narrow_code_phase_sd_chips(0.1), - // narrow_carrier_phase_sd_rad(0.01), - // narrow_carrier_freq_sd_hz(0.01), - // narrow_carrier_freq_rate_sd_hz_s(0.1), init_code_phase_sd_chips(0.5), init_carrier_phase_sd_rad(0.7), init_carrier_freq_sd_hz(5), @@ -105,7 +101,6 @@ void Kf_Conf::SetFromConfiguration(const 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); @@ -122,34 +117,17 @@ void Kf_Conf::SetFromConfiguration(const ConfigurationInterface *configuration, // Kalman filter covariances // Measurement covariances (R) - // expected_cn0_dbhz = configuration->property(role + ".expected_cn0_dbhz", expected_cn0_dbhz); - code_disc_sd_chips = configuration->property(role + ".code_disc_sd_chips", code_disc_sd_chips); carrier_disc_sd_rads = configuration->property(role + ".carrier_disc_sd_rads", carrier_disc_sd_rads); - // enable_dynamic_measurement_covariance = configuration->property(role + ".enable_dynamic_measurement_covariance", enable_dynamic_measurement_covariance); - // use_estimated_cn0 = configuration->property(role + ".use_estimated_cn0", use_estimated_cn0); - // System covariances (Q) code_phase_sd_chips = configuration->property(role + ".code_phase_sd_chips", code_phase_sd_chips); - // code_rate_sd_chips_s = configuration->property(role + ".code_rate_sd_chips_s", code_rate_sd_chips_s); - carrier_phase_sd_rad = configuration->property(role + ".carrier_phase_sd_rad", carrier_phase_sd_rad); carrier_freq_sd_hz = configuration->property(role + ".carrier_freq_sd_hz", carrier_freq_sd_hz); carrier_freq_rate_sd_hz_s = configuration->property(role + ".carrier_freq_rate_sd_hz_s", carrier_freq_rate_sd_hz_s); - // System covariances (narrow) (Q) - //narrow_code_phase_sd_chips = configuration->property(role + ".narrow_code_phase_sd_chips", narrow_code_phase_sd_chips); - // narrow_code_rate_sd_chips_s = configuration->property(role + ".narrow_code_rate_sd_chips_s", narrow_code_rate_sd_chips_s); - - //narrow_carrier_phase_sd_rad = configuration->property(role + ".narrow_carrier_phase_sd_rad", narrow_carrier_phase_sd_rad); - // narrow_carrier_freq_sd_hz = configuration->property(role + ".narrow_carrier_freq_sd_hz", narrow_carrier_freq_sd_hz); - // narrow_carrier_freq_rate_sd_hz_s = configuration->property(role + ".narrow_carrier_freq_rate_sd_hz_s", narrow_carrier_freq_rate_sd_hz_s); - // initial Kalman covariance matrix (P) init_code_phase_sd_chips = configuration->property(role + ".init_code_phase_sd_chips", init_code_phase_sd_chips); - // init_code_rate_sd_chips_s = configuration->property(role + ".init_code_rate_sd_chips_s", init_code_rate_sd_chips_s); - init_carrier_phase_sd_rad = configuration->property(role + ".init_carrier_phase_sd_rad", init_carrier_phase_sd_rad); init_carrier_freq_sd_hz = configuration->property(role + ".init_carrier_freq_sd_hz", init_carrier_freq_sd_hz); init_carrier_freq_rate_sd_hz_s = configuration->property(role + ".init_carrier_freq_rate_sd_hz_s", init_carrier_freq_rate_sd_hz_s); diff --git a/src/algorithms/tracking/libs/kf_conf.h b/src/algorithms/tracking/libs/kf_conf.h index 1c8789fb4..fe7d620b3 100644 --- a/src/algorithms/tracking/libs/kf_conf.h +++ b/src/algorithms/tracking/libs/kf_conf.h @@ -38,33 +38,18 @@ public: double carrier_lock_th; // KF statistics - // states: code_phase_chips, carrier_phase_rads, carrier_freq_hz, carrier_freq_rate_hz_s, code_freq_rate_chips_s // Measurement covariances (R) - // double expected_cn0_dbhz; - double code_disc_sd_chips; double carrier_disc_sd_rads; // System covariances (Q) double code_phase_sd_chips; - // double code_rate_sd_chips_s; - double carrier_phase_sd_rad; double carrier_freq_sd_hz; double carrier_freq_rate_sd_hz_s; - // System covariances (narrow) (Q) - // double narrow_code_phase_sd_chips; - // double narrow_code_rate_sd_chips_s; - - // double narrow_carrier_phase_sd_rad; - // double narrow_carrier_freq_sd_hz; - //double narrow_carrier_freq_rate_sd_hz_s; - // initial Kalman covariance matrix (P) double init_code_phase_sd_chips; - // double init_code_rate_sd_chips_s; - double init_carrier_phase_sd_rad; double init_carrier_freq_sd_hz; double init_carrier_freq_rate_sd_hz_s; @@ -96,9 +81,6 @@ public: bool high_dyn; bool dump; bool dump_mat; - - // bool enable_dynamic_measurement_covariance; - // bool use_estimated_cn0; }; #endif From 128425a00d8585905cfb8873fdb40ba708f586ed Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 22 Jul 2022 13:26:43 +0200 Subject: [PATCH 03/11] Update local version of Protocol Buffers to v21.3 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8bb49d6a9..45c36ea33 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -341,7 +341,7 @@ set(GNSSSDR_GNSS_SIM_LOCAL_VERSION "master") set(GNSSSDR_GNSSTK_LOCAL_VERSION "13.4.0") set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.23") set(GNSSSDR_PUGIXML_LOCAL_VERSION "1.12") -set(GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION "21.1") +set(GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION "21.3") set(GNSSSDR_BENCHMARK_LOCAL_VERSION "1.6.2") set(GNSSSDR_MATHJAX_EXTERNAL_VERSION "2.7.7") From 20d2c0d60123c056a0709d0dd31c4ad0b5d8ce72 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 25 Jul 2022 08:40:58 +0200 Subject: [PATCH 04/11] Remove line --- src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.cc index 94eb6bc1e..6f42bb694 100644 --- a/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.cc @@ -905,7 +905,6 @@ void kf_vtl_tracking::update_kf_narrow_integration_time() for (int i = 0; i < d_trk_parameters.extend_correlation_symbols; i++) { Qnew += d_F * d_Q * d_F.t(); - // d_F = d_F * d_F; d_Q = d_F * d_Q * d_F.t(); } d_Q = Qnew; From a7a59fe9c19752f40e5854792237b6a13e452599 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 30 Jul 2022 10:07:06 +0200 Subject: [PATCH 05/11] Beta as a private member --- .../gnuradio_blocks/kf_vtl_tracking.cc | 70 +++++++++---------- .../gnuradio_blocks/kf_vtl_tracking.h | 2 + 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.cc index 6f42bb694..8a3a8ff6d 100644 --- a/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.cc @@ -109,6 +109,7 @@ kf_vtl_tracking::kf_vtl_tracking(const Kf_Conf &conf_) d_code_phase_rate_step_chips(0.0), d_rem_code_phase_chips(0.0), d_rem_code_phase_samples(0.0), + d_beta(0.0), d_sample_counter(0ULL), d_acq_sample_stamp(0ULL), d_rem_carr_phase_rad(0.0), @@ -437,13 +438,15 @@ kf_vtl_tracking::kf_vtl_tracking(const Kf_Conf &conf_) std::cerr << "Invalid System argument when instantiating tracking blocks\n"; d_correlation_length_ms = 1; d_secondary = false; - d_signal_carrier_freq = 0.0; + d_signal_carrier_freq = 1.0; d_code_period = 0.0; d_code_length_chips = 0; d_code_samples_per_chip = 0U; d_symbols_per_bit = 0; } + d_beta = d_code_chip_rate / d_signal_carrier_freq; + // Initialization of local code replica // Get space for a vector with the sinboc(1,1) replica sampled 2x/chip d_tracking_code.resize(2 * d_code_length_chips, 0.0); @@ -857,33 +860,31 @@ void kf_vtl_tracking::init_kf(double acq_code_phase_chips, double acq_doppler_hz const double Ti = d_current_correlation_time_s; const double TiTi = Ti * Ti; - const double B = d_code_chip_rate / d_signal_carrier_freq; // carrier to code rate factor + d_F = {{1.0, 0.0, d_beta * Ti, d_beta * TiTi / 2.0}, + {0.0, 1.0, 2.0 * GNSS_PI * Ti, GNSS_PI * TiTi}, + {0.0, 0.0, 1.0, Ti}, + {0.0, 0.0, 0.0, 1.0}}; - d_F = {{1, 0, B * Ti, B * TiTi / 2}, - {0, 1, 2.0 * GNSS_PI * Ti, GNSS_PI * TiTi}, - {0, 0, 1, Ti}, - {0, 0, 0, 1}}; + d_H = {{1.0, 0.0, -d_beta * Ti / 2.0, d_beta * TiTi / 6.0}, + {0.0, 1.0, -GNSS_PI * Ti, GNSS_PI * TiTi / 3.0}}; - d_H = {{1, 0, -B * Ti / 2.0, B * TiTi / 6.0}, - {0, 1, -GNSS_PI * Ti, GNSS_PI * TiTi / 3.0}}; - - d_R = {{pow(d_trk_parameters.code_disc_sd_chips, 2.0), 0}, - {0, pow(d_trk_parameters.carrier_disc_sd_rads, 2.0)}}; + d_R = {{pow(d_trk_parameters.code_disc_sd_chips, 2.0), 0.0}, + {0.0, pow(d_trk_parameters.carrier_disc_sd_rads, 2.0)}}; // system covariance matrix (static) - d_Q = {{pow(d_trk_parameters.code_phase_sd_chips, 2.0), 0, 0, 0}, - {0, pow(d_trk_parameters.carrier_phase_sd_rad, 2.0), 0, 0}, - {0, 0, pow(d_trk_parameters.carrier_freq_sd_hz, 2.0), 0}, - {0, 0, 0, pow(d_trk_parameters.carrier_freq_rate_sd_hz_s, 2.0)}}; + d_Q = {{pow(d_trk_parameters.code_phase_sd_chips, 2.0), 0.0, 0.0, 0.0}, + {0.0, pow(d_trk_parameters.carrier_phase_sd_rad, 2.0), 0.0, 0.0}, + {0.0, 0.0, pow(d_trk_parameters.carrier_freq_sd_hz, 2.0), 0.0}, + {0.0, 0.0, 0.0, pow(d_trk_parameters.carrier_freq_rate_sd_hz_s, 2.0)}}; // initial Kalman covariance matrix - d_P_old_old = {{pow(d_trk_parameters.init_code_phase_sd_chips, 2.0), 0, 0, 0}, - {0, pow(d_trk_parameters.init_carrier_phase_sd_rad, 2.0), 0, 0}, - {0, 0, pow(d_trk_parameters.init_carrier_freq_sd_hz, 2.0), 0}, - {0, 0, 0, pow(d_trk_parameters.init_carrier_freq_rate_sd_hz_s, 2.0)}}; + d_P_old_old = {{pow(d_trk_parameters.init_code_phase_sd_chips, 2.0), 0.0, 0.0, 0.0}, + {0.0, pow(d_trk_parameters.init_carrier_phase_sd_rad, 2.0), 0.0, 0.0}, + {0.0, 0.0, pow(d_trk_parameters.init_carrier_freq_sd_hz, 2.0), 0.0}, + {0.0, 0.0, 0.0, pow(d_trk_parameters.init_carrier_freq_rate_sd_hz_s, 2.0)}}; // states: code_phase_chips, carrier_phase_rads, carrier_freq_hz, carrier_freq_rate_hz_s - d_x_old_old = {acq_code_phase_chips, 0, acq_doppler_hz, 0}; + d_x_old_old = {acq_code_phase_chips, 0.0, acq_doppler_hz, 0.0}; std::cout << "F: " << d_F << "\n"; std::cout << "H: " << d_H << "\n"; @@ -900,7 +901,6 @@ void kf_vtl_tracking::update_kf_narrow_integration_time() const double Ti = d_current_correlation_time_s; const double TiTi = Ti * Ti; - const double B = d_code_chip_rate / d_signal_carrier_freq; // carrier to code rate factor arma::mat Qnew = arma::zeros(4, 4); for (int i = 0; i < d_trk_parameters.extend_correlation_symbols; i++) { @@ -910,21 +910,21 @@ void kf_vtl_tracking::update_kf_narrow_integration_time() d_Q = Qnew; // state vector: code_phase_chips, carrier_phase_rads, carrier_freq_hz, carrier_freq_rate_hz - d_F = {{1, 0, B * Ti, B * TiTi / 2.0}, - {0, 1, 2.0 * GNSS_PI * Ti, GNSS_PI * TiTi}, - {0, 0, 1, Ti}, - {0, 0, 0, 1}}; + d_F = {{1.0, 0.0, d_beta * Ti, d_beta * TiTi / 2.0}, + {0.0, 1.0, 2.0 * GNSS_PI * Ti, GNSS_PI * TiTi}, + {0.0, 0.0, 1.0, Ti}, + {0.0, 0.0, 0.0, 1.0}}; - d_H = {{1, 0, -B * Ti / 2.0, B * TiTi / 6.0}, - {0, 1, -GNSS_PI * Ti, GNSS_PI * TiTi / 3.0}}; + d_H = {{1.0, 0.0, -d_beta * Ti / 2.0, d_beta * TiTi / 6.0}, + {0.0, 1.0, -GNSS_PI * Ti, GNSS_PI * TiTi / 3.0}}; const double CN0_lin = pow(10.0, d_CN0_SNV_dB_Hz / 10.0); // CN0 in Hz const double CN0_lin_Ti = CN0_lin * Ti; const double Sigma2_Phase = (1.0 / (2.0 * CN0_lin_Ti)) * (1.0 + 1.0 / (2.0 * CN0_lin_Ti)); const double Sigma2_Tau = (1.0 / CN0_lin_Ti) * (d_trk_parameters.spc + (d_trk_parameters.spc / (1.0 - d_trk_parameters.spc)) * (1.0 / (2.0 * CN0_lin_Ti))); - d_R = {{Sigma2_Tau, 0}, - {0, Sigma2_Phase}}; + d_R = {{Sigma2_Tau, 0.0}, + {0.0, Sigma2_Phase}}; std::cout << "Fu: " << d_F << "\n"; std::cout << "Hu: " << d_H << "\n"; @@ -940,11 +940,9 @@ void kf_vtl_tracking::update_kf_cn0(double current_cn0_dbhz) // Kalman Filter class variables const double Ti = d_current_correlation_time_s; // d_correlation_length_ms * 0.001; const double TiTi = Ti * Ti; - const double B = d_code_chip_rate / d_signal_carrier_freq; // carrier to code rate factor - d_H = arma::mat(2, 4); - d_H = {{1, 0, -B * Ti / 2.0, B * TiTi / 6.0}, - {0, 1, -GNSS_PI * Ti, GNSS_PI * TiTi / 3.0}}; + d_H = {{1.0, 0.0, -d_beta * Ti / 2.0, d_beta * TiTi / 6.0}, + {0.0, 1.0, -GNSS_PI * Ti, GNSS_PI * TiTi / 3.0}}; // Phase noise variance const double CN0_lin = pow(10.0, current_cn0_dbhz / 10.0); // CN0 in Hz @@ -952,8 +950,8 @@ void kf_vtl_tracking::update_kf_cn0(double current_cn0_dbhz) const double Sigma2_Phase = (1.0 / (2.0 * CN0_lin_Ti)) * (1.0 + 1.0 / (2.0 * CN0_lin_Ti)); const double Sigma2_Tau = (1.0 / CN0_lin_Ti) * (d_trk_parameters.spc + (d_trk_parameters.spc / (1.0 - d_trk_parameters.spc)) * (1.0 / (2.0 * CN0_lin_Ti))); - d_R = {{Sigma2_Tau, 0}, - {0, Sigma2_Phase}}; + d_R = {{Sigma2_Tau, 0.0}, + {0.0, Sigma2_Phase}}; } @@ -1833,7 +1831,7 @@ int kf_vtl_tracking::general_work(int noutput_items __attribute__((unused)), gr_ d_cn0_smoother.reset(); d_carrier_lock_test_smoother.reset(); - init_kf(0, d_carrier_doppler_kf_hz); + init_kf(0.0, d_carrier_doppler_kf_hz); LOG(INFO) << "Number of samples between Acquisition and Tracking = " << acq_trk_diff_samples << " ( " << acq_trk_diff_seconds << " s)"; DLOG(INFO) << "PULL-IN Doppler [Hz] = " << d_carrier_doppler_kf_hz diff --git a/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.h b/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.h index 9dd9f8317..1fe6360ae 100644 --- a/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.h +++ b/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.h @@ -195,6 +195,8 @@ private: double d_rem_code_phase_chips; double d_rem_code_phase_samples; + double d_beta; + uint64_t d_sample_counter; uint64_t d_acq_sample_stamp; From 4e741fe0b4d8e969f3702bfd4b640af33dae6496 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 27 Aug 2022 13:08:18 +0200 Subject: [PATCH 06/11] Improve changelog --- docs/CHANGELOG.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index e93a5309e..96932a2d8 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -69,18 +69,19 @@ All notable changes to GNSS-SDR will be documented in this file. - Fixed large GLONASS velocity errors and the extended correlator when using the `GLONASS_L1_CA_DLL_PLL_C_Aid_Tracking` and `GLONASS_L2_CA_DLL_PLL_C_Aid_Tracking` implementations. -- Added a over-the-wire sample format (that is, the format used between the - device and the UHD) configuration parameter for the `UHD_Signal_Source`, thus - allowing to select the `sc8` format instead of the default `sc16`. This would - reduce the dynamic range and increase quantization noise, but also reduce the - load on the data link and thus allow more bandwidth. +- The `UHD_Signal_Source` learned a new parameter `otw_format` for setting the + [over-the-wire data format](https://files.ettus.com/manual/page_configuration.html#config_stream_args_otw_format) + (that is, the format used between the device and the UHD) in some devices, + thus allowing to select the `sc8` format instead of the default `sc16`. This + would reduce the dynamic range and increase quantization noise, but also + reduce the load on the data link and thus allow more bandwidth. +- The `UHD_Signal_Source` learned another two optional parameters: + `device_recv_frame_size` and `device_num_recv_frames` for overriding + [transport layer defaults](https://files.ettus.com/manual/page_transport.html). - Added gain setting and reading for the XTRX board when using the `Osmosdr_Signal_Source` implementation of a `SignalSource`. - The `Osmosdr_Signal_Source` implementation learned a new parameter `if_bw` to manually set the bandwidth of the bandpass filter on the radio frontend. -- The `UHD_Signal_Source` learned two new optional parameters - `device_recv_frame_size` and `device_num_recv_frames` for overriding - [transport layer defaults](https://files.ettus.com/manual/page_transport.html). - The new configuration parameter `Channels_XX.RF_channel_ID` allows to specify the signal source per channel group. - Allowed the CMake project to be a sub-project. From 4a6f29453ac606dd4703a42bf7c117ad78b76ec7 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 29 Aug 2022 23:34:09 +0200 Subject: [PATCH 07/11] Clean code --- conf/gnss-sdr_labsat_kf_vtl.conf | 55 +------------------ .../gnuradio_blocks/kf_vtl_tracking.cc | 36 +++++------- 2 files changed, 14 insertions(+), 77 deletions(-) diff --git a/conf/gnss-sdr_labsat_kf_vtl.conf b/conf/gnss-sdr_labsat_kf_vtl.conf index b5f8ce879..71cb49030 100644 --- a/conf/gnss-sdr_labsat_kf_vtl.conf +++ b/conf/gnss-sdr_labsat_kf_vtl.conf @@ -7,7 +7,6 @@ ;######### GLOBAL OPTIONS ################## GNSS-SDR.internal_fs_sps=5456000 -;GNSS-SDR.internal_fs_sps=16368000 GNSS-SDR.use_acquisition_resampler=true ;######### SIGNAL_SOURCE CONFIG ############ @@ -17,9 +16,7 @@ SignalSource.selected_channel=1 ;# Labsat sile source automatically increments the file name when the signal is split in several files ;# the adapter adds "_0000.LS3" to this base path and filename. Next file will be "_0001.LS3" and so on ;# in this example, the first file complete path will be ../signals/GPS_025_ -;SignalSource.filename=/media/javier/WDNASNTFS/satgen_30mins/output/output SignalSource.filename=/home/javier/signals/satgen_30mins/output/output -;SignalSource.filename=/home/javier/signals/dupli/dupli/dupli SignalSource.item_type=gr_complex SignalSource.sampling_frequency=16368000 SignalSource.samples=0 @@ -75,18 +72,6 @@ Channels_5X.count=0 Channels.in_acquisition=1 -;Channel0.satellite=3 - - -;#signal: -;# "1C" GPS L1 C/A -;# "1B" GALILEO E1 B (I/NAV OS/CS/SoL) -;# "1G" GLONASS L1 C/A -;# "2S" GPS L2 L2C (M) -;# "5X" GALILEO E5a I+Q -;# "L5" GPS L5 - - ;######### GPS ACQUISITION CONFIG ############ Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition Acquisition_1C.item_type=gr_complex @@ -112,50 +97,14 @@ Acquisition_1B.dump_filename=./acq_dump.dat ;######### TRACKING GPS CONFIG ############ -;Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking -;Tracking_1C.item_type=gr_complex -;Tracking_1C.dump=false -;Tracking_1C.dump_filename=./tracking_ch_ -;Tracking_1C.pll_bw_hz=35.0; -;Tracking_1C.dll_bw_hz=1.5; -;Tracking_1C.pll_bw_narrow_hz=2.5; -;Tracking_1C.dll_bw_narrow_hz=0.2; -;Tracking_1C.extend_correlation_symbols=1; -;Tracking_1C.dll_filter_order=2; -;Tracking_1C.pll_filter_order=3; -;Tracking_1C.early_late_space_chips=0.5; -;Tracking_1C.early_late_space_narrow_chips=0.15 - -;### KF tracking Tracking_1C.implementation=GPS_L1_CA_KF_VTL_Tracking Tracking_1C.item_type=gr_complex Tracking_1C.dump=true Tracking_1C.dump_filename=./tracking_ch_ -Tracking_1C.extend_correlation_symbols=1; +Tracking_1C.extend_correlation_symbols=10; Tracking_1C.early_late_space_chips=0.5; Tracking_1C.early_late_space_narrow_chips=0.15 -Tracking_1C.expected_cn0_dbhz=45.0; -Tracking_1C.enable_dynamic_measurement_covariance=false; -Tracking_1C.use_estimated_cn0=false; -Tracking_1C.carrier_aiding=true; - - -Tracking_1C.code_phase_sd_chips=0.01; -Tracking_1C.code_rate_sd_chips_s=0.001; - -Tracking_1C.carrier_phase_sd_rad=0.001; -Tracking_1C.carrier_freq_sd_hz=0.01; -Tracking_1C.carrier_freq_rate_sd_hz_s=0.1; - - -Tracking_1C.init_code_phase_sd_chips=1; -Tracking_1C.init_code_rate_sd_chips_s=10; - -Tracking_1C.init_carrier_phase_sd_rad=1; -Tracking_1C.init_carrier_freq_sd_hz=10; -Tracking_1C.init_carrier_freq_rate_sd_hz_s=10; - ;######### TRACKING GALILEO CONFIG ############ Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking @@ -221,5 +170,3 @@ Monitor.enable_monitor=false Monitor.decimation_factor=1 Monitor.client_addresses=127.0.0.1 Monitor.udp_port=1234 - - diff --git a/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.cc index 8a3a8ff6d..61a0fc7fd 100644 --- a/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.cc @@ -886,12 +886,12 @@ void kf_vtl_tracking::init_kf(double acq_code_phase_chips, double acq_doppler_hz // states: code_phase_chips, carrier_phase_rads, carrier_freq_hz, carrier_freq_rate_hz_s d_x_old_old = {acq_code_phase_chips, 0.0, acq_doppler_hz, 0.0}; - std::cout << "F: " << d_F << "\n"; - std::cout << "H: " << d_H << "\n"; - std::cout << "R: " << d_R << "\n"; - std::cout << "Q: " << d_Q << "\n"; - std::cout << "P: " << d_P_old_old << "\n"; - std::cout << "x: " << d_x_old_old << "\n"; + DLOG(INFO) << "F: " << d_F; + DLOG(INFO) << "H: " << d_H; + DLOG(INFO) << "R: " << d_R; + DLOG(INFO) << "Q: " << d_Q; + DLOG(INFO) << "P: " << d_P_old_old; + DLOG(INFO) << "x: " << d_x_old_old; } @@ -926,12 +926,12 @@ void kf_vtl_tracking::update_kf_narrow_integration_time() d_R = {{Sigma2_Tau, 0.0}, {0.0, Sigma2_Phase}}; - std::cout << "Fu: " << d_F << "\n"; - std::cout << "Hu: " << d_H << "\n"; - std::cout << "Ru: " << d_R << "\n"; - std::cout << "Qu: " << d_Q << "\n"; - std::cout << "Pu: " << d_P_old_old << "\n"; - std::cout << "xu: " << d_x_old_old << "\n"; + DLOG(INFO) << "Fu: " << d_F; + DLOG(INFO) << "Hu: " << d_H; + DLOG(INFO) << "Ru: " << d_R; + DLOG(INFO) << "Qu: " << d_Q; + DLOG(INFO) << "Pu: " << d_P_old_old; + DLOG(INFO) << "xu: " << d_x_old_old; } @@ -1174,10 +1174,7 @@ void kf_vtl_tracking::run_Kf() // New carrier Doppler frequency estimation d_carrier_doppler_kf_hz = d_x_new_new(2); - if (d_channel == 0) - { - // std::cout << "Doppler: " << d_carrier_doppler_kf_hz << '\n'; - } + // d_carr_freq_error_hz = fll_four_quadrant_atan(d_P_accu_old, d_P_accu, 0, d_current_correlation_time_s) / TWO_PI; // d_x_new_new(2) = d_x_new_new(2) + fll_four_quadrant_atan(d_P_accu_old, d_P_accu, 0, d_current_correlation_time_s) / TWO_PI; d_P_accu_old = d_P_accu; @@ -1187,13 +1184,6 @@ void kf_vtl_tracking::run_Kf() // New code Doppler frequency estimation d_code_freq_kf_chips_s = d_code_chip_rate + d_carrier_doppler_kf_hz * d_code_chip_rate / d_signal_carrier_freq; - if (d_trk_parameters.high_dyn) - { - // d_x_new_new(3) = 0; - // std::cout << "d_carrier_doppler_rate_kf_hz_s: " << d_carrier_doppler_rate_kf_hz_s << '\n'; - // d_carrier_phase_rate_step_rad = TWO_PI * d_carrier_doppler_rate_kf_hz_s / d_trk_parameters.fs_in; - // d_carrier_phase_rate_step_rad = d_carrier_doppler_rate_kf_hz_s / d_trk_parameters.fs_in; - } // d_x_new_new(4) = 0; // Experimental: detect Carrier Doppler vs. Code Doppler incoherence and correct the Carrier Doppler // if (d_trk_parameters.enable_doppler_correction == true) From 858ea91ca8598c21c1ff7c7c2e11bd9513b07e40 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 30 Aug 2022 11:30:53 +0200 Subject: [PATCH 08/11] Rename GPS_L1_CA_KF_Tracking implementation to GPS_L1_CA_Gaussian_Tracking --- conf/gnss-sdr-kalman-bayes.conf | 2 +- ...kf.conf => gnss-sdr_GPS_L1_nsr_gauss.conf} | 2 +- .../tracking/adapters/CMakeLists.txt | 4 +- ...king.cc => gps_l1_ca_gaussian_tracking.cc} | 24 ++++---- ...acking.h => gps_l1_ca_gaussian_tracking.h} | 22 +++---- .../tracking/gnuradio_blocks/CMakeLists.txt | 4 +- ...c.cc => gps_l1_ca_gaussian_tracking_cc.cc} | 30 +++++----- ..._cc.h => gps_l1_ca_gaussian_tracking_cc.h} | 28 ++++----- src/core/receiver/gnss_block_factory.cc | 10 ++-- src/tests/test_main.cc | 2 +- ...cc => gps_l1_ca_gaussian_tracking_test.cc} | 60 +++++++++---------- 11 files changed, 94 insertions(+), 94 deletions(-) rename conf/{gnss-sdr_GPS_L1_nsr_kf.conf => gnss-sdr_GPS_L1_nsr_gauss.conf} (99%) rename src/algorithms/tracking/adapters/{gps_l1_ca_kf_tracking.cc => gps_l1_ca_gaussian_tracking.cc} (86%) rename src/algorithms/tracking/adapters/{gps_l1_ca_kf_tracking.h => gps_l1_ca_gaussian_tracking.h} (83%) rename src/algorithms/tracking/gnuradio_blocks/{gps_l1_ca_kf_tracking_cc.cc => gps_l1_ca_gaussian_tracking_cc.cc} (97%) rename src/algorithms/tracking/gnuradio_blocks/{gps_l1_ca_kf_tracking_cc.h => gps_l1_ca_gaussian_tracking_cc.h} (89%) rename src/tests/unit-tests/signal-processing-blocks/tracking/{gps_l1_ca_kf_tracking_test.cc => gps_l1_ca_gaussian_tracking_test.cc} (90%) diff --git a/conf/gnss-sdr-kalman-bayes.conf b/conf/gnss-sdr-kalman-bayes.conf index bc6cbf631..a208366e5 100644 --- a/conf/gnss-sdr-kalman-bayes.conf +++ b/conf/gnss-sdr-kalman-bayes.conf @@ -42,7 +42,7 @@ Acquisition_1C.dump=false Acquisition_1C.dump_filename=../data/kalman/acq_dump ;######### TRACKING GLOBAL CONFIG ############ -Tracking_1C.implementation=GPS_L1_CA_KF_Tracking +Tracking_1C.implementation=GPS_L1_CA_Gaussian_Tracking Tracking_1C.item_type=gr_complex Tracking_1C.pll_bw_hz=40.0; Tracking_1C.dll_bw_hz=4.0; diff --git a/conf/gnss-sdr_GPS_L1_nsr_kf.conf b/conf/gnss-sdr_GPS_L1_nsr_gauss.conf similarity index 99% rename from conf/gnss-sdr_GPS_L1_nsr_kf.conf rename to conf/gnss-sdr_GPS_L1_nsr_gauss.conf index 91015fc9b..a127a5870 100644 --- a/conf/gnss-sdr_GPS_L1_nsr_kf.conf +++ b/conf/gnss-sdr_GPS_L1_nsr_gauss.conf @@ -165,7 +165,7 @@ Acquisition_1C.doppler_step=100 ;######### TRACKING GPS CONFIG ############ -Tracking_1C.implementation=GPS_L1_CA_KF_Tracking +Tracking_1C.implementation=GPS_L1_CA_Gaussian_Tracking Tracking_1C.item_type=gr_complex Tracking_1C.if=0 Tracking_1C.dump=true diff --git a/src/algorithms/tracking/adapters/CMakeLists.txt b/src/algorithms/tracking/adapters/CMakeLists.txt index 863fcba8e..e31606824 100644 --- a/src/algorithms/tracking/adapters/CMakeLists.txt +++ b/src/algorithms/tracking/adapters/CMakeLists.txt @@ -45,7 +45,7 @@ set(TRACKING_ADAPTER_SOURCES gps_l2_m_dll_pll_tracking.cc glonass_l1_ca_dll_pll_tracking.cc glonass_l1_ca_dll_pll_c_aid_tracking.cc - gps_l1_ca_kf_tracking.cc + gps_l1_ca_gaussian_tracking.cc gps_l5_dll_pll_tracking.cc glonass_l2_ca_dll_pll_tracking.cc glonass_l2_ca_dll_pll_c_aid_tracking.cc @@ -66,7 +66,7 @@ set(TRACKING_ADAPTER_HEADERS gps_l2_m_dll_pll_tracking.h glonass_l1_ca_dll_pll_tracking.h glonass_l1_ca_dll_pll_c_aid_tracking.h - gps_l1_ca_kf_tracking.h + gps_l1_ca_gaussian_tracking.h gps_l5_dll_pll_tracking.h glonass_l2_ca_dll_pll_tracking.h glonass_l2_ca_dll_pll_c_aid_tracking.h diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_gaussian_tracking.cc similarity index 86% rename from src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc rename to src/algorithms/tracking/adapters/gps_l1_ca_gaussian_tracking.cc index 2cffdf478..bedab47b4 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_gaussian_tracking.cc @@ -1,5 +1,5 @@ /*! - * \file gps_l1_ca_kf_tracking.cc + * \file gps_l1_ca_gaussian_tracking.cc * \brief Implementation of an adapter of a DLL + Kalman carrier * tracking loop block for GPS L1 C/A signals * \author Javier Arribas, 2018. jarribas(at)cttc.es @@ -24,14 +24,14 @@ */ -#include "gps_l1_ca_kf_tracking.h" +#include "gps_l1_ca_gaussian_tracking.h" #include "GPS_L1_CA.h" #include "configuration_interface.h" #include "gnss_sdr_flags.h" #include -GpsL1CaKfTracking::GpsL1CaKfTracking( +GpsL1CaGaussianTracking::GpsL1CaGaussianTracking( const ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { @@ -63,7 +63,7 @@ GpsL1CaKfTracking::GpsL1CaKfTracking( if (item_type == "gr_complex") { item_size_ = sizeof(gr_complex); - tracking_ = gps_l1_ca_kf_make_tracking_cc( + tracking_ = gps_l1_ca_gaussian_make_tracking_cc( order, fs_in, vector_length, @@ -97,12 +97,12 @@ GpsL1CaKfTracking::GpsL1CaKfTracking( } -void GpsL1CaKfTracking::stop_tracking() +void GpsL1CaGaussianTracking::stop_tracking() { } -void GpsL1CaKfTracking::start_tracking() +void GpsL1CaGaussianTracking::start_tracking() { tracking_->start_tracking(); } @@ -111,20 +111,20 @@ void GpsL1CaKfTracking::start_tracking() /* * Set tracking channel unique ID */ -void GpsL1CaKfTracking::set_channel(unsigned int channel) +void GpsL1CaGaussianTracking::set_channel(unsigned int channel) { channel_ = channel; tracking_->set_channel(channel); } -void GpsL1CaKfTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) +void GpsL1CaGaussianTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) { tracking_->set_gnss_synchro(p_gnss_synchro); } -void GpsL1CaKfTracking::connect(gr::top_block_sptr top_block) +void GpsL1CaGaussianTracking::connect(gr::top_block_sptr top_block) { if (top_block) { /* top_block is not null */ @@ -133,7 +133,7 @@ void GpsL1CaKfTracking::connect(gr::top_block_sptr top_block) } -void GpsL1CaKfTracking::disconnect(gr::top_block_sptr top_block) +void GpsL1CaGaussianTracking::disconnect(gr::top_block_sptr top_block) { if (top_block) { /* top_block is not null */ @@ -142,13 +142,13 @@ void GpsL1CaKfTracking::disconnect(gr::top_block_sptr top_block) } -gr::basic_block_sptr GpsL1CaKfTracking::get_left_block() +gr::basic_block_sptr GpsL1CaGaussianTracking::get_left_block() { return tracking_; } -gr::basic_block_sptr GpsL1CaKfTracking::get_right_block() +gr::basic_block_sptr GpsL1CaGaussianTracking::get_right_block() { return tracking_; } diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.h b/src/algorithms/tracking/adapters/gps_l1_ca_gaussian_tracking.h similarity index 83% rename from src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.h rename to src/algorithms/tracking/adapters/gps_l1_ca_gaussian_tracking.h index a0c886bde..2b04fa6b5 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.h +++ b/src/algorithms/tracking/adapters/gps_l1_ca_gaussian_tracking.h @@ -1,5 +1,5 @@ /*! - * \file gps_l1_ca_kf_tracking.h + * \file gps_l1_ca_gaussian_tracking.h * \brief Interface of an adapter of a DLL + Kalman carrier * tracking loop block for GPS L1 C/A signals * \author Javier Arribas, 2018. jarribas(at)cttc.es @@ -23,10 +23,10 @@ * ----------------------------------------------------------------------------- */ -#ifndef GNSS_SDR_GPS_L1_CA_KF_TRACKING_H -#define GNSS_SDR_GPS_L1_CA_KF_TRACKING_H +#ifndef GNSS_SDR_GPS_L1_CA_GAUSSIAN_TRACKING_H +#define GNSS_SDR_GPS_L1_CA_GAUSSIAN_TRACKING_H -#include "gps_l1_ca_kf_tracking_cc.h" +#include "gps_l1_ca_gaussian_tracking_cc.h" #include "tracking_interface.h" #include @@ -41,26 +41,26 @@ class ConfigurationInterface; /*! * \brief This class implements a code DLL + carrier PLL tracking loop */ -class GpsL1CaKfTracking : public TrackingInterface +class GpsL1CaGaussianTracking : public TrackingInterface { public: - GpsL1CaKfTracking( + GpsL1CaGaussianTracking( const ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams); - ~GpsL1CaKfTracking() = default; + ~GpsL1CaGaussianTracking() = default; inline std::string role() override { return role_; } - //! Returns "GPS_L1_CA_KF_Tracking" + //! Returns "GPS_L1_CA_Gaussian_Tracking" inline std::string implementation() override { - return "GPS_L1_CA_KF_Tracking"; + return "GPS_L1_CA_Gaussian_Tracking"; } inline size_t item_size() override @@ -92,7 +92,7 @@ public: void stop_tracking() override; private: - gps_l1_ca_kf_tracking_cc_sptr tracking_; + gps_l1_ca_gaussian_tracking_cc_sptr tracking_; size_t item_size_; unsigned int channel_; std::string role_; @@ -103,4 +103,4 @@ private: /** \} */ /** \} */ -#endif // GNSS_SDR_GPS_L1_CA_KF_TRACKING_H +#endif // GNSS_SDR_GPS_L1_CA_GAUSSIAN_TRACKING_H diff --git a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt index eae1f6c8d..7691b1483 100644 --- a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt @@ -34,7 +34,7 @@ set(TRACKING_GR_BLOCKS_SOURCES glonass_l1_ca_dll_pll_tracking_cc.cc glonass_l1_ca_dll_pll_c_aid_tracking_cc.cc glonass_l1_ca_dll_pll_c_aid_tracking_sc.cc - gps_l1_ca_kf_tracking_cc.cc + gps_l1_ca_gaussian_tracking_cc.cc glonass_l2_ca_dll_pll_tracking_cc.cc glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc @@ -49,7 +49,7 @@ set(TRACKING_GR_BLOCKS_HEADERS glonass_l1_ca_dll_pll_tracking_cc.h glonass_l1_ca_dll_pll_c_aid_tracking_cc.h glonass_l1_ca_dll_pll_c_aid_tracking_sc.h - gps_l1_ca_kf_tracking_cc.h + gps_l1_ca_gaussian_tracking_cc.h glonass_l2_ca_dll_pll_tracking_cc.h glonass_l2_ca_dll_pll_c_aid_tracking_cc.h glonass_l2_ca_dll_pll_c_aid_tracking_sc.h diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_gaussian_tracking_cc.cc similarity index 97% rename from src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc rename to src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_gaussian_tracking_cc.cc index 560992b45..af432dec8 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_gaussian_tracking_cc.cc @@ -1,5 +1,5 @@ /*! - * \file gps_l1_ca_kf_tracking_cc.cc + * \file gps_l1_ca_gaussian_tracking_cc.cc * \brief Implementation of a processing block of a DLL + Kalman carrier * tracking loop for GPS L1 C/A signals * \author Javier Arribas, 2018. jarribas(at)cttc.es @@ -23,7 +23,7 @@ * ----------------------------------------------------------------------------- */ -#include "gps_l1_ca_kf_tracking_cc.h" +#include "gps_l1_ca_gaussian_tracking_cc.h" #include "GPS_L1_CA.h" #include "gnss_satellite.h" #include "gnss_sdr_flags.h" @@ -45,7 +45,7 @@ #include -gps_l1_ca_kf_tracking_cc_sptr gps_l1_ca_kf_make_tracking_cc( +gps_l1_ca_gaussian_tracking_cc_sptr gps_l1_ca_gaussian_make_tracking_cc( uint32_t order, int64_t fs_in, uint32_t vector_length, @@ -59,13 +59,13 @@ gps_l1_ca_kf_tracking_cc_sptr gps_l1_ca_kf_make_tracking_cc( int32_t bce_nu, int32_t bce_kappa) { - return gps_l1_ca_kf_tracking_cc_sptr(new Gps_L1_Ca_Kf_Tracking_cc(order, + return gps_l1_ca_gaussian_tracking_cc_sptr(new Gps_L1_Ca_Gaussian_Tracking_cc(order, fs_in, vector_length, dump, dump_filename, dll_bw_hz, early_late_space_chips, bce_run, bce_ptrans, bce_strans, bce_nu, bce_kappa)); } -void Gps_L1_Ca_Kf_Tracking_cc::forecast(int noutput_items, +void Gps_L1_Ca_Gaussian_Tracking_cc::forecast(int noutput_items, gr_vector_int &ninput_items_required) { if (noutput_items != 0) @@ -75,7 +75,7 @@ void Gps_L1_Ca_Kf_Tracking_cc::forecast(int noutput_items, } -Gps_L1_Ca_Kf_Tracking_cc::Gps_L1_Ca_Kf_Tracking_cc( +Gps_L1_Ca_Gaussian_Tracking_cc::Gps_L1_Ca_Gaussian_Tracking_cc( uint32_t order, int64_t fs_in, uint32_t vector_length, @@ -88,7 +88,7 @@ Gps_L1_Ca_Kf_Tracking_cc::Gps_L1_Ca_Kf_Tracking_cc( uint32_t bce_strans, int32_t bce_nu, int32_t bce_kappa) - : gr::block("Gps_L1_Ca_Kf_Tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), + : gr::block("Gps_L1_Ca_Gaussian_Tracking_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))), d_order(order), d_vector_length(vector_length), @@ -222,14 +222,14 @@ Gps_L1_Ca_Kf_Tracking_cc::Gps_L1_Ca_Kf_Tracking_cc( kf_x(2, 0) = 0.0; } - // Bayesian covariance estimator initialization + // Gaussian covariance estimator initialization kf_R_est = kf_R; bayes_estimator.init(arma::zeros(1, 1), bayes_kappa, bayes_nu, (kf_H * kf_P_x_ini * kf_H.t() + kf_R) * (bayes_nu + 2)); } -void Gps_L1_Ca_Kf_Tracking_cc::start_tracking() +void Gps_L1_Ca_Gaussian_Tracking_cc::start_tracking() { /* * correct the code phase according to the delay between acq and trk @@ -318,7 +318,7 @@ void Gps_L1_Ca_Kf_Tracking_cc::start_tracking() } -Gps_L1_Ca_Kf_Tracking_cc::~Gps_L1_Ca_Kf_Tracking_cc() +Gps_L1_Ca_Gaussian_Tracking_cc::~Gps_L1_Ca_Gaussian_Tracking_cc() { if (d_dump_file.is_open()) { @@ -339,7 +339,7 @@ Gps_L1_Ca_Kf_Tracking_cc::~Gps_L1_Ca_Kf_Tracking_cc() } try { - Gps_L1_Ca_Kf_Tracking_cc::save_matfile(); + Gps_L1_Ca_Gaussian_Tracking_cc::save_matfile(); } catch (const std::exception &ex) { @@ -362,7 +362,7 @@ Gps_L1_Ca_Kf_Tracking_cc::~Gps_L1_Ca_Kf_Tracking_cc() } -int32_t Gps_L1_Ca_Kf_Tracking_cc::save_matfile() +int32_t Gps_L1_Ca_Gaussian_Tracking_cc::save_matfile() { // READ DUMP FILE std::ifstream::pos_type size; @@ -557,7 +557,7 @@ int32_t Gps_L1_Ca_Kf_Tracking_cc::save_matfile() } -void Gps_L1_Ca_Kf_Tracking_cc::set_channel(uint32_t channel) +void Gps_L1_Ca_Gaussian_Tracking_cc::set_channel(uint32_t channel) { gr::thread::scoped_lock l(d_setlock); d_channel = channel; @@ -584,13 +584,13 @@ void Gps_L1_Ca_Kf_Tracking_cc::set_channel(uint32_t channel) } -void Gps_L1_Ca_Kf_Tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) +void Gps_L1_Ca_Gaussian_Tracking_cc::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) { d_acquisition_gnss_synchro = p_gnss_synchro; } -int Gps_L1_Ca_Kf_Tracking_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), +int Gps_L1_Ca_Gaussian_Tracking_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { // process vars diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_gaussian_tracking_cc.h similarity index 89% rename from src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h rename to src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_gaussian_tracking_cc.h index b68927e31..a463b749d 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_gaussian_tracking_cc.h @@ -1,5 +1,5 @@ /*! - * \file gps_l1_ca_kf_tracking_cc.h + * \file gps_l1_ca_gaussian_tracking_cc.h * \brief Interface of a processing block of a DLL + Kalman carrier * tracking loop for GPS L1 C/A signals * \author Javier Arribas, 2018. jarribas(at)cttc.es @@ -23,8 +23,8 @@ * ----------------------------------------------------------------------------- */ -#ifndef GNSS_SDR_GPS_L1_CA_KF_TRACKING_CC_H -#define GNSS_SDR_GPS_L1_CA_KF_TRACKING_CC_H +#ifndef GNSS_SDR_GPS_L1_CA_GAUSSIAN_TRACKING_CC_H +#define GNSS_SDR_GPS_L1_CA_GAUSSIAN_TRACKING_CC_H #if ARMA_NO_BOUND_CHECKING #define ARMA_NO_DEBUG 1 @@ -49,12 +49,12 @@ * \{ */ -class Gps_L1_Ca_Kf_Tracking_cc; +class Gps_L1_Ca_Gaussian_Tracking_cc; -using gps_l1_ca_kf_tracking_cc_sptr = gnss_shared_ptr; +using gps_l1_ca_gaussian_tracking_cc_sptr = gnss_shared_ptr; -gps_l1_ca_kf_tracking_cc_sptr -gps_l1_ca_kf_make_tracking_cc(uint32_t order, +gps_l1_ca_gaussian_tracking_cc_sptr +gps_l1_ca_gaussian_make_tracking_cc(uint32_t order, int64_t fs_in, uint32_t vector_length, bool dump, @@ -71,10 +71,10 @@ gps_l1_ca_kf_make_tracking_cc(uint32_t order, /*! * \brief This class implements a DLL + PLL tracking loop block */ -class Gps_L1_Ca_Kf_Tracking_cc : public gr::block +class Gps_L1_Ca_Gaussian_Tracking_cc : public gr::block { public: - ~Gps_L1_Ca_Kf_Tracking_cc(); + ~Gps_L1_Ca_Gaussian_Tracking_cc(); void set_channel(uint32_t channel); void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro); @@ -86,8 +86,8 @@ public: void forecast(int noutput_items, gr_vector_int& ninput_items_required); private: - friend gps_l1_ca_kf_tracking_cc_sptr - gps_l1_ca_kf_make_tracking_cc(uint32_t order, + friend gps_l1_ca_gaussian_tracking_cc_sptr + gps_l1_ca_gaussian_make_tracking_cc(uint32_t order, int64_t fs_in, uint32_t vector_length, bool dump, @@ -100,7 +100,7 @@ private: int32_t bce_nu, int32_t bce_kappa); - Gps_L1_Ca_Kf_Tracking_cc(uint32_t order, + Gps_L1_Ca_Gaussian_Tracking_cc(uint32_t order, int64_t fs_in, uint32_t vector_length, bool dump, @@ -148,7 +148,7 @@ private: arma::colvec kf_y; // measurement vector arma::mat kf_K; // Kalman gain matrix - // Bayesian estimator + // Gaussian estimator Bayesian_estimator bayes_estimator; arma::mat kf_R_est; // measurement error covariance uint32_t bayes_ptrans; @@ -218,4 +218,4 @@ private: /** \} */ /** \} */ -#endif // GNSS_SDR_GPS_L1_CA_KF_TRACKING_CC_H +#endif // GNSS_SDR_GPS_L1_CA_GAUSSIAN_TRACKING_CC_H diff --git a/src/core/receiver/gnss_block_factory.cc b/src/core/receiver/gnss_block_factory.cc index a2273f182..8c2b16e26 100644 --- a/src/core/receiver/gnss_block_factory.cc +++ b/src/core/receiver/gnss_block_factory.cc @@ -72,7 +72,7 @@ #include "gnss_sdr_make_unique.h" #include "gnss_sdr_string_literals.h" #include "gps_l1_ca_dll_pll_tracking.h" -#include "gps_l1_ca_kf_tracking.h" +#include "gps_l1_ca_gaussian_tracking.h" #include "gps_l1_ca_kf_vtl_tracking.h" #include "gps_l1_ca_pcps_acquisition.h" #include "gps_l1_ca_pcps_acquisition_fine_doppler.h" @@ -1079,9 +1079,9 @@ std::unique_ptr GNSSBlockFactory::GetBlock( out_streams); block = std::move(block_); } - else if (implementation == "GPS_L1_CA_KF_Tracking") + else if (implementation == "GPS_L1_CA_Gaussian_Tracking") { - std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, out_streams); block = std::move(block_); } @@ -1535,9 +1535,9 @@ std::unique_ptr GNSSBlockFactory::GetTrkBlock( out_streams); block = std::move(block_); } - else if (implementation == "GPS_L1_CA_KF_Tracking") + else if (implementation == "GPS_L1_CA_Gaussian_Tracking") { - std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, out_streams); block = std::move(block_); } diff --git a/src/tests/test_main.cc b/src/tests/test_main.cc index 6efe155cd..894fb66d0 100644 --- a/src/tests/test_main.cc +++ b/src/tests/test_main.cc @@ -141,7 +141,7 @@ DECLARE_string(log_dir); #include "unit-tests/signal-processing-blocks/acquisition/gps_l2_m_pcps_acquisition_test.cc" // #include "unit-tests/signal-processing-blocks/pvt/rtklib_solver_test.cc" #include "unit-tests/signal-processing-blocks/tracking/gps_l1_ca_dll_pll_tracking_test.cc" -#include "unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc" +#include "unit-tests/signal-processing-blocks/tracking/gps_l1_ca_gaussian_tracking_test.cc" #include "unit-tests/signal-processing-blocks/tracking/gps_l2_m_dll_pll_tracking_test.cc" #include "unit-tests/signal-processing-blocks/tracking/tracking_pull-in_test.cc" #if FPGA_BLOCKS_TEST diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_gaussian_tracking_test.cc similarity index 90% rename from src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc rename to src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_gaussian_tracking_test.cc index ae94e744a..fbd1b2d0f 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_kf_tracking_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/gps_l1_ca_gaussian_tracking_test.cc @@ -1,6 +1,6 @@ /*! - * \file gps_l1_ca_kf_tracking_test.cc - * \brief This class implements a tracking test for GPS_L1_CA_KF_Tracking + * \file gps_l1_ca_gaussian_tracking_test.cc + * \brief This class implements a tracking test for GPS_L1_CA_Gaussian_Tracking * implementation based on some input parameters. * \author Carles Fernandez, 2018 * @@ -60,37 +60,37 @@ namespace wht = boost; namespace wht = std; #endif -DEFINE_bool(plot_gps_l1_kf_tracking_test, false, "Plots results of GpsL1CAKfTrackingTest with gnuplot"); +DEFINE_bool(plot_gps_l1_gaussian_tracking_test, false, "Plots results of GpsL1CAGaussianTrackingTest with gnuplot"); // ######## GNURADIO BLOCK MESSAGE RECEVER ######### -class GpsL1CAKfTrackingTest_msg_rx; +class GpsL1CAGaussianTrackingTest_msg_rx; -using GpsL1CAKfTrackingTest_msg_rx_sptr = gnss_shared_ptr; +using GpsL1CAGaussianTrackingTest_msg_rx_sptr = gnss_shared_ptr; -GpsL1CAKfTrackingTest_msg_rx_sptr GpsL1CAKfTrackingTest_msg_rx_make(); +GpsL1CAGaussianTrackingTest_msg_rx_sptr GpsL1CAGaussianTrackingTest_msg_rx_make(); -class GpsL1CAKfTrackingTest_msg_rx : public gr::block +class GpsL1CAGaussianTrackingTest_msg_rx : public gr::block { private: - friend GpsL1CAKfTrackingTest_msg_rx_sptr GpsL1CAKfTrackingTest_msg_rx_make(); + friend GpsL1CAGaussianTrackingTest_msg_rx_sptr GpsL1CAGaussianTrackingTest_msg_rx_make(); void msg_handler_channel_events(const pmt::pmt_t msg); - GpsL1CAKfTrackingTest_msg_rx(); + GpsL1CAGaussianTrackingTest_msg_rx(); public: int rx_message; - ~GpsL1CAKfTrackingTest_msg_rx(); //!< Default destructor + ~GpsL1CAGaussianTrackingTest_msg_rx(); //!< Default destructor }; -GpsL1CAKfTrackingTest_msg_rx_sptr GpsL1CAKfTrackingTest_msg_rx_make() +GpsL1CAGaussianTrackingTest_msg_rx_sptr GpsL1CAGaussianTrackingTest_msg_rx_make() { - return GpsL1CAKfTrackingTest_msg_rx_sptr(new GpsL1CAKfTrackingTest_msg_rx()); + return GpsL1CAGaussianTrackingTest_msg_rx_sptr(new GpsL1CAGaussianTrackingTest_msg_rx()); } -void GpsL1CAKfTrackingTest_msg_rx::msg_handler_channel_events(const pmt::pmt_t msg) +void GpsL1CAGaussianTrackingTest_msg_rx::msg_handler_channel_events(const pmt::pmt_t msg) { try { @@ -105,7 +105,7 @@ void GpsL1CAKfTrackingTest_msg_rx::msg_handler_channel_events(const pmt::pmt_t m } -GpsL1CAKfTrackingTest_msg_rx::GpsL1CAKfTrackingTest_msg_rx() : gr::block("GpsL1CAKfTrackingTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) +GpsL1CAGaussianTrackingTest_msg_rx::GpsL1CAGaussianTrackingTest_msg_rx() : gr::block("GpsL1CAGaussianTrackingTest_msg_rx", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0)) { this->message_port_register_in(pmt::mp("events")); this->set_msg_handler(pmt::mp("events"), @@ -113,21 +113,21 @@ GpsL1CAKfTrackingTest_msg_rx::GpsL1CAKfTrackingTest_msg_rx() : gr::block("GpsL1C [this](auto&& PH1) { msg_handler_channel_events(PH1); }); #else #if USE_BOOST_BIND_PLACEHOLDERS - boost::bind(&GpsL1CAKfTrackingTest_msg_rx::msg_handler_channel_events, this, boost::placeholders::_1)); + boost::bind(&GpsL1CAGaussianTrackingTest_msg_rx::msg_handler_channel_events, this, boost::placeholders::_1)); #else - boost::bind(&GpsL1CAKfTrackingTest_msg_rx::msg_handler_channel_events, this, _1)); + boost::bind(&GpsL1CAGaussianTrackingTest_msg_rx::msg_handler_channel_events, this, _1)); #endif #endif rx_message = 0; } -GpsL1CAKfTrackingTest_msg_rx::~GpsL1CAKfTrackingTest_msg_rx() = default; +GpsL1CAGaussianTrackingTest_msg_rx::~GpsL1CAGaussianTrackingTest_msg_rx() = default; // ########################################################### -class GpsL1CAKfTrackingTest : public ::testing::Test +class GpsL1CAGaussianTrackingTest : public ::testing::Test { public: std::string generator_binary; @@ -137,7 +137,7 @@ public: std::string p4; std::string p5; - std::string implementation = "GPS_L1_CA_KF_Tracking"; + std::string implementation = "GPS_L1_CA_Gaussian_Tracking"; const int baseband_sampling_freq = FLAGS_fs_gen_sps; @@ -159,7 +159,7 @@ public: arma::vec& meas_time_s, arma::vec& meas_value); - GpsL1CAKfTrackingTest() + GpsL1CAGaussianTrackingTest() { factory = std::make_shared(); config = std::make_shared(); @@ -167,7 +167,7 @@ public: gnss_synchro = Gnss_Synchro(); } - ~GpsL1CAKfTrackingTest() = default; + ~GpsL1CAGaussianTrackingTest() = default; void configure_receiver(); @@ -179,7 +179,7 @@ public: }; -int GpsL1CAKfTrackingTest::configure_generator() +int GpsL1CAGaussianTrackingTest::configure_generator() { // Configure signal generator generator_binary = FLAGS_generator_binary; @@ -200,7 +200,7 @@ int GpsL1CAKfTrackingTest::configure_generator() } -int GpsL1CAKfTrackingTest::generate_signal() +int GpsL1CAGaussianTrackingTest::generate_signal() { int child_status; @@ -225,7 +225,7 @@ int GpsL1CAKfTrackingTest::generate_signal() } -void GpsL1CAKfTrackingTest::configure_receiver() +void GpsL1CAGaussianTrackingTest::configure_receiver() { gnss_synchro.Channel_ID = 0; gnss_synchro.System = 'G'; @@ -252,7 +252,7 @@ void GpsL1CAKfTrackingTest::configure_receiver() } -void GpsL1CAKfTrackingTest::check_results_doppler(arma::vec& true_time_s, +void GpsL1CAGaussianTrackingTest::check_results_doppler(arma::vec& true_time_s, arma::vec& true_value, arma::vec& meas_time_s, arma::vec& meas_value) @@ -291,7 +291,7 @@ void GpsL1CAKfTrackingTest::check_results_doppler(arma::vec& true_time_s, } -void GpsL1CAKfTrackingTest::check_results_acc_carrier_phase(arma::vec& true_time_s, +void GpsL1CAGaussianTrackingTest::check_results_acc_carrier_phase(arma::vec& true_time_s, arma::vec& true_value, arma::vec& meas_time_s, arma::vec& meas_value) @@ -330,7 +330,7 @@ void GpsL1CAKfTrackingTest::check_results_acc_carrier_phase(arma::vec& true_time } -void GpsL1CAKfTrackingTest::check_results_codephase(arma::vec& true_time_s, +void GpsL1CAGaussianTrackingTest::check_results_codephase(arma::vec& true_time_s, arma::vec& true_value, arma::vec& meas_time_s, arma::vec& meas_value) @@ -370,7 +370,7 @@ void GpsL1CAKfTrackingTest::check_results_codephase(arma::vec& true_time_s, } -TEST_F(GpsL1CAKfTrackingTest, ValidationOfResults) +TEST_F(GpsL1CAGaussianTrackingTest, ValidationOfResults) { // Configure the signal generator configure_generator(); @@ -399,7 +399,7 @@ TEST_F(GpsL1CAKfTrackingTest, ValidationOfResults) std::shared_ptr trk_ = factory->GetBlock(config.get(), "Tracking_1C", 1, 1); std::shared_ptr tracking = std::dynamic_pointer_cast(trk_); // std::make_shared(config.get(), "Tracking_1C", 1, 1); - auto msg_rx = GpsL1CAKfTrackingTest_msg_rx_make(); + auto msg_rx = GpsL1CAGaussianTrackingTest_msg_rx_make(); // load acquisition data based on the first epoch of the true observations ASSERT_EQ(true_obs_data.read_binary_obs(), true) @@ -523,7 +523,7 @@ TEST_F(GpsL1CAKfTrackingTest, ValidationOfResults) std::chrono::duration elapsed_seconds = end - start; std::cout << "Signal tracking completed in " << elapsed_seconds.count() << " seconds.\n"; - if (FLAGS_plot_gps_l1_kf_tracking_test == true) + if (FLAGS_plot_gps_l1_gaussian_tracking_test == true) { const std::string gnuplot_executable(FLAGS_gnuplot_executable); if (gnuplot_executable.empty()) From 17b03eeb3e4ad55446e8acadeaad8a5bcd0ade69 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 30 Aug 2022 11:51:32 +0200 Subject: [PATCH 09/11] Replace misleading name --- conf/{gnss-sdr-kalman-bayes.conf => gnss-sdr-L1-gaussian.conf} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename conf/{gnss-sdr-kalman-bayes.conf => gnss-sdr-L1-gaussian.conf} (100%) diff --git a/conf/gnss-sdr-kalman-bayes.conf b/conf/gnss-sdr-L1-gaussian.conf similarity index 100% rename from conf/gnss-sdr-kalman-bayes.conf rename to conf/gnss-sdr-L1-gaussian.conf From 66935170a6fad4323dc126a0cf66e6f6ef3dd54d Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 30 Aug 2022 12:03:41 +0200 Subject: [PATCH 10/11] Rename GPS_L1_CA_KF_VTL_Tracking to GPS_L1_CA_KF_Tracking --- ...at_kf_vtl.conf => gnss-sdr_labsat_kf.conf} | 2 +- .../tracking/adapters/CMakeLists.txt | 4 +- ...l_tracking.cc => gps_l1_ca_kf_tracking.cc} | 27 ++++---- ...vtl_tracking.h => gps_l1_ca_kf_tracking.h} | 31 +++++---- .../tracking/gnuradio_blocks/CMakeLists.txt | 4 +- .../{kf_vtl_tracking.cc => kf_tracking.cc} | 64 +++++++++---------- .../{kf_vtl_tracking.h => kf_tracking.h} | 22 +++---- src/core/receiver/gnss_block_factory.cc | 10 +-- 8 files changed, 84 insertions(+), 80 deletions(-) rename conf/{gnss-sdr_labsat_kf_vtl.conf => gnss-sdr_labsat_kf.conf} (99%) rename src/algorithms/tracking/adapters/{gps_l1_ca_kf_vtl_tracking.cc => gps_l1_ca_kf_tracking.cc} (83%) rename src/algorithms/tracking/adapters/{gps_l1_ca_kf_vtl_tracking.h => gps_l1_ca_kf_tracking.h} (77%) rename src/algorithms/tracking/gnuradio_blocks/{kf_vtl_tracking.cc => kf_tracking.cc} (98%) rename src/algorithms/tracking/gnuradio_blocks/{kf_vtl_tracking.h => kf_tracking.h} (93%) diff --git a/conf/gnss-sdr_labsat_kf_vtl.conf b/conf/gnss-sdr_labsat_kf.conf similarity index 99% rename from conf/gnss-sdr_labsat_kf_vtl.conf rename to conf/gnss-sdr_labsat_kf.conf index 71cb49030..6c113486c 100644 --- a/conf/gnss-sdr_labsat_kf_vtl.conf +++ b/conf/gnss-sdr_labsat_kf.conf @@ -97,7 +97,7 @@ Acquisition_1B.dump_filename=./acq_dump.dat ;######### TRACKING GPS CONFIG ############ -Tracking_1C.implementation=GPS_L1_CA_KF_VTL_Tracking +Tracking_1C.implementation=GPS_L1_CA_KF_Tracking Tracking_1C.item_type=gr_complex Tracking_1C.dump=true Tracking_1C.dump_filename=./tracking_ch_ diff --git a/src/algorithms/tracking/adapters/CMakeLists.txt b/src/algorithms/tracking/adapters/CMakeLists.txt index e31606824..f37824a3e 100644 --- a/src/algorithms/tracking/adapters/CMakeLists.txt +++ b/src/algorithms/tracking/adapters/CMakeLists.txt @@ -51,7 +51,7 @@ set(TRACKING_ADAPTER_SOURCES glonass_l2_ca_dll_pll_c_aid_tracking.cc beidou_b1i_dll_pll_tracking.cc beidou_b3i_dll_pll_tracking.cc - gps_l1_ca_kf_vtl_tracking.cc + gps_l1_ca_kf_tracking.cc ${OPT_TRACKING_ADAPTERS_SOURCES} ) @@ -72,7 +72,7 @@ set(TRACKING_ADAPTER_HEADERS glonass_l2_ca_dll_pll_c_aid_tracking.h beidou_b1i_dll_pll_tracking.h beidou_b3i_dll_pll_tracking.h - gps_l1_ca_kf_vtl_tracking.h + gps_l1_ca_kf_tracking.h ${OPT_TRACKING_ADAPTERS_HEADERS} ) diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_kf_vtl_tracking.cc b/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc similarity index 83% rename from src/algorithms/tracking/adapters/gps_l1_ca_kf_vtl_tracking.cc rename to src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc index 7c28c1b07..9cf7dc1b4 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_kf_vtl_tracking.cc +++ b/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.cc @@ -1,6 +1,7 @@ /*! - * \file gps_l1_ca_kf_vtl_tracking.h - * \brief Interface of an adapter of a code + carrier Kalman Filter tracking loop with VTL capabilities block + * \file gps_l1_ca_kf_tracking.h + * \brief Interface of an adapter of a code + carrier Kalman Filter tracking + * loop with VTL capabilities block * for GPS L1 C/A to a TrackingInterface * \author Javier Arribas, 2020. jarribas(at)cttc.es * @@ -20,7 +21,7 @@ * ----------------------------------------------------------------------------- */ -#include "gps_l1_ca_kf_vtl_tracking.h" +#include "gps_l1_ca_kf_tracking.h" #include "GPS_L1_CA.h" #include "configuration_interface.h" #include "display.h" @@ -30,7 +31,7 @@ #include #include -GpsL1CaKfVtlTracking::GpsL1CaKfVtlTracking( +GpsL1CaKfTracking::GpsL1CaKfTracking( const ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { @@ -65,7 +66,7 @@ GpsL1CaKfVtlTracking::GpsL1CaKfVtlTracking( if (trk_params.item_type == "gr_complex") { item_size_ = sizeof(gr_complex); - tracking_ = kf_vtl_make_tracking(trk_params); + tracking_ = kf_make_tracking(trk_params); } else { @@ -85,13 +86,13 @@ GpsL1CaKfVtlTracking::GpsL1CaKfVtlTracking( } -void GpsL1CaKfVtlTracking::stop_tracking() +void GpsL1CaKfTracking::stop_tracking() { tracking_->stop_tracking(); } -void GpsL1CaKfVtlTracking::start_tracking() +void GpsL1CaKfTracking::start_tracking() { tracking_->start_tracking(); } @@ -100,20 +101,20 @@ void GpsL1CaKfVtlTracking::start_tracking() /* * Set tracking channel unique ID */ -void GpsL1CaKfVtlTracking::set_channel(unsigned int channel) +void GpsL1CaKfTracking::set_channel(unsigned int channel) { channel_ = channel; tracking_->set_channel(channel); } -void GpsL1CaKfVtlTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) +void GpsL1CaKfTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) { tracking_->set_gnss_synchro(p_gnss_synchro); } -void GpsL1CaKfVtlTracking::connect(gr::top_block_sptr top_block) +void GpsL1CaKfTracking::connect(gr::top_block_sptr top_block) { if (top_block) { /* top_block is not null */ @@ -122,7 +123,7 @@ void GpsL1CaKfVtlTracking::connect(gr::top_block_sptr top_block) } -void GpsL1CaKfVtlTracking::disconnect(gr::top_block_sptr top_block) +void GpsL1CaKfTracking::disconnect(gr::top_block_sptr top_block) { if (top_block) { /* top_block is not null */ @@ -131,13 +132,13 @@ void GpsL1CaKfVtlTracking::disconnect(gr::top_block_sptr top_block) } -gr::basic_block_sptr GpsL1CaKfVtlTracking::get_left_block() +gr::basic_block_sptr GpsL1CaKfTracking::get_left_block() { return tracking_; } -gr::basic_block_sptr GpsL1CaKfVtlTracking::get_right_block() +gr::basic_block_sptr GpsL1CaKfTracking::get_right_block() { return tracking_; } diff --git a/src/algorithms/tracking/adapters/gps_l1_ca_kf_vtl_tracking.h b/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.h similarity index 77% rename from src/algorithms/tracking/adapters/gps_l1_ca_kf_vtl_tracking.h rename to src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.h index af011e917..7e2daaea8 100644 --- a/src/algorithms/tracking/adapters/gps_l1_ca_kf_vtl_tracking.h +++ b/src/algorithms/tracking/adapters/gps_l1_ca_kf_tracking.h @@ -1,6 +1,7 @@ /*! - * \file gps_l1_ca_kf_vtl_tracking.h - * \brief Interface of an adapter of a code + carrier Kalman Filter tracking loop with VTL capabilities block + * \file gps_l1_ca_kf_tracking.h + * \brief Interface of an adapter of a code + carrier Kalman Filter tracking + * loop with VTL capabilities block * for GPS L1 C/A to a TrackingInterface * \author Javier Arribas, 2020. jarribas(at)cttc.es * @@ -19,38 +20,39 @@ * ----------------------------------------------------------------------------- */ -#ifndef GNSS_SDR_GPS_L1_CA_kf_vtl_TRACKING_H -#define GNSS_SDR_GPS_L1_CA_kf_vtl_TRACKING_H +#ifndef GNSS_SDR_GPS_L1_CA_KF_TRACKING_H +#define GNSS_SDR_GPS_L1_CA_KF_TRACKING_H -#include "kf_vtl_tracking.h" +#include "kf_tracking.h" #include "tracking_interface.h" #include class ConfigurationInterface; /*! - * \brief This class implements a code + carrier Kalman Filter tracking loop with VTL capabilities + * \brief This class implements a code + carrier Kalman Filter tracking loop + * with VTL capabilities */ -class GpsL1CaKfVtlTracking : public TrackingInterface +class GpsL1CaKfTracking : public TrackingInterface { public: - GpsL1CaKfVtlTracking( + GpsL1CaKfTracking( const ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams); - ~GpsL1CaKfVtlTracking() = default; + ~GpsL1CaKfTracking() = default; inline std::string role() override { return role_; } - //! Returns "GPS_L1_CA_kf_vtl_Tracking" + //! Returns "GPS_L1_CA_KF_Tracking" inline std::string implementation() override { - return "GPS_L1_CA_KF_VTL_Tracking"; + return "GPS_L1_CA_KF_Tracking"; } inline size_t item_size() override @@ -70,7 +72,8 @@ public: /*! * \brief Set acquisition/tracking common Gnss_Synchro object pointer - * to efficiently exchange synchronization data between acquisition and tracking blocks + * to efficiently exchange synchronization data between acquisition + * and tracking blocks */ void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override; @@ -82,7 +85,7 @@ public: void stop_tracking() override; private: - kf_vtl_tracking_sptr tracking_; + kf_tracking_sptr tracking_; size_t item_size_; unsigned int channel_; std::string role_; @@ -90,4 +93,4 @@ private: unsigned int out_streams_; }; -#endif // GNSS_SDR_GPS_L1_CA_kf_vtl_TRACKING_H +#endif // GNSS_SDR_GPS_L1_CA_KF_TRACKING_H diff --git a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt index 7691b1483..213774a31 100644 --- a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt @@ -39,7 +39,7 @@ set(TRACKING_GR_BLOCKS_SOURCES glonass_l2_ca_dll_pll_c_aid_tracking_cc.cc glonass_l2_ca_dll_pll_c_aid_tracking_sc.cc dll_pll_veml_tracking.cc - kf_vtl_tracking.cc + kf_tracking.cc ${OPT_TRACKING_BLOCKS_SOURCES} ) @@ -54,7 +54,7 @@ set(TRACKING_GR_BLOCKS_HEADERS glonass_l2_ca_dll_pll_c_aid_tracking_cc.h glonass_l2_ca_dll_pll_c_aid_tracking_sc.h dll_pll_veml_tracking.h - kf_vtl_tracking.h + kf_tracking.h ${OPT_TRACKING_BLOCKS_HEADERS} ) diff --git a/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/kf_tracking.cc similarity index 98% rename from src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.cc rename to src/algorithms/tracking/gnuradio_blocks/kf_tracking.cc index 61a0fc7fd..53856bb4a 100644 --- a/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/kf_tracking.cc @@ -1,5 +1,5 @@ /*! - * \file kf_vtl_tracking.cc + * \file kf_tracking.cc * \brief Implementation of a Kalman filter based tracking with optional Vector * Tracking Loop message receiver block. * \author Javier Arribas, 2020. jarribas(at)cttc.es @@ -18,7 +18,7 @@ * ----------------------------------------------------------------------------- */ -#include "kf_vtl_tracking.h" +#include "kf_tracking.h" #include "Beidou_B1I.h" #include "Beidou_B3I.h" #include "GPS_L1_CA.h" @@ -71,14 +71,14 @@ namespace wht = boost; namespace wht = std; #endif -kf_vtl_tracking_sptr kf_vtl_make_tracking(const Kf_Conf &conf_) +kf_tracking_sptr kf_make_tracking(const Kf_Conf &conf_) { - return kf_vtl_tracking_sptr(new kf_vtl_tracking(conf_)); + return kf_tracking_sptr(new kf_tracking(conf_)); } -kf_vtl_tracking::kf_vtl_tracking(const Kf_Conf &conf_) - : gr::block("kf_vtl_tracking", +kf_tracking::kf_tracking(const Kf_Conf &conf_) + : gr::block("kf_tracking", gr::io_signature::make(1, 1, sizeof(gr_complex)), gr::io_signature::make(1, 1, sizeof(Gnss_Synchro))), d_trk_parameters(conf_), @@ -146,9 +146,9 @@ kf_vtl_tracking::kf_vtl_tracking(const Kf_Conf &conf_) [this](auto &&PH1) { msg_handler_telemetry_to_trk(PH1); }); #else #if USE_BOOST_BIND_PLACEHOLDERS - boost::bind(&kf_vtl_tracking::msg_handler_telemetry_to_trk, this, boost::placeholders::_1)); + boost::bind(&kf_tracking::msg_handler_telemetry_to_trk, this, boost::placeholders::_1)); #else - boost::bind(&kf_vtl_tracking::msg_handler_telemetry_to_trk, this, _1)); + boost::bind(&kf_tracking::msg_handler_telemetry_to_trk, this, _1)); #endif #endif @@ -160,9 +160,9 @@ kf_vtl_tracking::kf_vtl_tracking(const Kf_Conf &conf_) [this](auto &&PH1) { msg_handler_pvt_to_trk(PH1); }); #else #if USE_BOOST_BIND_PLACEHOLDERS - boost::bind(&kf_vtl_tracking::msg_handler_pvt_to_trk, this, boost::placeholders::_1)); + boost::bind(&kf_tracking::msg_handler_pvt_to_trk, this, boost::placeholders::_1)); #else - boost::bind(&kf_vtl_tracking::msg_handler_pvt_to_trk, this, _1)); + boost::bind(&kf_tracking::msg_handler_pvt_to_trk, this, _1)); #endif #endif @@ -587,7 +587,7 @@ kf_vtl_tracking::kf_vtl_tracking(const Kf_Conf &conf_) } -void kf_vtl_tracking::forecast(int noutput_items, +void kf_tracking::forecast(int noutput_items, gr_vector_int &ninput_items_required) { if (noutput_items != 0) @@ -597,7 +597,7 @@ void kf_vtl_tracking::forecast(int noutput_items, } -void kf_vtl_tracking::msg_handler_telemetry_to_trk(const pmt::pmt_t &msg) +void kf_tracking::msg_handler_telemetry_to_trk(const pmt::pmt_t &msg) { try { @@ -619,7 +619,7 @@ void kf_vtl_tracking::msg_handler_telemetry_to_trk(const pmt::pmt_t &msg) } -void kf_vtl_tracking::msg_handler_pvt_to_trk(const pmt::pmt_t &msg) +void kf_tracking::msg_handler_pvt_to_trk(const pmt::pmt_t &msg) { try { @@ -641,7 +641,7 @@ void kf_vtl_tracking::msg_handler_pvt_to_trk(const pmt::pmt_t &msg) } -void kf_vtl_tracking::start_tracking() +void kf_tracking::start_tracking() { gr::thread::scoped_lock l(d_setlock); // correct the code phase according to the delay between acq and trk @@ -854,7 +854,7 @@ void kf_vtl_tracking::start_tracking() } -void kf_vtl_tracking::init_kf(double acq_code_phase_chips, double acq_doppler_hz) +void kf_tracking::init_kf(double acq_code_phase_chips, double acq_doppler_hz) { // Kalman Filter class variables const double Ti = d_current_correlation_time_s; @@ -895,7 +895,7 @@ void kf_vtl_tracking::init_kf(double acq_code_phase_chips, double acq_doppler_hz } -void kf_vtl_tracking::update_kf_narrow_integration_time() +void kf_tracking::update_kf_narrow_integration_time() { // Kalman Filter class variables const double Ti = d_current_correlation_time_s; @@ -935,7 +935,7 @@ void kf_vtl_tracking::update_kf_narrow_integration_time() } -void kf_vtl_tracking::update_kf_cn0(double current_cn0_dbhz) +void kf_tracking::update_kf_cn0(double current_cn0_dbhz) { // Kalman Filter class variables const double Ti = d_current_correlation_time_s; // d_correlation_length_ms * 0.001; @@ -955,7 +955,7 @@ void kf_vtl_tracking::update_kf_cn0(double current_cn0_dbhz) } -kf_vtl_tracking::~kf_vtl_tracking() +kf_tracking::~kf_tracking() { if (d_dump_file.is_open()) { @@ -994,7 +994,7 @@ kf_vtl_tracking::~kf_vtl_tracking() } -bool kf_vtl_tracking::acquire_secondary() +bool kf_tracking::acquire_secondary() { // ******* preamble correlation ******** int32_t corr_value = 0; @@ -1033,7 +1033,7 @@ bool kf_vtl_tracking::acquire_secondary() } -bool kf_vtl_tracking::cn0_and_tracking_lock_status(double coh_integration_time_s) +bool kf_tracking::cn0_and_tracking_lock_status(double coh_integration_time_s) { // ####### CN0 ESTIMATION AND LOCK DETECTORS ###### if (d_cn0_estimation_counter < d_trk_parameters.cn0_samples) @@ -1098,7 +1098,7 @@ bool kf_vtl_tracking::cn0_and_tracking_lock_status(double coh_integration_time_s // - updated remnant code phase in samples (d_rem_code_phase_samples) // - d_code_freq_chips // - d_carrier_doppler_hz -void kf_vtl_tracking::do_correlation_step(const gr_complex *input_samples) +void kf_tracking::do_correlation_step(const gr_complex *input_samples) { // ################# CARRIER WIPEOFF AND CORRELATORS ############################## // perform carrier wipe-off and compute Early, Prompt and Late correlation @@ -1126,7 +1126,7 @@ void kf_vtl_tracking::do_correlation_step(const gr_complex *input_samples) } -void kf_vtl_tracking::run_Kf() +void kf_tracking::run_Kf() { // Carrier discriminator if (d_cloop) @@ -1204,7 +1204,7 @@ void kf_vtl_tracking::run_Kf() } -void kf_vtl_tracking::check_carrier_phase_coherent_initialization() +void kf_tracking::check_carrier_phase_coherent_initialization() { if (d_acc_carrier_phase_initialized == false) { @@ -1214,7 +1214,7 @@ void kf_vtl_tracking::check_carrier_phase_coherent_initialization() } -void kf_vtl_tracking::clear_tracking_vars() +void kf_tracking::clear_tracking_vars() { std::fill_n(d_correlator_outs.begin(), d_n_correlator_taps, gr_complex(0.0, 0.0)); if (d_trk_parameters.track_pilot) @@ -1234,7 +1234,7 @@ void kf_vtl_tracking::clear_tracking_vars() // todo: IT DOES NOT WORK WHEN NO KF IS RUNNING (extended correlation epochs!!) -void kf_vtl_tracking::update_tracking_vars() +void kf_tracking::update_tracking_vars() { d_T_chip_seconds = 1.0 / d_code_freq_kf_chips_s; d_T_prn_seconds = d_T_chip_seconds * static_cast(d_code_length_chips); @@ -1313,7 +1313,7 @@ void kf_vtl_tracking::update_tracking_vars() } -void kf_vtl_tracking::save_correlation_results() +void kf_tracking::save_correlation_results() { if (d_secondary) { @@ -1426,7 +1426,7 @@ void kf_vtl_tracking::save_correlation_results() } -void kf_vtl_tracking::log_data() +void kf_tracking::log_data() { if (d_dump) { @@ -1525,7 +1525,7 @@ void kf_vtl_tracking::log_data() } -int32_t kf_vtl_tracking::save_matfile() const +int32_t kf_tracking::save_matfile() const { // READ DUMP FILE std::ifstream::pos_type size; @@ -1725,7 +1725,7 @@ int32_t kf_vtl_tracking::save_matfile() const } -void kf_vtl_tracking::set_channel(uint32_t channel) +void kf_tracking::set_channel(uint32_t channel) { gr::thread::scoped_lock l(d_setlock); d_channel = channel; @@ -1756,21 +1756,21 @@ void kf_vtl_tracking::set_channel(uint32_t channel) } -void kf_vtl_tracking::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) +void kf_tracking::set_gnss_synchro(Gnss_Synchro *p_gnss_synchro) { gr::thread::scoped_lock l(d_setlock); d_acquisition_gnss_synchro = p_gnss_synchro; } -void kf_vtl_tracking::stop_tracking() +void kf_tracking::stop_tracking() { gr::thread::scoped_lock l(d_setlock); d_state = 0; } -int kf_vtl_tracking::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items, +int kf_tracking::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { gr::thread::scoped_lock l(d_setlock); diff --git a/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.h b/src/algorithms/tracking/gnuradio_blocks/kf_tracking.h similarity index 93% rename from src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.h rename to src/algorithms/tracking/gnuradio_blocks/kf_tracking.h index 1fe6360ae..37e38b679 100644 --- a/src/algorithms/tracking/gnuradio_blocks/kf_vtl_tracking.h +++ b/src/algorithms/tracking/gnuradio_blocks/kf_tracking.h @@ -1,5 +1,5 @@ /*! - * \file kf_vtl_tracking.cc + * \file kf_tracking.cc * \brief Implementation of a Kalman filter based tracking with optional Vector * Tracking Loop message receiver block. * \author Javier Arribas, 2020. jarribas(at)cttc.es @@ -18,8 +18,8 @@ * ----------------------------------------------------------------------------- */ -#ifndef GNSS_SDR_KF_VTL_TRACKING_H -#define GNSS_SDR_KF_VTL_TRACKING_H +#ifndef GNSS_SDR_KF_TRACKING_H +#define GNSS_SDR_KF_TRACKING_H #if ARMA_NO_BOUND_CHECKING #define ARMA_NO_DEBUG 1 @@ -48,19 +48,19 @@ #include // for pair class Gnss_Synchro; -class kf_vtl_tracking; +class kf_tracking; -using kf_vtl_tracking_sptr = gnss_shared_ptr; +using kf_tracking_sptr = gnss_shared_ptr; -kf_vtl_tracking_sptr kf_vtl_make_tracking(const Kf_Conf &conf_); +kf_tracking_sptr kf_make_tracking(const Kf_Conf &conf_); /*! * \brief This class implements a code DLL + carrier PLL tracking block. */ -class kf_vtl_tracking : public gr::block +class kf_tracking : public gr::block { public: - ~kf_vtl_tracking(); + ~kf_tracking(); void set_channel(uint32_t channel); void set_gnss_synchro(Gnss_Synchro *p_gnss_synchro); @@ -73,8 +73,8 @@ public: void forecast(int noutput_items, gr_vector_int &ninput_items_required); private: - friend kf_vtl_tracking_sptr kf_vtl_make_tracking(const Kf_Conf &conf_); - explicit kf_vtl_tracking(const Kf_Conf &conf_); + friend kf_tracking_sptr kf_make_tracking(const Kf_Conf &conf_); + explicit kf_tracking(const Kf_Conf &conf_); void init_kf(double acq_code_phase_chips, double acq_doppler_hz); void update_kf_narrow_integration_time(); @@ -233,4 +233,4 @@ private: bool d_enable_extended_integration; }; -#endif // GNSS_SDR_KF_VTL_TRACKING_H +#endif // GNSS_SDR_KF_TRACKING_H diff --git a/src/core/receiver/gnss_block_factory.cc b/src/core/receiver/gnss_block_factory.cc index 8c2b16e26..bbf6ef9aa 100644 --- a/src/core/receiver/gnss_block_factory.cc +++ b/src/core/receiver/gnss_block_factory.cc @@ -73,7 +73,7 @@ #include "gnss_sdr_string_literals.h" #include "gps_l1_ca_dll_pll_tracking.h" #include "gps_l1_ca_gaussian_tracking.h" -#include "gps_l1_ca_kf_vtl_tracking.h" +#include "gps_l1_ca_kf_tracking.h" #include "gps_l1_ca_pcps_acquisition.h" #include "gps_l1_ca_pcps_acquisition_fine_doppler.h" #include "gps_l1_ca_pcps_assisted_acquisition.h" @@ -1085,9 +1085,9 @@ std::unique_ptr GNSSBlockFactory::GetBlock( out_streams); block = std::move(block_); } - else if (implementation == "GPS_L1_CA_KF_VTL_Tracking") + else if (implementation == "GPS_L1_CA_KF_Tracking") { - std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, out_streams); block = std::move(block_); } @@ -1541,9 +1541,9 @@ std::unique_ptr GNSSBlockFactory::GetTrkBlock( out_streams); block = std::move(block_); } - else if (implementation == "GPS_L1_CA_KF_VTL_Tracking") + else if (implementation == "GPS_L1_CA_KF_Tracking") { - std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, + std::unique_ptr block_ = std::make_unique(configuration, role, in_streams, out_streams); block = std::move(block_); } From 30d149b151266e50cd17fbbc650cd8200fda9ee2 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 30 Aug 2022 12:21:56 +0200 Subject: [PATCH 11/11] Add default parameters to conf file for reference --- conf/gnss-sdr_labsat_kf.conf | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/conf/gnss-sdr_labsat_kf.conf b/conf/gnss-sdr_labsat_kf.conf index 6c113486c..31787abab 100644 --- a/conf/gnss-sdr_labsat_kf.conf +++ b/conf/gnss-sdr_labsat_kf.conf @@ -101,10 +101,23 @@ Tracking_1C.implementation=GPS_L1_CA_KF_Tracking Tracking_1C.item_type=gr_complex Tracking_1C.dump=true Tracking_1C.dump_filename=./tracking_ch_ -Tracking_1C.extend_correlation_symbols=10; +Tracking_1C.extend_correlation_symbols=20; Tracking_1C.early_late_space_chips=0.5; Tracking_1C.early_late_space_narrow_chips=0.15 +;Tracking_1C.code_disc_sd_chips=0.2; // Initial R +;Tracking_1C.carrier_disc_sd_rads=0.3; // Initial R + +;Tracking_1C.init_code_phase_sd_chips=0.5; // Initial P_0_0 +;Tracking_1C.init_carrier_phase_sd_rad=0.7; +;Tracking_1C.init_carrier_freq_sd_hz=5; +;Tracking_1C.init_carrier_freq_rate_sd_hz_s=1; + +;Tracking_1C.code_phase_sd_chips=0.15; // Initial Q +;Tracking_1C.carrier_phase_sd_rad=0.25; +;Tracking_1C.carrier_freq_sd_hz=0.6; +;Tracking_1C.carrier_freq_rate_sd_hz_s=0.01; + ;######### TRACKING GALILEO CONFIG ############ Tracking_1B.implementation=Galileo_E1_DLL_PLL_VEML_Tracking