1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-05-28 12:14:10 +00:00

Improving the reliability of GPS L1 CA symbol synchronization

This commit is contained in:
Javier Arribas 2021-10-04 17:07:07 +02:00
parent 3800ac4c21
commit 58c2a43239
3 changed files with 32 additions and 3 deletions

View File

@ -426,6 +426,24 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__
Gnss_Synchro current_symbol{}; Gnss_Synchro current_symbol{};
// 1. Copy the current tracking output // 1. Copy the current tracking output
current_symbol = in[0][0]; current_symbol = in[0][0];
if (d_symbol_history.empty())
{
//Tracking synchronizes the tlm bit boundaries by acquiring the preamble
//inserting the preamble to the new tracked satellite (history empty) before the first synchronized symbol
//may speed up the tlm decoding by not discarding the first received frame
for (int32_t i = 0; i < GPS_CA_PREAMBLE_LENGTH_BITS; i++)
{
if (current_symbol.Flag_PLL_180_deg_phase_locked == true)
{
d_symbol_history.push_back(static_cast<float>(-d_preamble_samples[i]));
}
else
{
d_symbol_history.push_back(static_cast<float>(d_preamble_samples[i]));
}
d_sample_counter++;
}
}
// add new symbol to the symbol queue // add new symbol to the symbol queue
d_symbol_history.push_back(current_symbol.Prompt_I); d_symbol_history.push_back(current_symbol.Prompt_I);
d_sample_counter++; // count for the processed symbols d_sample_counter++; // count for the processed symbols
@ -449,7 +467,7 @@ int gps_l1_ca_telemetry_decoder_gs::general_work(int noutput_items __attribute__
{ {
// correlate with preamble // correlate with preamble
int32_t corr_value = 0; int32_t corr_value = 0;
if (d_symbol_history.size() >= GPS_CA_PREAMBLE_LENGTH_BITS) if (d_symbol_history.size() >= d_required_symbols)
{ {
// ******* preamble correlation ******** // ******* preamble correlation ********
for (int32_t i = 0; i < GPS_CA_PREAMBLE_LENGTH_BITS; i++) for (int32_t i = 0; i < GPS_CA_PREAMBLE_LENGTH_BITS; i++)

View File

@ -142,8 +142,8 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl
d_trk_parameters.y_intercept = 1.0; d_trk_parameters.y_intercept = 1.0;
// symbol integration: 20 trk symbols (20 ms) = 1 tlm bit // symbol integration: 20 trk symbols (20 ms) = 1 tlm bit
// set the bit transition pattern in secondary code to obtain bit synchronization // set the bit transition pattern in secondary code to obtain bit synchronization
d_secondary_code_length = static_cast<uint32_t>(GPS_CA_BIT_TRANSITION_SYMBOLS_LENGTH_SYMBOLS); d_secondary_code_length = static_cast<uint32_t>(GPS_CA_PREAMBLE_LENGTH_SYMBOLS);
d_secondary_code_string = GPS_CA_BIT_TRANSITION_SYMBOLS_STR; d_secondary_code_string = GPS_CA_PREAMBLE_SYMBOLS_STR;
d_symbols_per_bit = GPS_CA_TELEMETRY_SYMBOLS_PER_BIT; d_symbols_per_bit = GPS_CA_TELEMETRY_SYMBOLS_PER_BIT;
} }
else if (d_signal_type == "2S") else if (d_signal_type == "2S")
@ -588,6 +588,7 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl
} }
d_corrected_doppler = false; d_corrected_doppler = false;
d_acc_carrier_phase_initialized = false; d_acc_carrier_phase_initialized = false;
d_Flag_PLL_180_deg_phase_locked = false;
} }
@ -928,6 +929,14 @@ bool dll_pll_veml_tracking::acquire_secondary()
if (abs(corr_value) == static_cast<int32_t>(d_secondary_code_length)) if (abs(corr_value) == static_cast<int32_t>(d_secondary_code_length))
{ {
if (corr_value < 0)
{
d_Flag_PLL_180_deg_phase_locked = true;
}
else
{
d_Flag_PLL_180_deg_phase_locked = false;
}
return true; return true;
} }
@ -1989,6 +1998,7 @@ int dll_pll_veml_tracking::general_work(int noutput_items __attribute__((unused)
current_synchro_data.fs = static_cast<int64_t>(d_trk_parameters.fs_in); current_synchro_data.fs = static_cast<int64_t>(d_trk_parameters.fs_in);
current_synchro_data.Tracking_sample_counter = d_sample_counter; current_synchro_data.Tracking_sample_counter = d_sample_counter;
current_synchro_data.Flag_valid_symbol_output = !loss_of_lock; current_synchro_data.Flag_valid_symbol_output = !loss_of_lock;
current_synchro_data.Flag_PLL_180_deg_phase_locked = d_Flag_PLL_180_deg_phase_locked;
*out[0] = current_synchro_data; *out[0] = current_synchro_data;
return 1; return 1;
} }

View File

@ -198,6 +198,7 @@ private:
bool d_dump_mat; bool d_dump_mat;
bool d_acc_carrier_phase_initialized; bool d_acc_carrier_phase_initialized;
bool d_enable_extended_integration; bool d_enable_extended_integration;
bool d_Flag_PLL_180_deg_phase_locked;
}; };