21 #ifndef GNSS_SDR_KF_TRACKING_H 22 #define GNSS_SDR_KF_TRACKING_H 24 #if ARMA_NO_BOUND_CHECKING 25 #define ARMA_NO_DEBUG 1 36 #include <boost/circular_buffer.hpp> 37 #include <gnuradio/block.h> 38 #include <gnuradio/gr_complex.h> 39 #include <gnuradio/types.h> 41 #include <volk_gnsssdr/volk_gnsssdr_alloc.h> 53 using kf_tracking_sptr = gnss_shared_ptr<kf_tracking>;
55 kf_tracking_sptr kf_make_tracking(
const Kf_Conf &conf_);
65 void set_channel(uint32_t channel);
67 void start_tracking();
70 int general_work(
int noutput_items, gr_vector_int &ninput_items,
71 gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
73 void forecast(
int noutput_items, gr_vector_int &ninput_items_required);
76 friend kf_tracking_sptr kf_make_tracking(
const Kf_Conf &conf_);
79 void init_kf(
double acq_code_phase_chips,
double acq_doppler_hz);
80 void update_kf_narrow_integration_time();
81 void update_kf_cn0(
double current_cn0_dbhz);
84 void msg_handler_telemetry_to_trk(
const pmt::pmt_t &msg);
85 void msg_handler_pvt_to_trk(
const pmt::pmt_t &msg);
86 void do_correlation_step(
const gr_complex *input_samples);
88 void check_carrier_phase_coherent_initialization();
89 void update_tracking_vars();
90 void clear_tracking_vars();
91 void save_correlation_results();
93 bool cn0_and_tracking_lock_status(
double coh_integration_time_s);
94 bool acquire_secondary();
95 int32_t save_matfile()
const;
107 volk_gnsssdr::vector<float> d_tracking_code;
108 volk_gnsssdr::vector<float> d_data_code;
109 volk_gnsssdr::vector<float> d_local_code_shift_chips;
110 volk_gnsssdr::vector<gr_complex> d_correlator_outs;
111 volk_gnsssdr::vector<gr_complex> d_Prompt_Data;
112 volk_gnsssdr::vector<gr_complex> d_Prompt_buffer;
114 boost::circular_buffer<gr_complex> d_Prompt_circular_buffer;
115 boost::circular_buffer<std::pair<double, double>> d_code_ph_history;
116 boost::circular_buffer<std::pair<double, double>> d_carr_ph_history;
118 const size_t d_int_type_hash_code =
typeid(int).hash_code();
125 arma::mat d_P_old_old;
126 arma::mat d_P_new_old;
127 arma::mat d_P_new_new;
128 arma::vec d_x_old_old;
129 arma::vec d_x_new_old;
130 arma::vec d_x_new_new;
132 std::string d_secondary_code_string;
133 std::string d_data_secondary_code_string;
134 std::string d_systemName;
135 std::string d_signal_type;
136 std::string d_signal_pretty_name;
137 std::string d_dump_filename;
139 std::ofstream d_dump_file;
141 gr_complex *d_Very_Early;
143 gr_complex *d_Prompt;
145 gr_complex *d_Very_Late;
147 gr_complex d_VE_accu;
150 gr_complex d_P_accu_old;
152 gr_complex d_VL_accu;
153 gr_complex d_P_data_accu;
156 double d_signal_carrier_freq;
157 double d_code_period;
158 double d_code_chip_rate;
161 double d_acq_code_phase_samples;
162 double d_acq_carrier_doppler_hz;
163 double d_current_correlation_time_s;
166 double d_carr_phase_error_disc_hz;
167 double d_code_error_disc_chips;
171 double d_code_error_kf_chips;
172 double d_code_freq_kf_chips_s;
174 double d_carrier_phase_kf_rad;
175 double d_carrier_doppler_kf_hz;
176 double d_carrier_doppler_rate_kf_hz_s;
178 double d_acc_carrier_phase_rad;
180 double d_T_chip_seconds;
181 double d_T_prn_seconds;
182 double d_T_prn_samples;
183 double d_K_blk_samples;
184 double d_carrier_lock_test;
185 double d_CN0_SNV_dB_Hz;
186 double d_carrier_lock_threshold;
189 double d_carrier_phase_step_rad;
190 double d_carrier_phase_rate_step_rad;
193 double d_code_phase_step_chips;
194 double d_code_phase_rate_step_chips;
195 double d_rem_code_phase_chips;
196 double d_rem_code_phase_samples;
200 uint64_t d_sample_counter;
201 uint64_t d_acq_sample_stamp;
203 float *d_prompt_data_shift;
204 float d_rem_carr_phase_rad;
207 uint32_t d_secondary_code_length;
208 uint32_t d_data_secondary_code_length;
210 int32_t d_symbols_per_bit;
212 int32_t d_correlation_length_ms;
213 int32_t d_n_correlator_taps;
214 int32_t d_current_prn_length_samples;
215 int32_t d_extend_correlation_symbols_count;
216 int32_t d_current_symbol;
217 int32_t d_current_data_symbol;
218 int32_t d_cn0_estimation_counter;
219 int32_t d_carrier_lock_fail_counter;
220 int32_t d_code_lock_fail_counter;
221 int32_t d_code_samples_per_chip;
222 int32_t d_code_length_chips;
224 bool d_pull_in_transitory;
225 bool d_corrected_doppler;
226 bool d_interchange_iq;
232 bool d_acc_carrier_phase_initialized;
233 bool d_enable_extended_integration;
236 #endif // GNSS_SDR_KF_TRACKING_H class that stores both the receiver time, relative to the receiver start and the GNSS time (absolute)...
This is the class that contains the information that is shared by the processing blocks.
This interface represents a GNSS block.
Highly optimized CPU vector multiTAP correlator class using real-valued local codes.
Class that implements a first-order exponential smoother.
Class that implements carrier wipe-off and correlators.
Generic 1st to 3rd order loop filter implementation.
This class implements a code DLL + carrier PLL tracking block.
Interface of a hybrid FLL and PLL filter for tracking carrier loop.
Class that implements an exponential smoother.