21 #ifndef GNSS_SDR_DLL_PLL_VEML_TRACKING_FPGA_H 22 #define GNSS_SDR_DLL_PLL_VEML_TRACKING_FPGA_H 28 #include <boost/circular_buffer.hpp> 29 #include <gnuradio/block.h> 30 #include <gnuradio/gr_complex.h> 31 #include <gnuradio/types.h> 33 #include <volk_gnsssdr/volk_gnsssdr_alloc.h> 41 #if GNURADIO_USES_STD_POINTERS 43 #include <boost/shared_ptr.hpp> 50 #if GNURADIO_USES_STD_POINTERS 51 using dll_pll_veml_tracking_fpga_sptr = std::shared_ptr<dll_pll_veml_tracking_fpga>;
53 using dll_pll_veml_tracking_fpga_sptr = boost::shared_ptr<dll_pll_veml_tracking_fpga>;
56 dll_pll_veml_tracking_fpga_sptr dll_pll_veml_make_tracking_fpga(
const Dll_Pll_Conf_Fpga &conf_);
98 int general_work(
int noutput_items, gr_vector_int &ninput_items,
99 gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
107 friend dll_pll_veml_tracking_fpga_sptr dll_pll_veml_make_tracking_fpga(
const Dll_Pll_Conf_Fpga &conf_);
110 void msg_handler_telemetry_to_trk(
const pmt::pmt_t &msg);
111 bool cn0_and_tracking_lock_status(
double coh_integration_time_s);
112 bool acquire_secondary();
113 void do_correlation_step();
115 void check_carrier_phase_coherent_initialization();
116 void update_tracking_vars();
117 void clear_tracking_vars();
118 void save_correlation_results();
120 int32_t save_matfile()
const;
133 volk_gnsssdr::vector<float> d_local_code_shift_chips;
134 volk_gnsssdr::vector<gr_complex> d_correlator_outs;
135 volk_gnsssdr::vector<gr_complex> d_Prompt_Data;
136 volk_gnsssdr::vector<gr_complex> d_Prompt_buffer;
138 boost::circular_buffer<float> d_dll_filt_history;
139 boost::circular_buffer<std::pair<double, double>> d_code_ph_history;
140 boost::circular_buffer<std::pair<double, double>> d_carr_ph_history;
141 boost::circular_buffer<gr_complex> d_Prompt_circular_buffer;
143 std::string d_systemName;
144 std::string d_signal_type;
145 std::string d_secondary_code_string;
146 std::string d_data_secondary_code_string;
147 std::string d_signal_pretty_name;
148 std::string d_dump_filename;
150 std::ofstream d_dump_file;
152 std::shared_ptr<Fpga_Multicorrelator_8sc> d_multicorrelator_fpga;
154 boost::condition_variable d_m_condition;
156 boost::mutex d_mutex;
158 const size_t int_type_hash_code =
typeid(int).hash_code();
160 double d_signal_carrier_freq;
161 double d_code_period;
162 double d_code_chip_rate;
163 double d_code_phase_step_chips;
164 double d_code_phase_rate_step_chips;
165 double d_carrier_phase_step_rad;
166 double d_carrier_phase_rate_step_rad;
167 double d_acq_code_phase_samples;
168 double d_acq_carrier_doppler_hz;
169 double d_rem_code_phase_samples;
170 double d_rem_code_phase_samples_prev;
171 double d_current_correlation_time_s;
172 double d_carr_phase_error_hz;
173 double d_carr_freq_error_hz;
174 double d_carr_error_filt_hz;
175 double d_code_error_chips;
176 double d_code_error_filt_chips;
177 double d_code_freq_chips;
178 double d_carrier_doppler_hz;
179 double d_acc_carrier_phase_rad;
180 double d_rem_code_phase_chips;
181 double d_T_chip_seconds;
182 double d_T_prn_seconds;
183 double d_T_prn_samples;
184 double d_K_blk_samples;
185 double d_carrier_lock_test;
186 double d_CN0_SNV_dB_Hz;
187 double d_carrier_lock_threshold;
189 gr_complex *d_Very_Early;
191 gr_complex *d_Prompt;
193 gr_complex *d_Very_Late;
195 gr_complex d_VE_accu;
198 gr_complex d_P_accu_old;
200 gr_complex d_VL_accu;
201 gr_complex d_P_data_accu;
203 uint64_t d_sample_counter;
204 uint64_t d_acq_sample_stamp;
205 uint64_t d_sample_counter_next;
207 float *d_prompt_data_shift;
208 float d_rem_carr_phase_rad;
210 int32_t d_symbols_per_bit;
212 int32_t d_extend_correlation_symbols_count;
213 int32_t d_current_symbol;
214 int32_t d_current_data_symbol;
215 int32_t d_current_integration_length_samples;
216 int32_t d_cn0_estimation_counter;
217 int32_t d_carrier_lock_fail_counter;
218 int32_t d_code_lock_fail_counter;
219 int32_t d_correlation_length_ms;
220 int32_t d_n_correlator_taps;
221 int32_t d_next_integration_length_samples;
222 int32_t d_extend_fpga_integration_periods;
225 uint32_t d_secondary_code_length;
226 uint32_t d_data_secondary_code_length;
227 uint32_t d_code_length_chips;
228 uint32_t d_code_samples_per_chip;
229 uint32_t d_fpga_integration_period;
230 uint32_t d_current_fpga_integration_period;
235 bool d_enable_extended_integration;
238 bool d_pull_in_transitory;
239 bool d_corrected_doppler;
240 bool d_interchange_iq;
241 bool d_acc_carrier_phase_initialized;
242 bool d_worker_is_done;
243 bool d_extended_correlation_in_fpga;
244 bool d_current_extended_correlation_in_fpga;
245 bool d_stop_tracking;
246 bool d_sc_demodulate_enabled;
249 #endif // GNSS_SDR_DLL_PLL_VEML_TRACKING_FPGA_H void set_channel(uint32_t channel)
Set the channel number and configure some multicorrelator parameters.
void stop_tracking()
This function sets a flag that makes general_work to stop in order to finish the tracking process...
This class implements a code DLL + carrier PLL tracking block.
void reset()
This function disables the HW multicorrelator in the FPGA in order to stop the tracking process...
Class that contains all the configuration parameters for generic tracking block based on a DLL and a ...
This class implements a hybrid FLL and PLL filter for tracking carrier loop.
This is the class that contains the information that is shared by the processing blocks.
Class that implements a first-order exponential smoother.
~dll_pll_veml_tracking_fpga()
Destructor.
void set_gnss_synchro(Gnss_Synchro *p_gnss_synchro)
This function is used with two purposes: 1 -> To set the gnss_synchro 2 -> A set_gnss_synchro command...
int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
General Work.
void start_tracking()
This function starts the tracking process.
Class that implements carrier wipe-off and correlators.
Generic 1st to 3rd order loop filter implementation.
This class implements a generic 1st, 2nd or 3rd order loop filter.
Interface of a hybrid FLL and PLL filter for tracking carrier loop.
Class that implements an exponential smoother.