1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-11-06 18:23:05 +00:00

the tracking module is now sending 1 synchro_data per data symbol.

This commit is contained in:
Marc Majoral
2019-07-17 18:01:27 +02:00
parent 58cc961aec
commit 4c22a1ce1a
17 changed files with 738 additions and 1687 deletions

View File

@@ -43,11 +43,8 @@
#include <gnuradio/types.h> // for gr_vector_int, gr_vector...
#include <pmt/pmt.h> // for pmt_t
#include <cstdint> // for int32_t
#include <deque> // for deque
#include <fstream> // for string, ofstream
#include <memory> // for shared_ptr
#include <string>
#include <utility> // for pair
#include <utility> // for pair
#include <vector>
class Fpga_Multicorrelator_8sc;
@@ -77,27 +74,25 @@ public:
void reset(void);
//bool stop(void);
// void stop(void);
private:
friend dll_pll_veml_tracking_fpga_sptr dll_pll_veml_make_tracking_fpga(const Dll_Pll_Conf_Fpga &conf_);
void msg_handler_telemetry_to_trk(const pmt::pmt_t &msg);
dll_pll_veml_tracking_fpga(const Dll_Pll_Conf_Fpga &conf_);
void msg_handler_preamble_index(pmt::pmt_t msg);
bool cn0_and_tracking_lock_status(double coh_integration_time_s);
bool acquire_secondary();
void do_correlation_step(void);
void run_dll_pll();
void update_tracking_vars();
void update_tracking_vars_extend_integration_in_FPGA();
void clear_tracking_vars();
void save_correlation_results();
void save_correlation_results_extended_integration_in_FPGA();
void log_data();
void log_data_extended_integration_in_FPGA(bool extended_correlation_in_fpga_enabled);
int32_t save_matfile();
//void run_state_2(Gnss_Synchro &current_synchro_data);
// tracking configuration vars
Dll_Pll_Conf_Fpga trk_parameters;
bool d_veml;
@@ -105,9 +100,8 @@ private:
uint32_t d_channel;
Gnss_Synchro *d_acquisition_gnss_synchro;
//Signal parameters
// Signal parameters
bool d_secondary;
bool interchange_iq;
double d_signal_carrier_freq;
double d_code_period;
double d_code_chip_rate;
@@ -122,9 +116,6 @@ private:
std::string *d_data_secondary_code_string;
std::string signal_pretty_name;
int32_t *d_preambles_symbols;
int32_t d_preamble_length_symbols;
boost::circular_buffer<float> d_symbol_history;
// dll filter buffer
boost::circular_buffer<float> d_dll_filt_history;
@@ -150,7 +141,6 @@ private:
int32_t d_current_symbol;
int32_t d_current_data_symbol;
gr_complex d_VE_accu;
gr_complex d_E_accu;
gr_complex d_P_accu;
@@ -158,9 +148,6 @@ private:
gr_complex d_L_accu;
gr_complex d_VL_accu;
// gr_complex d_P_data_accu; // when the extended integration is done in the FPGA we need to accumulate the pilot correlator results too
uint32_t d_num_current_syncrho_repetitions;
gr_complex d_P_data_accu;
gr_complex *d_Prompt_Data;
@@ -170,14 +157,12 @@ private:
double d_carrier_phase_step_rad;
double d_carrier_phase_rate_step_rad;
boost::circular_buffer<std::pair<double, double>> d_carr_ph_history;
// remaining code phase and carrier phase between tracking loops
double d_rem_code_phase_samples;
double d_rem_code_phase_samples_first;
double d_rem_code_phase_samples_next;
double d_rem_code_phase_samples_prev;
float d_rem_carr_phase_rad;
// PLL and DLL filter library
Tracking_loop_filter d_code_loop_filter;
Tracking_FLL_PLL_filter d_carrier_loop_filter;
@@ -202,98 +187,44 @@ private:
double T_prn_seconds;
double T_prn_samples;
double K_blk_samples;
//double K_blk_samples_prev;
// integration period in samples
int32_t d_current_integration_length_samples;
// processing samples counters
uint64_t d_sample_counter;
uint64_t d_acq_sample_stamp;
uint64_t d_absolute_samples_offset;
// CN0 estimation and lock detector
int32_t d_cn0_estimation_counter;
int32_t d_carrier_lock_fail_counter;
//std::deque<float> d_carrier_lock_detector_queue;
int32_t d_code_lock_fail_counter;
double d_carrier_lock_test;
double d_CN0_SNV_dB_Hz;
double d_carrier_lock_threshold;
boost::circular_buffer<gr_complex> d_Prompt_circular_buffer;
//std::deque<gr_complex> d_Prompt_buffer_deque;
std::vector<gr_complex> d_Prompt_buffer;
Exponential_Smoother d_cn0_smoother;
bool d_extended_correlation_in_fpga;
Exponential_Smoother d_carrier_lock_test_smoother;
// file dump
std::ofstream d_dump_file;
std::string d_dump_filename;
bool d_dump;
bool d_dump_mat;
// extra
int32_t d_correlation_length_samples;
bool d_extended_correlation_in_fpga;
bool d_current_extended_correlation_in_fpga;
int32_t d_next_integration_length_samples;
int32_t d_extended_integration_first_prn_length_samples;
int32_t d_extended_integration_next_prn_length_samples;
double d_extended_integration_first_acc_carrier_phase_rad;
double d_extended_integration_next_acc_carrier_phase_rad_step;
uint64_t d_sample_counter_next;
// DEBUG STUFF
uint64_t d_current_synchro_data_Tracking_sample_counter[20];
double d_current_synchro_data_Code_phase_samples[20];
double d_current_synchro_data_Carrier_phase_rads[20];
double d_current_synchro_data_Carrier_Doppler_hz[20];
double d_current_synchro_data_CN0_dB_hz[20];
bool d_current_synchro_data_Flag_valid_symbol_output[20];
int32_t d_current_synchro_data_correlation_length_ms[20];
double d_current_synchro_data_Prompt_I[20];
double d_current_synchro_data_Prompt_Q[20];
double T_prn_samples_prev;
int32_t d_actual_blk_length;
bool d_flag_printout;
std::string *d_secondary_code_string_data;
std::string *d_secondary_code_string_pilot;
uint32_t d_secondary_code_length_data;
uint32_t d_secondary_code_length_pilot;
uint32_t d_first_length_secondary_code;
uint32_t d_next_length_secondary_code;
uint32_t d_debug_counter;
uint32_t d_secondary_code_post_apply_counter; // init in set_gnss_synchro
std::string *d_secondary_code_string_post_apply; // init in constructor
uint32_t d_secondary_code_post_apply_length; // init in constructor
bool enable_post_apply_secondary_code;
uint32_t d_secondary_code_debug_counter_whole_bits;
bool d_sc_remodulate_enabled;
bool d_sc_demodulate_enabled;
bool d_sc_prompt_changed;
float debug_d_rem_carr_phase_rad;
uint32_t debug_first_time;
uint32_t d_extend_fpga_integration_periods;
int32_t d_extend_fpga_integration_periods;
uint32_t d_fpga_integration_period;
uint32_t d_current_fpga_integration_period;
bool d_worker_is_done;
boost::condition_variable m_condition;
boost::mutex d_mutex;
bool d_stop_tracking;
};