mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-14 12:10:34 +00:00
fixing some gnuradio-related warnings reported by gcc, so others can be spotted easier
This commit is contained in:
parent
17517625be
commit
45195917c1
@ -307,7 +307,12 @@ int galileo_e1_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_it
|
|||||||
}
|
}
|
||||||
|
|
||||||
consume_each(1); //one by one
|
consume_each(1); //one by one
|
||||||
return 0;
|
output_items.clear(); // removes a warning
|
||||||
|
if((noutput_items == 0) || (ninput_items[0] == 0))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "noutput_items = 0";
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -344,7 +344,12 @@ int gps_l1_ca_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_ite
|
|||||||
}
|
}
|
||||||
|
|
||||||
consume_each(1); //one by one
|
consume_each(1); //one by one
|
||||||
return noutput_items;
|
output_items.clear(); // removes a warning
|
||||||
|
if((noutput_items == 0) || (ninput_items[0] == 0))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "noutput_items = 0";
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -370,7 +370,12 @@ int hybrid_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_items,
|
|||||||
}
|
}
|
||||||
|
|
||||||
consume_each(1); //one by one
|
consume_each(1); //one by one
|
||||||
return noutput_items;
|
output_items.clear(); // removes a warning
|
||||||
|
if((noutput_items == 0) || (ninput_items[0] == 0))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "noutput_items = 0";
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -647,7 +647,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
|||||||
// weighting_factor = 0;
|
// weighting_factor = 0;
|
||||||
// std::cout << "weighting_factor " << weighting_factor << std::endl;
|
// std::cout << "weighting_factor " << weighting_factor << std::endl;
|
||||||
// Initialize first iterations
|
// Initialize first iterations
|
||||||
for (int doppler_index=0; doppler_index < CAF_bins_half; doppler_index++)
|
for (int doppler_index = 0; doppler_index < CAF_bins_half; doppler_index++)
|
||||||
{
|
{
|
||||||
d_CAF_vector[doppler_index] = 0;
|
d_CAF_vector[doppler_index] = 0;
|
||||||
// volk_32f_accumulator_s32f_a(&d_CAF_vector[doppler_index], d_CAF_vector_I, CAF_bins_half+doppler_index+1);
|
// volk_32f_accumulator_s32f_a(&d_CAF_vector[doppler_index], d_CAF_vector_I, CAF_bins_half+doppler_index+1);
|
||||||
@ -656,7 +656,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
|||||||
d_CAF_vector[doppler_index] += d_CAF_vector_I[i] * (1 - weighting_factor * static_cast<unsigned int>((doppler_index - i)));
|
d_CAF_vector[doppler_index] += d_CAF_vector_I[i] * (1 - weighting_factor * static_cast<unsigned int>((doppler_index - i)));
|
||||||
}
|
}
|
||||||
// d_CAF_vector[doppler_index] /= CAF_bins_half+doppler_index+1;
|
// d_CAF_vector[doppler_index] /= CAF_bins_half+doppler_index+1;
|
||||||
d_CAF_vector[doppler_index] /= 1 + CAF_bins_half+doppler_index - weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2 - weighting_factor*doppler_index*(doppler_index+1)/2; // triangles = [n*(n+1)/2]
|
d_CAF_vector[doppler_index] /= 1 + CAF_bins_half + doppler_index - weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2 - weighting_factor * doppler_index * (doppler_index + 1) / 2; // triangles = [n*(n+1)/2]
|
||||||
if (d_both_signal_components)
|
if (d_both_signal_components)
|
||||||
{
|
{
|
||||||
accum[0] = 0;
|
accum[0] = 0;
|
||||||
@ -671,21 +671,21 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Body loop
|
// Body loop
|
||||||
for (unsigned int doppler_index = CAF_bins_half;doppler_index<d_num_doppler_bins-CAF_bins_half;doppler_index++)
|
for (unsigned int doppler_index = CAF_bins_half; doppler_index < d_num_doppler_bins - CAF_bins_half; doppler_index++)
|
||||||
{
|
{
|
||||||
d_CAF_vector[doppler_index] = 0;
|
d_CAF_vector[doppler_index] = 0;
|
||||||
// volk_32f_accumulator_s32f_a(&d_CAF_vector[doppler_index], &d_CAF_vector_I[doppler_index-CAF_bins_half], 2*CAF_bins_half+1);
|
// volk_32f_accumulator_s32f_a(&d_CAF_vector[doppler_index], &d_CAF_vector_I[doppler_index-CAF_bins_half], 2*CAF_bins_half+1);
|
||||||
for (int i = doppler_index-CAF_bins_half; i < doppler_index+CAF_bins_half + 1; i++)
|
for (int i = doppler_index - CAF_bins_half; i < static_cast<int>(doppler_index + CAF_bins_half + 1); i++)
|
||||||
{
|
{
|
||||||
d_CAF_vector[doppler_index] += d_CAF_vector_I[i] * (1-weighting_factor * static_cast<unsigned int>((doppler_index - i)));
|
d_CAF_vector[doppler_index] += d_CAF_vector_I[i] * (1 - weighting_factor * static_cast<unsigned int>((doppler_index - i)));
|
||||||
}
|
}
|
||||||
// d_CAF_vector[doppler_index] /= 2*CAF_bins_half+1;
|
// d_CAF_vector[doppler_index] /= 2*CAF_bins_half+1;
|
||||||
d_CAF_vector[doppler_index] /= 1 + 2 * CAF_bins_half - 2 * weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2;
|
d_CAF_vector[doppler_index] /= 1 + 2 * CAF_bins_half - 2 * weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2;
|
||||||
if (d_both_signal_components)
|
if (d_both_signal_components)
|
||||||
{
|
{
|
||||||
accum[0] = 0;
|
accum[0] = 0;
|
||||||
// volk_32f_accumulator_s32f_a(&accum[0], &d_CAF_vector_Q[doppler_index-CAF_bins_half], 2*CAF_bins_half);
|
// volk_32f_accumulator_s32f_a(&accum[0], &d_CAF_vector_Q[doppler_index-CAF_bins_half], 2*CAF_bins_half);
|
||||||
for (int i = doppler_index-CAF_bins_half; i < doppler_index + CAF_bins_half + 1; i++)
|
for (int i = doppler_index-CAF_bins_half; i < static_cast<int>(doppler_index + CAF_bins_half + 1); i++)
|
||||||
{
|
{
|
||||||
accum[0] += d_CAF_vector_Q[i] * (1 - weighting_factor * static_cast<unsigned int>((doppler_index - i)));
|
accum[0] += d_CAF_vector_Q[i] * (1 - weighting_factor * static_cast<unsigned int>((doppler_index - i)));
|
||||||
}
|
}
|
||||||
@ -695,11 +695,11 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Final iterations
|
// Final iterations
|
||||||
for (int doppler_index = d_num_doppler_bins - CAF_bins_half; doppler_index < d_num_doppler_bins; doppler_index++)
|
for (int doppler_index = d_num_doppler_bins - CAF_bins_half; doppler_index < static_cast<int>(d_num_doppler_bins); doppler_index++)
|
||||||
{
|
{
|
||||||
d_CAF_vector[doppler_index] = 0;
|
d_CAF_vector[doppler_index] = 0;
|
||||||
// volk_32f_accumulator_s32f_a(&d_CAF_vector[doppler_index], &d_CAF_vector_I[doppler_index-CAF_bins_half], CAF_bins_half + (d_num_doppler_bins-doppler_index));
|
// volk_32f_accumulator_s32f_a(&d_CAF_vector[doppler_index], &d_CAF_vector_I[doppler_index-CAF_bins_half], CAF_bins_half + (d_num_doppler_bins-doppler_index));
|
||||||
for (int i = doppler_index - CAF_bins_half; i < d_num_doppler_bins; i++)
|
for (int i = doppler_index - CAF_bins_half; i < static_cast<int>(d_num_doppler_bins); i++)
|
||||||
{
|
{
|
||||||
d_CAF_vector[doppler_index] += d_CAF_vector_I[i] * (1 - weighting_factor * (abs(doppler_index - i)));
|
d_CAF_vector[doppler_index] += d_CAF_vector_I[i] * (1 - weighting_factor * (abs(doppler_index - i)));
|
||||||
}
|
}
|
||||||
@ -709,7 +709,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
|||||||
{
|
{
|
||||||
accum[0] = 0;
|
accum[0] = 0;
|
||||||
// volk_32f_accumulator_s32f_a(&accum[0], &d_CAF_vector_Q[doppler_index-CAF_bins_half], CAF_bins_half + (d_num_doppler_bins-doppler_index));
|
// volk_32f_accumulator_s32f_a(&accum[0], &d_CAF_vector_Q[doppler_index-CAF_bins_half], CAF_bins_half + (d_num_doppler_bins-doppler_index));
|
||||||
for (int i = doppler_index-CAF_bins_half; i < d_num_doppler_bins; i++)
|
for (int i = doppler_index-CAF_bins_half; i < static_cast<int>(d_num_doppler_bins); i++)
|
||||||
{
|
{
|
||||||
accum[0] += d_CAF_vector_Q[i] * (1 - weighting_factor * (abs(doppler_index - i)));
|
accum[0] += d_CAF_vector_Q[i] * (1 - weighting_factor * (abs(doppler_index - i)));
|
||||||
}
|
}
|
||||||
@ -803,6 +803,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output_items.clear(); // removes a warning
|
||||||
return noutput_items;
|
return noutput_items;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -413,5 +413,6 @@ int galileo_pcps_8ms_acquisition_cc::general_work(int noutput_items,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output_items.clear(); // removes a warning
|
||||||
return noutput_items;
|
return noutput_items;
|
||||||
}
|
}
|
||||||
|
@ -265,10 +265,8 @@ int pcps_acquisition_cc::general_work(int noutput_items,
|
|||||||
const gr_complex *in = (const gr_complex *)input_items[0]; //Get the input samples pointer
|
const gr_complex *in = (const gr_complex *)input_items[0]; //Get the input samples pointer
|
||||||
|
|
||||||
int effective_fft_size = ( d_bit_transition_flag ? d_fft_size/2 : d_fft_size );
|
int effective_fft_size = ( d_bit_transition_flag ? d_fft_size/2 : d_fft_size );
|
||||||
size_t offset = ( d_bit_transition_flag ? effective_fft_size : 0 );
|
|
||||||
|
|
||||||
float fft_normalization_factor = static_cast<float>(d_fft_size)
|
float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size);
|
||||||
* static_cast<float>(d_fft_size);
|
|
||||||
|
|
||||||
d_input_power = 0.0;
|
d_input_power = 0.0;
|
||||||
d_mag = 0.0;
|
d_mag = 0.0;
|
||||||
@ -442,7 +440,6 @@ int pcps_acquisition_cc::general_work(int noutput_items,
|
|||||||
|
|
||||||
d_sample_counter += d_fft_size * ninput_items[0]; // sample counter
|
d_sample_counter += d_fft_size * ninput_items[0]; // sample counter
|
||||||
consume_each(ninput_items[0]);
|
consume_each(ninput_items[0]);
|
||||||
|
|
||||||
acquisition_message = 2;
|
acquisition_message = 2;
|
||||||
d_channel_internal_queue->push(acquisition_message);
|
d_channel_internal_queue->push(acquisition_message);
|
||||||
|
|
||||||
@ -450,6 +447,7 @@ int pcps_acquisition_cc::general_work(int noutput_items,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output_items.clear(); // removes a warning
|
||||||
return noutput_items;
|
return noutput_items;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,7 +174,10 @@ void pcps_acquisition_fine_doppler_cc::init()
|
|||||||
void pcps_acquisition_fine_doppler_cc::forecast (int noutput_items,
|
void pcps_acquisition_fine_doppler_cc::forecast (int noutput_items,
|
||||||
gr_vector_int &ninput_items_required)
|
gr_vector_int &ninput_items_required)
|
||||||
{
|
{
|
||||||
ninput_items_required[0] = d_gnuradio_forecast_samples ; //set the required available samples in each call
|
if (noutput_items != 0)
|
||||||
|
{
|
||||||
|
ninput_items_required[0] = d_gnuradio_forecast_samples ; //set the required available samples in each call
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -519,5 +522,6 @@ int pcps_acquisition_fine_doppler_cc::general_work(int noutput_items,
|
|||||||
//DLOG(INFO)<<"d_sample_counter="<<d_sample_counter<<std::endl;
|
//DLOG(INFO)<<"d_sample_counter="<<d_sample_counter<<std::endl;
|
||||||
d_sample_counter += d_fft_size; // sample counter
|
d_sample_counter += d_fft_size; // sample counter
|
||||||
consume_each(d_fft_size);
|
consume_each(d_fft_size);
|
||||||
|
output_items.clear(); // removes a warning
|
||||||
return noutput_items;
|
return noutput_items;
|
||||||
}
|
}
|
||||||
|
@ -173,7 +173,10 @@ void pcps_assisted_acquisition_cc::init()
|
|||||||
void pcps_assisted_acquisition_cc::forecast (int noutput_items,
|
void pcps_assisted_acquisition_cc::forecast (int noutput_items,
|
||||||
gr_vector_int &ninput_items_required)
|
gr_vector_int &ninput_items_required)
|
||||||
{
|
{
|
||||||
ninput_items_required[0] = d_gnuradio_forecast_samples ; //set the required available samples in each call
|
if (noutput_items != 0)
|
||||||
|
{
|
||||||
|
ninput_items_required[0] = d_gnuradio_forecast_samples ; //set the required available samples in each call
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -482,5 +485,6 @@ int pcps_assisted_acquisition_cc::general_work(int noutput_items,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output_items.clear(); // removes a warning
|
||||||
return noutput_items;
|
return noutput_items;
|
||||||
}
|
}
|
||||||
|
@ -438,5 +438,6 @@ int pcps_cccwsr_acquisition_cc::general_work(int noutput_items,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output_items.clear(); // removes a warning
|
||||||
return noutput_items;
|
return noutput_items;
|
||||||
}
|
}
|
||||||
|
@ -466,5 +466,6 @@ int pcps_multithread_acquisition_cc::general_work(int noutput_items,
|
|||||||
|
|
||||||
consume_each(ninput_items[0]);
|
consume_each(ninput_items[0]);
|
||||||
|
|
||||||
|
output_items.clear(); // removes a warning
|
||||||
return noutput_items;
|
return noutput_items;
|
||||||
}
|
}
|
||||||
|
@ -821,5 +821,6 @@ int pcps_opencl_acquisition_cc::general_work(int noutput_items,
|
|||||||
|
|
||||||
consume_each(ninput_items[0]);
|
consume_each(ninput_items[0]);
|
||||||
|
|
||||||
|
output_items.clear(); // removes a warning
|
||||||
return noutput_items;
|
return noutput_items;
|
||||||
}
|
}
|
||||||
|
@ -577,6 +577,6 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//DLOG(INFO) << "END GENERAL WORK";
|
output_items.clear(); // removes a warning
|
||||||
return noutput_items;
|
return noutput_items;
|
||||||
}
|
}
|
||||||
|
@ -432,5 +432,6 @@ int pcps_tong_acquisition_cc::general_work(int noutput_items,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output_items.clear(); // removes a warning
|
||||||
return noutput_items;
|
return noutput_items;
|
||||||
}
|
}
|
||||||
|
@ -67,12 +67,12 @@ galileo_e1_observables_cc::galileo_e1_observables_cc(unsigned int nchannels, boo
|
|||||||
d_dump_filename = dump_filename;
|
d_dump_filename = dump_filename;
|
||||||
d_flag_averaging = flag_averaging;
|
d_flag_averaging = flag_averaging;
|
||||||
|
|
||||||
for (int i=0;i<d_nchannels;i++)
|
for (unsigned int i = 0; i < d_nchannels; i++)
|
||||||
{
|
{
|
||||||
d_acc_carrier_phase_queue_rads.push_back(std::deque<double>(d_nchannels));
|
d_acc_carrier_phase_queue_rads.push_back(std::deque<double>(d_nchannels));
|
||||||
d_carrier_doppler_queue_hz.push_back(std::deque<double>(d_nchannels));
|
d_carrier_doppler_queue_hz.push_back(std::deque<double>(d_nchannels));
|
||||||
d_symbol_TOW_queue_s.push_back(std::deque<double>(d_nchannels));
|
d_symbol_TOW_queue_s.push_back(std::deque<double>(d_nchannels));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ############# ENABLE DATA FILE LOG #################
|
// ############# ENABLE DATA FILE LOG #################
|
||||||
if (d_dump == true)
|
if (d_dump == true)
|
||||||
@ -125,6 +125,10 @@ int galileo_e1_observables_cc::general_work (int noutput_items, gr_vector_int &n
|
|||||||
Gnss_Synchro current_gnss_synchro[d_nchannels];
|
Gnss_Synchro current_gnss_synchro[d_nchannels];
|
||||||
std::map<int,Gnss_Synchro> current_gnss_synchro_map;
|
std::map<int,Gnss_Synchro> current_gnss_synchro_map;
|
||||||
std::map<int,Gnss_Synchro>::iterator gnss_synchro_iter;
|
std::map<int,Gnss_Synchro>::iterator gnss_synchro_iter;
|
||||||
|
if (d_nchannels != ninput_items.size())
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "The Observables block is not well connected";
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 1. Read the GNSS SYNCHRO objects from available channels
|
* 1. Read the GNSS SYNCHRO objects from available channels
|
||||||
@ -214,24 +218,25 @@ int galileo_e1_observables_cc::general_work (int noutput_items, gr_vector_int &n
|
|||||||
if (d_symbol_TOW_queue_s[gnss_synchro_iter->second.Channel_ID].size()>=GPS_L1_CA_HISTORY_DEEP)
|
if (d_symbol_TOW_queue_s[gnss_synchro_iter->second.Channel_ID].size()>=GPS_L1_CA_HISTORY_DEEP)
|
||||||
{
|
{
|
||||||
// compute interpolated observation values for Doppler and Accumulate carrier phase
|
// compute interpolated observation values for Doppler and Accumulate carrier phase
|
||||||
symbol_TOW_vec_s=arma::vec(std::vector<double>(d_symbol_TOW_queue_s[gnss_synchro_iter->second.Channel_ID].begin(), d_symbol_TOW_queue_s[gnss_synchro_iter->second.Channel_ID].end()));
|
symbol_TOW_vec_s = arma::vec(std::vector<double>(d_symbol_TOW_queue_s[gnss_synchro_iter->second.Channel_ID].begin(), d_symbol_TOW_queue_s[gnss_synchro_iter->second.Channel_ID].end()));
|
||||||
acc_phase_vec_rads=arma::vec(std::vector<double>(d_acc_carrier_phase_queue_rads[gnss_synchro_iter->second.Channel_ID].begin(), d_acc_carrier_phase_queue_rads[gnss_synchro_iter->second.Channel_ID].end()));
|
acc_phase_vec_rads = arma::vec(std::vector<double>(d_acc_carrier_phase_queue_rads[gnss_synchro_iter->second.Channel_ID].begin(), d_acc_carrier_phase_queue_rads[gnss_synchro_iter->second.Channel_ID].end()));
|
||||||
dopper_vec_hz=arma::vec(std::vector<double>(d_carrier_doppler_queue_hz[gnss_synchro_iter->second.Channel_ID].begin(), d_carrier_doppler_queue_hz[gnss_synchro_iter->second.Channel_ID].end()));
|
dopper_vec_hz = arma::vec(std::vector<double>(d_carrier_doppler_queue_hz[gnss_synchro_iter->second.Channel_ID].begin(), d_carrier_doppler_queue_hz[gnss_synchro_iter->second.Channel_ID].end()));
|
||||||
desired_symbol_TOW[0]=symbol_TOW_vec_s[GPS_L1_CA_HISTORY_DEEP-1]+delta_rx_time_ms/1000.0;
|
desired_symbol_TOW[0] = symbol_TOW_vec_s[GPS_L1_CA_HISTORY_DEEP - 1] + delta_rx_time_ms / 1000.0;
|
||||||
// Curve fitting to cuadratic function
|
// Curve fitting to cuadratic function
|
||||||
arma::mat A=arma::ones<arma::mat> (GPS_L1_CA_HISTORY_DEEP,2);
|
arma::mat A = arma::ones<arma::mat>(GPS_L1_CA_HISTORY_DEEP, 2);
|
||||||
A.col(1)=symbol_TOW_vec_s;
|
A.col(1) = symbol_TOW_vec_s;
|
||||||
//A.col(2)=symbol_TOW_vec_s % symbol_TOW_vec_s;
|
//A.col(2)=symbol_TOW_vec_s % symbol_TOW_vec_s;
|
||||||
arma::mat coef_acc_phase(1,3);
|
arma::mat coef_acc_phase(1,3);
|
||||||
coef_acc_phase=arma::pinv(A.t()*A)*A.t()*acc_phase_vec_rads;
|
arma::mat pinv_A = arma::pinv(A.t() * A) * A.t();
|
||||||
|
coef_acc_phase = pinv_A * acc_phase_vec_rads;
|
||||||
arma::mat coef_doppler(1,3);
|
arma::mat coef_doppler(1,3);
|
||||||
coef_doppler=arma::pinv(A.t()*A)*A.t()*dopper_vec_hz;
|
coef_doppler = pinv_A * dopper_vec_hz;
|
||||||
arma::vec acc_phase_lin;
|
arma::vec acc_phase_lin;
|
||||||
arma::vec carrier_doppler_lin;
|
arma::vec carrier_doppler_lin;
|
||||||
acc_phase_lin=coef_acc_phase[0]+coef_acc_phase[1]*desired_symbol_TOW[0];//+coef_acc_phase[2]*desired_symbol_TOW[0]*desired_symbol_TOW[0];
|
acc_phase_lin = coef_acc_phase[0] + coef_acc_phase[1] * desired_symbol_TOW[0];//+coef_acc_phase[2]*desired_symbol_TOW[0]*desired_symbol_TOW[0];
|
||||||
carrier_doppler_lin=coef_doppler[0]+coef_doppler[1]*desired_symbol_TOW[0];//+coef_doppler[2]*desired_symbol_TOW[0]*desired_symbol_TOW[0];
|
carrier_doppler_lin = coef_doppler[0] + coef_doppler[1] * desired_symbol_TOW[0];//+coef_doppler[2]*desired_symbol_TOW[0]*desired_symbol_TOW[0];
|
||||||
current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Carrier_phase_rads =acc_phase_lin[0];
|
current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Carrier_phase_rads = acc_phase_lin[0];
|
||||||
current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Carrier_Doppler_hz =carrier_doppler_lin[0];
|
current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Carrier_Doppler_hz = carrier_doppler_lin[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -267,6 +272,10 @@ int galileo_e1_observables_cc::general_work (int noutput_items, gr_vector_int &n
|
|||||||
{
|
{
|
||||||
*out[i] = current_gnss_synchro[i];
|
*out[i] = current_gnss_synchro[i];
|
||||||
}
|
}
|
||||||
return 1; //Output the observables
|
if (noutput_items == 0)
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "noutput_items = 0";
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ gps_l1_ca_observables_cc::gps_l1_ca_observables_cc(unsigned int nchannels, boost
|
|||||||
d_dump_filename = dump_filename;
|
d_dump_filename = dump_filename;
|
||||||
d_flag_averaging = flag_averaging;
|
d_flag_averaging = flag_averaging;
|
||||||
|
|
||||||
for (int i = 0; i < d_nchannels; i++)
|
for (unsigned int i = 0; i < d_nchannels; i++)
|
||||||
{
|
{
|
||||||
d_acc_carrier_phase_queue_rads.push_back(std::deque<double>(d_nchannels));
|
d_acc_carrier_phase_queue_rads.push_back(std::deque<double>(d_nchannels));
|
||||||
d_carrier_doppler_queue_hz.push_back(std::deque<double>(d_nchannels));
|
d_carrier_doppler_queue_hz.push_back(std::deque<double>(d_nchannels));
|
||||||
@ -119,6 +119,11 @@ int gps_l1_ca_observables_cc::general_work (int noutput_items, gr_vector_int &ni
|
|||||||
Gnss_Synchro current_gnss_synchro[d_nchannels];
|
Gnss_Synchro current_gnss_synchro[d_nchannels];
|
||||||
std::map<int,Gnss_Synchro> current_gnss_synchro_map;
|
std::map<int,Gnss_Synchro> current_gnss_synchro_map;
|
||||||
std::map<int,Gnss_Synchro>::iterator gnss_synchro_iter;
|
std::map<int,Gnss_Synchro>::iterator gnss_synchro_iter;
|
||||||
|
|
||||||
|
if (d_nchannels != ninput_items.size())
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "The Observables block is not well connected";
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 1. Read the GNSS SYNCHRO objects from available channels
|
* 1. Read the GNSS SYNCHRO objects from available channels
|
||||||
@ -229,9 +234,10 @@ int gps_l1_ca_observables_cc::general_work (int noutput_items, gr_vector_int &ni
|
|||||||
A.col(1) = symbol_TOW_vec_s;
|
A.col(1) = symbol_TOW_vec_s;
|
||||||
//A.col(2)=symbol_TOW_vec_s % symbol_TOW_vec_s;
|
//A.col(2)=symbol_TOW_vec_s % symbol_TOW_vec_s;
|
||||||
arma::mat coef_acc_phase(1,3);
|
arma::mat coef_acc_phase(1,3);
|
||||||
coef_acc_phase = arma::pinv(A.t() * A) * A.t() * acc_phase_vec_rads;
|
arma::mat pinv_A = arma::pinv(A.t() * A) * A.t();
|
||||||
|
coef_acc_phase = pinv_A * acc_phase_vec_rads;
|
||||||
arma::mat coef_doppler(1,3);
|
arma::mat coef_doppler(1,3);
|
||||||
coef_doppler = arma::pinv(A.t() * A) * A.t() * dopper_vec_hz;
|
coef_doppler = pinv_A * dopper_vec_hz;
|
||||||
arma::vec acc_phase_lin;
|
arma::vec acc_phase_lin;
|
||||||
arma::vec carrier_doppler_lin;
|
arma::vec carrier_doppler_lin;
|
||||||
acc_phase_lin = coef_acc_phase[0] + coef_acc_phase[1] * desired_symbol_TOW[0];//+coef_acc_phase[2]*desired_symbol_TOW[0]*desired_symbol_TOW[0];
|
acc_phase_lin = coef_acc_phase[0] + coef_acc_phase[1] * desired_symbol_TOW[0];//+coef_acc_phase[2]*desired_symbol_TOW[0]*desired_symbol_TOW[0];
|
||||||
@ -281,6 +287,10 @@ int gps_l1_ca_observables_cc::general_work (int noutput_items, gr_vector_int &ni
|
|||||||
{
|
{
|
||||||
*out[i] = current_gnss_synchro[i];
|
*out[i] = current_gnss_synchro[i];
|
||||||
}
|
}
|
||||||
return 1; // Output the observables
|
if (noutput_items == 0)
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "noutput_items = 0";
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,6 +121,11 @@ int hybrid_observables_cc::general_work (int noutput_items, gr_vector_int &ninpu
|
|||||||
std::map<int,Gnss_Synchro> current_gnss_synchro_map_gps_only;
|
std::map<int,Gnss_Synchro> current_gnss_synchro_map_gps_only;
|
||||||
std::map<int,Gnss_Synchro>::iterator gnss_synchro_iter;
|
std::map<int,Gnss_Synchro>::iterator gnss_synchro_iter;
|
||||||
|
|
||||||
|
if (d_nchannels != ninput_items.size())
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "The Observables block is not well connected";
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 1. Read the GNSS SYNCHRO objects from available channels
|
* 1. Read the GNSS SYNCHRO objects from available channels
|
||||||
*/
|
*/
|
||||||
@ -228,7 +233,11 @@ int hybrid_observables_cc::general_work (int noutput_items, gr_vector_int &ninpu
|
|||||||
{
|
{
|
||||||
*out[i] = current_gnss_synchro[i];
|
*out[i] = current_gnss_synchro[i];
|
||||||
}
|
}
|
||||||
//todo: enable output when the hybrid algorithm is completed
|
|
||||||
return 1; //Output the observables
|
if (noutput_items == 0)
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "noutput_items = 0";
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,6 +112,11 @@ int mixed_observables_cc::general_work (int noutput_items, gr_vector_int &ninput
|
|||||||
std::map<int,Gnss_Synchro> current_gnss_synchro_map;
|
std::map<int,Gnss_Synchro> current_gnss_synchro_map;
|
||||||
std::map<int,Gnss_Synchro>::iterator gnss_synchro_iter;
|
std::map<int,Gnss_Synchro>::iterator gnss_synchro_iter;
|
||||||
|
|
||||||
|
if (d_nchannels != ninput_items.size())
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "The Observables block is not well connected";
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 1. Read the GNSS SYNCHRO objects from available channels
|
* 1. Read the GNSS SYNCHRO objects from available channels
|
||||||
*/
|
*/
|
||||||
@ -207,6 +212,10 @@ int mixed_observables_cc::general_work (int noutput_items, gr_vector_int &ninput
|
|||||||
{
|
{
|
||||||
*out[i] = current_gnss_synchro[i];
|
*out[i] = current_gnss_synchro[i];
|
||||||
}
|
}
|
||||||
return 1; // Output the observables
|
if (noutput_items == 0)
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "noutput_items = 0";
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -329,8 +329,8 @@ gr_vector_void_star &output_items)
|
|||||||
// New random data bit
|
// New random data bit
|
||||||
current_data_bit_int_[sat] = (rand()%2) == 0 ? 1 : -1;
|
current_data_bit_int_[sat] = (rand()%2) == 0 ? 1 : -1;
|
||||||
}
|
}
|
||||||
data_modulation_[sat] = current_data_bit_int_[sat] * (Galileo_E5a_I_SECONDARY_CODE.at((ms_counter_[sat]+delay_sec_[sat])%20)=='0' ? 1 : -1);
|
data_modulation_[sat] = current_data_bit_int_[sat] * (Galileo_E5a_I_SECONDARY_CODE.at((ms_counter_[sat]+delay_sec_[sat]) % 20) == '0' ? 1 : -1);
|
||||||
pilot_modulation_[sat] = (Galileo_E5a_Q_SECONDARY_CODE[PRN_[sat] - 1].at((ms_counter_[sat] + delay_sec_[sat]) % 100)=='0' ? 1 : -1);
|
pilot_modulation_[sat] = (Galileo_E5a_Q_SECONDARY_CODE[PRN_[sat] - 1].at((ms_counter_[sat] + delay_sec_[sat]) % 100) == '0' ? 1 : -1);
|
||||||
|
|
||||||
ms_counter_[sat] = ms_counter_[sat] + static_cast<int>(round(1e3*GALILEO_E5a_CODE_PERIOD));
|
ms_counter_[sat] = ms_counter_[sat] + static_cast<int>(round(1e3*GALILEO_E5a_CODE_PERIOD));
|
||||||
|
|
||||||
@ -384,6 +384,11 @@ gr_vector_void_star &output_items)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if((noutput_items == 0) || (ninput_items.size() != 0) || input_items[0] == 0)
|
||||||
|
{
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
|
||||||
// Tell runtime system how many output items we produced.
|
// Tell runtime system how many output items we produced.
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -160,7 +160,7 @@ int unpack_2bit_samples::work(int noutput_items,
|
|||||||
{
|
{
|
||||||
if( swap_endian_bytes_ )
|
if( swap_endian_bytes_ )
|
||||||
{
|
{
|
||||||
for(int i = 0; i < ninput_bytes; ++i)
|
for(unsigned int i = 0; i < ninput_bytes; ++i)
|
||||||
{
|
{
|
||||||
// Read packed input sample (1 byte = 4 samples)
|
// Read packed input sample (1 byte = 4 samples)
|
||||||
raw_byte.byte = in[i];
|
raw_byte.byte = in[i];
|
||||||
@ -174,7 +174,7 @@ int unpack_2bit_samples::work(int noutput_items,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for( int i = 0; i < ninput_bytes; ++i )
|
for(unsigned int i = 0; i < ninput_bytes; ++i )
|
||||||
{
|
{
|
||||||
|
|
||||||
// Read packed input sample (1 byte = 4 samples)
|
// Read packed input sample (1 byte = 4 samples)
|
||||||
@ -192,7 +192,7 @@ int unpack_2bit_samples::work(int noutput_items,
|
|||||||
|
|
||||||
if( swap_endian_bytes_ )
|
if( swap_endian_bytes_ )
|
||||||
{
|
{
|
||||||
for(int i = 0; i < ninput_bytes; ++i)
|
for(unsigned int i = 0; i < ninput_bytes; ++i)
|
||||||
{
|
{
|
||||||
// Read packed input sample (1 byte = 4 samples)
|
// Read packed input sample (1 byte = 4 samples)
|
||||||
raw_byte.byte = in[i];
|
raw_byte.byte = in[i];
|
||||||
@ -206,7 +206,7 @@ int unpack_2bit_samples::work(int noutput_items,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for( int i = 0; i < ninput_bytes; ++i )
|
for(unsigned int i = 0; i < ninput_bytes; ++i )
|
||||||
{
|
{
|
||||||
|
|
||||||
// Read packed input sample (1 byte = 4 samples)
|
// Read packed input sample (1 byte = 4 samples)
|
||||||
|
@ -62,14 +62,10 @@ GalileoE1BTelemetryDecoder::GalileoE1BTelemetryDecoder(ConfigurationInterface* c
|
|||||||
std::string default_item_type = "gr_complex";
|
std::string default_item_type = "gr_complex";
|
||||||
std::string default_dump_filename = "./navigation.dat";
|
std::string default_dump_filename = "./navigation.dat";
|
||||||
DLOG(INFO) << "role " << role;
|
DLOG(INFO) << "role " << role;
|
||||||
DLOG(INFO) << "vector length " << vector_length_;
|
|
||||||
vector_length_ = configuration->property(role + ".vector_length", 2048);
|
|
||||||
dump_ = configuration->property(role + ".dump", false);
|
dump_ = configuration->property(role + ".dump", false);
|
||||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
|
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
|
||||||
int fs_in;
|
|
||||||
fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
|
||||||
// make telemetry decoder object
|
// make telemetry decoder object
|
||||||
telemetry_decoder_ = galileo_e1b_make_telemetry_decoder_cc(satellite_, 0, (long)fs_in, vector_length_, queue_, dump_); // TODO fix me
|
telemetry_decoder_ = galileo_e1b_make_telemetry_decoder_cc(satellite_, queue_, dump_); // TODO fix me
|
||||||
DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")";
|
DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")";
|
||||||
// set the navigation msg queue;
|
// set the navigation msg queue;
|
||||||
telemetry_decoder_->set_ephemeris_queue(&global_galileo_ephemeris_queue);
|
telemetry_decoder_->set_ephemeris_queue(&global_galileo_ephemeris_queue);
|
||||||
|
@ -66,14 +66,10 @@ GalileoE5aTelemetryDecoder::GalileoE5aTelemetryDecoder(ConfigurationInterface* c
|
|||||||
std::string default_item_type = "gr_complex";
|
std::string default_item_type = "gr_complex";
|
||||||
std::string default_dump_filename = "./navigation.dat";
|
std::string default_dump_filename = "./navigation.dat";
|
||||||
DLOG(INFO) << "role " << role;
|
DLOG(INFO) << "role " << role;
|
||||||
DLOG(INFO) << "vector length " << vector_length_;
|
|
||||||
vector_length_ = configuration->property(role + ".vector_length", 2048);
|
|
||||||
dump_ = configuration->property(role + ".dump", false);
|
dump_ = configuration->property(role + ".dump", false);
|
||||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
|
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
|
||||||
int fs_in;
|
|
||||||
fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
|
||||||
// make telemetry decoder object
|
// make telemetry decoder object
|
||||||
telemetry_decoder_ = galileo_e5a_make_telemetry_decoder_cc(satellite_, 0, (long)fs_in, vector_length_, queue_, dump_); // TODO fix me
|
telemetry_decoder_ = galileo_e5a_make_telemetry_decoder_cc(satellite_, queue_, dump_); // TODO fix me
|
||||||
DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")";
|
DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")";
|
||||||
// set the navigation msg queue;
|
// set the navigation msg queue;
|
||||||
telemetry_decoder_->set_ephemeris_queue(&global_galileo_ephemeris_queue);
|
telemetry_decoder_->set_ephemeris_queue(&global_galileo_ephemeris_queue);
|
||||||
|
@ -89,7 +89,6 @@ private:
|
|||||||
galileo_e5a_telemetry_decoder_cc_sptr telemetry_decoder_;
|
galileo_e5a_telemetry_decoder_cc_sptr telemetry_decoder_;
|
||||||
Gnss_Satellite satellite_;
|
Gnss_Satellite satellite_;
|
||||||
int channel_;
|
int channel_;
|
||||||
unsigned int vector_length_;
|
|
||||||
std::string item_type_;
|
std::string item_type_;
|
||||||
bool dump_;
|
bool dump_;
|
||||||
std::string dump_filename_;
|
std::string dump_filename_;
|
||||||
|
@ -61,14 +61,10 @@ GpsL1CaTelemetryDecoder::GpsL1CaTelemetryDecoder(ConfigurationInterface* configu
|
|||||||
std::string default_item_type = "gr_complex";
|
std::string default_item_type = "gr_complex";
|
||||||
std::string default_dump_filename = "./navigation.dat";
|
std::string default_dump_filename = "./navigation.dat";
|
||||||
DLOG(INFO) << "role " << role;
|
DLOG(INFO) << "role " << role;
|
||||||
DLOG(INFO) << "vector length " << vector_length_;
|
|
||||||
vector_length_ = configuration->property(role + ".vector_length", 2048);
|
|
||||||
dump_ = configuration->property(role + ".dump", false);
|
dump_ = configuration->property(role + ".dump", false);
|
||||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
|
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
|
||||||
int fs_in;
|
|
||||||
fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
|
||||||
// make telemetry decoder object
|
// make telemetry decoder object
|
||||||
telemetry_decoder_ = gps_l1_ca_make_telemetry_decoder_cc(satellite_, 0, (long)fs_in, vector_length_, queue_, dump_); // TODO fix me
|
telemetry_decoder_ = gps_l1_ca_make_telemetry_decoder_cc(satellite_, queue_, dump_); // TODO fix me
|
||||||
DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")";
|
DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")";
|
||||||
// set the navigation msg queue;
|
// set the navigation msg queue;
|
||||||
telemetry_decoder_->set_ephemeris_queue(&global_gps_ephemeris_queue);
|
telemetry_decoder_->set_ephemeris_queue(&global_gps_ephemeris_queue);
|
||||||
|
@ -61,14 +61,10 @@ GpsL2MTelemetryDecoder::GpsL2MTelemetryDecoder(ConfigurationInterface* configura
|
|||||||
std::string default_item_type = "gr_complex";
|
std::string default_item_type = "gr_complex";
|
||||||
std::string default_dump_filename = "./navigation.dat";
|
std::string default_dump_filename = "./navigation.dat";
|
||||||
DLOG(INFO) << "role " << role;
|
DLOG(INFO) << "role " << role;
|
||||||
DLOG(INFO) << "vector length " << vector_length_;
|
|
||||||
vector_length_ = configuration->property(role + ".vector_length", 2048);
|
|
||||||
dump_ = configuration->property(role + ".dump", false);
|
dump_ = configuration->property(role + ".dump", false);
|
||||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
|
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
|
||||||
int fs_in;
|
|
||||||
fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
|
||||||
// make telemetry decoder object
|
// make telemetry decoder object
|
||||||
telemetry_decoder_ = gps_l2_m_make_telemetry_decoder_cc(satellite_, 0, (long)fs_in, vector_length_, queue_, dump_); // TODO fix me
|
telemetry_decoder_ = gps_l2_m_make_telemetry_decoder_cc(satellite_, queue_, dump_); // TODO fix me
|
||||||
DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")";
|
DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")";
|
||||||
// set the navigation msg queue;
|
// set the navigation msg queue;
|
||||||
telemetry_decoder_->set_ephemeris_queue(&global_gps_cnav_ephemeris_queue);
|
telemetry_decoder_->set_ephemeris_queue(&global_gps_cnav_ephemeris_queue);
|
||||||
|
@ -61,14 +61,10 @@ SbasL1TelemetryDecoder::SbasL1TelemetryDecoder(ConfigurationInterface* configura
|
|||||||
std::string default_item_type = "gr_complex";
|
std::string default_item_type = "gr_complex";
|
||||||
std::string default_dump_filename = "./navigation.dat";
|
std::string default_dump_filename = "./navigation.dat";
|
||||||
DLOG(INFO) << "role " << role;
|
DLOG(INFO) << "role " << role;
|
||||||
DLOG(INFO) << "vector length " << vector_length_;
|
|
||||||
vector_length_ = configuration->property(role + ".vector_length", 2048);
|
|
||||||
dump_ = configuration->property(role + ".dump", false);
|
dump_ = configuration->property(role + ".dump", false);
|
||||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
|
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
|
||||||
int fs_in;
|
|
||||||
fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
|
||||||
// make telemetry decoder object
|
// make telemetry decoder object
|
||||||
telemetry_decoder_ = sbas_l1_make_telemetry_decoder_cc(satellite_, 0, (long)fs_in, vector_length_, queue_, dump_); // TODO fix me
|
telemetry_decoder_ = sbas_l1_make_telemetry_decoder_cc(satellite_, queue_, dump_); // TODO fix me
|
||||||
channel_ = 0;
|
channel_ = 0;
|
||||||
DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")";
|
DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")";
|
||||||
// set the queues;
|
// set the queues;
|
||||||
|
@ -50,18 +50,19 @@ using google::LogMessage;
|
|||||||
|
|
||||||
|
|
||||||
galileo_e1b_telemetry_decoder_cc_sptr
|
galileo_e1b_telemetry_decoder_cc_sptr
|
||||||
galileo_e1b_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
|
galileo_e1b_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump)
|
||||||
int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump)
|
|
||||||
{
|
{
|
||||||
return galileo_e1b_telemetry_decoder_cc_sptr(new galileo_e1b_telemetry_decoder_cc(satellite, if_freq,
|
return galileo_e1b_telemetry_decoder_cc_sptr(new galileo_e1b_telemetry_decoder_cc(satellite, queue, dump));
|
||||||
fs_in, vector_length, queue, dump));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void galileo_e1b_telemetry_decoder_cc::forecast (int noutput_items, gr_vector_int &ninput_items_required)
|
void galileo_e1b_telemetry_decoder_cc::forecast (int noutput_items, gr_vector_int &ninput_items_required)
|
||||||
{
|
{
|
||||||
ninput_items_required[0] = GALILEO_INAV_PAGE_SYMBOLS; // set the required sample history
|
if(noutput_items != 0)
|
||||||
|
{
|
||||||
|
ninput_items_required[0] = GALILEO_INAV_PAGE_SYMBOLS; // set the required sample history
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -116,10 +117,6 @@ void galileo_e1b_telemetry_decoder_cc::deinterleaver(int rows, int cols, double
|
|||||||
|
|
||||||
galileo_e1b_telemetry_decoder_cc::galileo_e1b_telemetry_decoder_cc(
|
galileo_e1b_telemetry_decoder_cc::galileo_e1b_telemetry_decoder_cc(
|
||||||
Gnss_Satellite satellite,
|
Gnss_Satellite satellite,
|
||||||
long if_freq,
|
|
||||||
long fs_in,
|
|
||||||
unsigned
|
|
||||||
int vector_length,
|
|
||||||
boost::shared_ptr<gr::msg_queue> queue,
|
boost::shared_ptr<gr::msg_queue> queue,
|
||||||
bool dump) :
|
bool dump) :
|
||||||
gr::block("galileo_e1b_telemetry_decoder_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)),
|
gr::block("galileo_e1b_telemetry_decoder_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)),
|
||||||
@ -130,9 +127,7 @@ galileo_e1b_telemetry_decoder_cc::galileo_e1b_telemetry_decoder_cc(
|
|||||||
d_dump = dump;
|
d_dump = dump;
|
||||||
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
||||||
LOG(INFO) << "Initializing GALILEO E1B TELEMETRY PROCESSING";
|
LOG(INFO) << "Initializing GALILEO E1B TELEMETRY PROCESSING";
|
||||||
d_vector_length = vector_length;
|
|
||||||
d_samples_per_symbol = ( Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS ) / Galileo_E1_B_SYMBOL_RATE_BPS;
|
d_samples_per_symbol = ( Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS ) / Galileo_E1_B_SYMBOL_RATE_BPS;
|
||||||
d_fs_in = fs_in;
|
|
||||||
|
|
||||||
// set the preamble
|
// set the preamble
|
||||||
unsigned short int preambles_bits[GALILEO_INAV_PREAMBLE_LENGTH_BITS] = GALILEO_INAV_PREAMBLE;
|
unsigned short int preambles_bits[GALILEO_INAV_PREAMBLE_LENGTH_BITS] = GALILEO_INAV_PREAMBLE;
|
||||||
@ -499,6 +494,10 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items, gr_vector
|
|||||||
}
|
}
|
||||||
//todo: implement averaging
|
//todo: implement averaging
|
||||||
d_average_count++;
|
d_average_count++;
|
||||||
|
if((noutput_items == 0) || (ninput_items[0] == 0))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "noutput_items = 0";
|
||||||
|
}
|
||||||
if (d_average_count == d_decimation_output_factor)
|
if (d_average_count == d_decimation_output_factor)
|
||||||
{
|
{
|
||||||
d_average_count = 0;
|
d_average_count = 0;
|
||||||
|
@ -54,8 +54,7 @@ class galileo_e1b_telemetry_decoder_cc;
|
|||||||
|
|
||||||
typedef boost::shared_ptr<galileo_e1b_telemetry_decoder_cc> galileo_e1b_telemetry_decoder_cc_sptr;
|
typedef boost::shared_ptr<galileo_e1b_telemetry_decoder_cc> galileo_e1b_telemetry_decoder_cc_sptr;
|
||||||
|
|
||||||
galileo_e1b_telemetry_decoder_cc_sptr galileo_e1b_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
|
galileo_e1b_telemetry_decoder_cc_sptr galileo_e1b_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
||||||
int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief This class implements a block that decodes the INAV data defined in Galileo ICD
|
* \brief This class implements a block that decodes the INAV data defined in Galileo ICD
|
||||||
@ -92,10 +91,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
friend galileo_e1b_telemetry_decoder_cc_sptr
|
friend galileo_e1b_telemetry_decoder_cc_sptr
|
||||||
galileo_e1b_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in,unsigned
|
galileo_e1b_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
||||||
int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
galileo_e1b_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
||||||
galileo_e1b_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
|
|
||||||
int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
|
||||||
|
|
||||||
void viterbi_decoder(double *page_part_symbols, int *page_part_bits);
|
void viterbi_decoder(double *page_part_symbols, int *page_part_bits);
|
||||||
|
|
||||||
@ -105,7 +102,7 @@ private:
|
|||||||
|
|
||||||
unsigned short int d_preambles_bits[GALILEO_INAV_PREAMBLE_LENGTH_BITS];
|
unsigned short int d_preambles_bits[GALILEO_INAV_PREAMBLE_LENGTH_BITS];
|
||||||
|
|
||||||
signed int *d_preambles_symbols;
|
int *d_preambles_symbols;
|
||||||
unsigned int d_samples_per_symbol;
|
unsigned int d_samples_per_symbol;
|
||||||
int d_symbols_per_preamble;
|
int d_symbols_per_preamble;
|
||||||
|
|
||||||
@ -118,8 +115,6 @@ private:
|
|||||||
bool d_flag_preamble;
|
bool d_flag_preamble;
|
||||||
int d_CRC_error_counter;
|
int d_CRC_error_counter;
|
||||||
|
|
||||||
long d_fs_in;
|
|
||||||
|
|
||||||
// navigation message vars
|
// navigation message vars
|
||||||
Galileo_Navigation_Message d_nav;
|
Galileo_Navigation_Message d_nav;
|
||||||
|
|
||||||
@ -133,7 +128,6 @@ private:
|
|||||||
concurrent_queue<Galileo_Almanac> *d_almanac_queue;
|
concurrent_queue<Galileo_Almanac> *d_almanac_queue;
|
||||||
|
|
||||||
boost::shared_ptr<gr::msg_queue> d_queue;
|
boost::shared_ptr<gr::msg_queue> d_queue;
|
||||||
unsigned int d_vector_length;
|
|
||||||
bool d_dump;
|
bool d_dump;
|
||||||
Gnss_Satellite d_satellite;
|
Gnss_Satellite d_satellite;
|
||||||
int d_channel;
|
int d_channel;
|
||||||
@ -151,7 +145,6 @@ private:
|
|||||||
bool flag_TOW_set;
|
bool flag_TOW_set;
|
||||||
double delta_t; //GPS-GALILEO time offset
|
double delta_t; //GPS-GALILEO time offset
|
||||||
|
|
||||||
|
|
||||||
std::string d_dump_filename;
|
std::string d_dump_filename;
|
||||||
std::ofstream d_dump_file;
|
std::ofstream d_dump_file;
|
||||||
};
|
};
|
||||||
|
@ -55,17 +55,18 @@ using google::LogMessage;
|
|||||||
|
|
||||||
|
|
||||||
galileo_e5a_telemetry_decoder_cc_sptr
|
galileo_e5a_telemetry_decoder_cc_sptr
|
||||||
galileo_e5a_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
|
galileo_e5a_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump)
|
||||||
int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump)
|
|
||||||
{
|
{
|
||||||
return galileo_e5a_telemetry_decoder_cc_sptr(new galileo_e5a_telemetry_decoder_cc(satellite, if_freq,
|
return galileo_e5a_telemetry_decoder_cc_sptr(new galileo_e5a_telemetry_decoder_cc(satellite, queue, dump));
|
||||||
fs_in, vector_length, queue, dump));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void galileo_e5a_telemetry_decoder_cc::forecast (int noutput_items, gr_vector_int &ninput_items_required)
|
void galileo_e5a_telemetry_decoder_cc::forecast (int noutput_items, gr_vector_int &ninput_items_required)
|
||||||
{
|
{
|
||||||
//ninput_items_required[0] = GALILEO_FNAV_SAMPLES_PER_PAGE; // set the required sample history
|
//ninput_items_required[0] = GALILEO_FNAV_SAMPLES_PER_PAGE; // set the required sample history
|
||||||
ninput_items_required[0] = GALILEO_FNAV_CODES_PER_PREAMBLE;
|
if (noutput_items != 0)
|
||||||
|
{
|
||||||
|
ninput_items_required[0] = GALILEO_FNAV_CODES_PER_PREAMBLE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void galileo_e5a_telemetry_decoder_cc::viterbi_decoder(double *page_part_symbols, int *page_part_bits)
|
void galileo_e5a_telemetry_decoder_cc::viterbi_decoder(double *page_part_symbols, int *page_part_bits)
|
||||||
@ -192,10 +193,6 @@ void galileo_e5a_telemetry_decoder_cc::decode_word(double *page_symbols,int fram
|
|||||||
|
|
||||||
galileo_e5a_telemetry_decoder_cc::galileo_e5a_telemetry_decoder_cc(
|
galileo_e5a_telemetry_decoder_cc::galileo_e5a_telemetry_decoder_cc(
|
||||||
Gnss_Satellite satellite,
|
Gnss_Satellite satellite,
|
||||||
long if_freq,
|
|
||||||
long fs_in,
|
|
||||||
unsigned
|
|
||||||
int vector_length,
|
|
||||||
boost::shared_ptr<gr::msg_queue> queue,
|
boost::shared_ptr<gr::msg_queue> queue,
|
||||||
bool dump) :
|
bool dump) :
|
||||||
gr::block("galileo_e5a_telemetry_decoder_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)),
|
gr::block("galileo_e5a_telemetry_decoder_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)),
|
||||||
@ -206,9 +203,7 @@ galileo_e5a_telemetry_decoder_cc::galileo_e5a_telemetry_decoder_cc(
|
|||||||
d_dump = dump;
|
d_dump = dump;
|
||||||
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
||||||
LOG(INFO) << "GALILEO E5A TELEMETRY PROCESSING: satellite " << d_satellite;
|
LOG(INFO) << "GALILEO E5A TELEMETRY PROCESSING: satellite " << d_satellite;
|
||||||
d_vector_length = vector_length;
|
|
||||||
//d_samples_per_symbol = ( Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS ) / Galileo_E1_B_SYMBOL_RATE_BPS;
|
//d_samples_per_symbol = ( Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS ) / Galileo_E1_B_SYMBOL_RATE_BPS;
|
||||||
d_fs_in = fs_in;
|
|
||||||
|
|
||||||
// set the preamble
|
// set the preamble
|
||||||
//unsigned short int preambles_bits[GALILEO_FNAV_PREAMBLE_LENGTH_BITS] = GALILEO_FNAV_PREAMBLE;
|
//unsigned short int preambles_bits[GALILEO_FNAV_PREAMBLE_LENGTH_BITS] = GALILEO_FNAV_PREAMBLE;
|
||||||
@ -585,6 +580,10 @@ int galileo_e5a_telemetry_decoder_cc::general_work (int noutput_items, gr_vector
|
|||||||
d_sample_counter++; //count for the processed samples
|
d_sample_counter++; //count for the processed samples
|
||||||
//3. Make the output (copy the object contents to the GNURadio reserved memory)
|
//3. Make the output (copy the object contents to the GNURadio reserved memory)
|
||||||
*out[0] = current_synchro_data;
|
*out[0] = current_synchro_data;
|
||||||
|
if((noutput_items == 0) || (ninput_items[0] == 0))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "noutput_items = 0";
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,8 +58,7 @@ class galileo_e5a_telemetry_decoder_cc;
|
|||||||
|
|
||||||
typedef boost::shared_ptr<galileo_e5a_telemetry_decoder_cc> galileo_e5a_telemetry_decoder_cc_sptr;
|
typedef boost::shared_ptr<galileo_e5a_telemetry_decoder_cc> galileo_e5a_telemetry_decoder_cc_sptr;
|
||||||
|
|
||||||
galileo_e5a_telemetry_decoder_cc_sptr galileo_e5a_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
|
galileo_e5a_telemetry_decoder_cc_sptr galileo_e5a_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
||||||
int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -90,10 +89,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
friend galileo_e5a_telemetry_decoder_cc_sptr
|
friend galileo_e5a_telemetry_decoder_cc_sptr
|
||||||
galileo_e5a_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in,unsigned
|
galileo_e5a_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
||||||
int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
galileo_e5a_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
||||||
galileo_e5a_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
|
|
||||||
int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
|
||||||
|
|
||||||
void viterbi_decoder(double *page_part_symbols, int *page_part_bits);
|
void viterbi_decoder(double *page_part_symbols, int *page_part_bits);
|
||||||
|
|
||||||
@ -101,10 +98,10 @@ private:
|
|||||||
|
|
||||||
void decode_word(double *page_symbols,int frame_length);
|
void decode_word(double *page_symbols,int frame_length);
|
||||||
|
|
||||||
signed int d_preamble_bits[GALILEO_FNAV_PREAMBLE_LENGTH_BITS];
|
int d_preamble_bits[GALILEO_FNAV_PREAMBLE_LENGTH_BITS];
|
||||||
// signed int d_page_symbols[GALILEO_FNAV_SYMBOLS_PER_PAGE + GALILEO_FNAV_PREAMBLE_LENGTH_BITS];
|
// signed int d_page_symbols[GALILEO_FNAV_SYMBOLS_PER_PAGE + GALILEO_FNAV_PREAMBLE_LENGTH_BITS];
|
||||||
double d_page_symbols[GALILEO_FNAV_SYMBOLS_PER_PAGE + GALILEO_FNAV_PREAMBLE_LENGTH_BITS];
|
double d_page_symbols[GALILEO_FNAV_SYMBOLS_PER_PAGE + GALILEO_FNAV_PREAMBLE_LENGTH_BITS];
|
||||||
// signed int *d_preamble_symbols;
|
// signed int *d_preamble_symbols;
|
||||||
double d_current_symbol;
|
double d_current_symbol;
|
||||||
long unsigned int d_symbol_counter;
|
long unsigned int d_symbol_counter;
|
||||||
int d_prompt_counter;
|
int d_prompt_counter;
|
||||||
@ -120,8 +117,6 @@ private:
|
|||||||
bool d_flag_preamble;
|
bool d_flag_preamble;
|
||||||
int d_CRC_error_counter;
|
int d_CRC_error_counter;
|
||||||
|
|
||||||
long d_fs_in;
|
|
||||||
|
|
||||||
// navigation message vars
|
// navigation message vars
|
||||||
Galileo_Fnav_Message d_nav;
|
Galileo_Fnav_Message d_nav;
|
||||||
|
|
||||||
@ -135,7 +130,6 @@ private:
|
|||||||
concurrent_queue<Galileo_Almanac> *d_almanac_queue;
|
concurrent_queue<Galileo_Almanac> *d_almanac_queue;
|
||||||
|
|
||||||
boost::shared_ptr<gr::msg_queue> d_queue;
|
boost::shared_ptr<gr::msg_queue> d_queue;
|
||||||
unsigned int d_vector_length;
|
|
||||||
bool d_dump;
|
bool d_dump;
|
||||||
Gnss_Satellite d_satellite;
|
Gnss_Satellite d_satellite;
|
||||||
int d_channel;
|
int d_channel;
|
||||||
|
@ -52,20 +52,21 @@ using google::LogMessage;
|
|||||||
* \todo name and move the magic numbers to GPS_L1_CA.h
|
* \todo name and move the magic numbers to GPS_L1_CA.h
|
||||||
*/
|
*/
|
||||||
gps_l1_ca_telemetry_decoder_cc_sptr
|
gps_l1_ca_telemetry_decoder_cc_sptr
|
||||||
gps_l1_ca_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
|
gps_l1_ca_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump)
|
||||||
int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump)
|
|
||||||
{
|
{
|
||||||
return gps_l1_ca_telemetry_decoder_cc_sptr(new gps_l1_ca_telemetry_decoder_cc(satellite, if_freq,
|
return gps_l1_ca_telemetry_decoder_cc_sptr(new gps_l1_ca_telemetry_decoder_cc(satellite, queue, dump));
|
||||||
fs_in, vector_length, queue, dump));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void gps_l1_ca_telemetry_decoder_cc::forecast (int noutput_items, gr_vector_int &ninput_items_required)
|
void gps_l1_ca_telemetry_decoder_cc::forecast (int noutput_items, gr_vector_int &ninput_items_required)
|
||||||
{
|
{
|
||||||
for (unsigned i = 0; i < 3; i++)
|
if (noutput_items != 0)
|
||||||
{
|
{
|
||||||
ninput_items_required[i] = d_samples_per_bit * 8; //set the required sample history
|
for (unsigned i = 0; i < 3; i++)
|
||||||
|
{
|
||||||
|
ninput_items_required[i] = d_samples_per_bit * 8; //set the required sample history
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,10 +74,6 @@ void gps_l1_ca_telemetry_decoder_cc::forecast (int noutput_items, gr_vector_int
|
|||||||
|
|
||||||
gps_l1_ca_telemetry_decoder_cc::gps_l1_ca_telemetry_decoder_cc(
|
gps_l1_ca_telemetry_decoder_cc::gps_l1_ca_telemetry_decoder_cc(
|
||||||
Gnss_Satellite satellite,
|
Gnss_Satellite satellite,
|
||||||
long if_freq,
|
|
||||||
long fs_in,
|
|
||||||
unsigned
|
|
||||||
int vector_length,
|
|
||||||
boost::shared_ptr<gr::msg_queue> queue,
|
boost::shared_ptr<gr::msg_queue> queue,
|
||||||
bool dump) :
|
bool dump) :
|
||||||
gr::block("gps_navigation_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)),
|
gr::block("gps_navigation_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)),
|
||||||
@ -86,9 +83,7 @@ gps_l1_ca_telemetry_decoder_cc::gps_l1_ca_telemetry_decoder_cc(
|
|||||||
d_queue = queue;
|
d_queue = queue;
|
||||||
d_dump = dump;
|
d_dump = dump;
|
||||||
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
||||||
d_vector_length = vector_length;
|
|
||||||
d_samples_per_bit = ( GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS ) / GPS_CA_TELEMETRY_RATE_BITS_SECOND;
|
d_samples_per_bit = ( GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS ) / GPS_CA_TELEMETRY_RATE_BITS_SECOND;
|
||||||
d_fs_in = fs_in;
|
|
||||||
//d_preamble_duration_seconds = (1.0 / GPS_CA_TELEMETRY_RATE_BITS_SECOND) * GPS_CA_PREAMBLE_LENGTH_BITS;
|
//d_preamble_duration_seconds = (1.0 / GPS_CA_TELEMETRY_RATE_BITS_SECOND) * GPS_CA_PREAMBLE_LENGTH_BITS;
|
||||||
//std::cout<<"d_preamble_duration_seconds="<<d_preamble_duration_seconds<<"\r\n";
|
//std::cout<<"d_preamble_duration_seconds="<<d_preamble_duration_seconds<<"\r\n";
|
||||||
// set the preamble
|
// set the preamble
|
||||||
@ -371,6 +366,10 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items, gr_vector_i
|
|||||||
//todo: implement averaging
|
//todo: implement averaging
|
||||||
|
|
||||||
d_average_count++;
|
d_average_count++;
|
||||||
|
if((noutput_items == 0) || (ninput_items[0] == 0))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "noutput_items = 0";
|
||||||
|
}
|
||||||
if (d_average_count == d_decimation_output_factor)
|
if (d_average_count == d_decimation_output_factor)
|
||||||
{
|
{
|
||||||
d_average_count = 0;
|
d_average_count = 0;
|
||||||
|
@ -48,8 +48,7 @@ class gps_l1_ca_telemetry_decoder_cc;
|
|||||||
typedef boost::shared_ptr<gps_l1_ca_telemetry_decoder_cc> gps_l1_ca_telemetry_decoder_cc_sptr;
|
typedef boost::shared_ptr<gps_l1_ca_telemetry_decoder_cc> gps_l1_ca_telemetry_decoder_cc_sptr;
|
||||||
|
|
||||||
gps_l1_ca_telemetry_decoder_cc_sptr
|
gps_l1_ca_telemetry_decoder_cc_sptr
|
||||||
gps_l1_ca_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
|
gps_l1_ca_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
||||||
int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief This class implements a block that decodes the NAV data defined in IS-GPS-200E
|
* \brief This class implements a block that decodes the NAV data defined in IS-GPS-200E
|
||||||
@ -90,11 +89,9 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
friend gps_l1_ca_telemetry_decoder_cc_sptr
|
friend gps_l1_ca_telemetry_decoder_cc_sptr
|
||||||
gps_l1_ca_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in,unsigned
|
gps_l1_ca_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
||||||
int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
|
||||||
|
|
||||||
gps_l1_ca_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
|
gps_l1_ca_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
||||||
int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
|
||||||
|
|
||||||
bool gps_word_parityCheck(unsigned int gpsword);
|
bool gps_word_parityCheck(unsigned int gpsword);
|
||||||
|
|
||||||
@ -102,7 +99,7 @@ private:
|
|||||||
unsigned short int d_preambles_bits[GPS_CA_PREAMBLE_LENGTH_BITS];
|
unsigned short int d_preambles_bits[GPS_CA_PREAMBLE_LENGTH_BITS];
|
||||||
// class private vars
|
// class private vars
|
||||||
|
|
||||||
signed int *d_preambles_symbols;
|
int *d_preambles_symbols;
|
||||||
unsigned int d_samples_per_bit;
|
unsigned int d_samples_per_bit;
|
||||||
long unsigned int d_sample_counter;
|
long unsigned int d_sample_counter;
|
||||||
long unsigned int d_preamble_index;
|
long unsigned int d_preamble_index;
|
||||||
@ -125,14 +122,12 @@ private:
|
|||||||
int d_average_count;
|
int d_average_count;
|
||||||
int d_decimation_output_factor;
|
int d_decimation_output_factor;
|
||||||
|
|
||||||
long d_fs_in;
|
|
||||||
//double d_preamble_duration_seconds;
|
//double d_preamble_duration_seconds;
|
||||||
// navigation message vars
|
// navigation message vars
|
||||||
Gps_Navigation_Message d_nav;
|
Gps_Navigation_Message d_nav;
|
||||||
GpsL1CaSubframeFsm d_GPS_FSM;
|
GpsL1CaSubframeFsm d_GPS_FSM;
|
||||||
|
|
||||||
boost::shared_ptr<gr::msg_queue> d_queue;
|
boost::shared_ptr<gr::msg_queue> d_queue;
|
||||||
unsigned int d_vector_length;
|
|
||||||
bool d_dump;
|
bool d_dump;
|
||||||
Gnss_Satellite d_satellite;
|
Gnss_Satellite d_satellite;
|
||||||
int d_channel;
|
int d_channel;
|
||||||
|
@ -48,21 +48,15 @@ using google::LogMessage;
|
|||||||
|
|
||||||
|
|
||||||
gps_l2_m_telemetry_decoder_cc_sptr
|
gps_l2_m_telemetry_decoder_cc_sptr
|
||||||
gps_l2_m_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
|
gps_l2_m_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump)
|
||||||
int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump)
|
|
||||||
{
|
{
|
||||||
return gps_l2_m_telemetry_decoder_cc_sptr(new gps_l2_m_telemetry_decoder_cc(satellite, if_freq,
|
return gps_l2_m_telemetry_decoder_cc_sptr(new gps_l2_m_telemetry_decoder_cc(satellite, queue, dump));
|
||||||
fs_in, vector_length, queue, dump));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
gps_l2_m_telemetry_decoder_cc::gps_l2_m_telemetry_decoder_cc(
|
gps_l2_m_telemetry_decoder_cc::gps_l2_m_telemetry_decoder_cc(
|
||||||
Gnss_Satellite satellite,
|
Gnss_Satellite satellite,
|
||||||
long if_freq,
|
|
||||||
long fs_in,
|
|
||||||
unsigned
|
|
||||||
int vector_length,
|
|
||||||
boost::shared_ptr<gr::msg_queue> queue,
|
boost::shared_ptr<gr::msg_queue> queue,
|
||||||
bool dump) :
|
bool dump) :
|
||||||
gr::block("gps_l2_m_telemetry_decoder_cc",
|
gr::block("gps_l2_m_telemetry_decoder_cc",
|
||||||
@ -73,7 +67,6 @@ gps_l2_m_telemetry_decoder_cc::gps_l2_m_telemetry_decoder_cc(
|
|||||||
d_dump = dump;
|
d_dump = dump;
|
||||||
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
||||||
LOG(INFO) << "GPS L2C M TELEMETRY PROCESSING: satellite " << d_satellite;
|
LOG(INFO) << "GPS L2C M TELEMETRY PROCESSING: satellite " << d_satellite;
|
||||||
d_fs_in = fs_in;
|
|
||||||
d_block_size = GPS_L2_SAMPLES_PER_SYMBOL * GPS_L2_SYMBOLS_PER_BIT * GPS_L2_CNAV_DATA_PAGE_BITS * 2; // two CNAV frames
|
d_block_size = GPS_L2_SAMPLES_PER_SYMBOL * GPS_L2_SYMBOLS_PER_BIT * GPS_L2_CNAV_DATA_PAGE_BITS * 2; // two CNAV frames
|
||||||
d_decimation_output_factor = 0;
|
d_decimation_output_factor = 0;
|
||||||
//set_output_multiple (1);
|
//set_output_multiple (1);
|
||||||
@ -99,9 +92,12 @@ gps_l2_m_telemetry_decoder_cc::~gps_l2_m_telemetry_decoder_cc()
|
|||||||
|
|
||||||
void gps_l2_m_telemetry_decoder_cc::forecast (int noutput_items, gr_vector_int &ninput_items_required)
|
void gps_l2_m_telemetry_decoder_cc::forecast (int noutput_items, gr_vector_int &ninput_items_required)
|
||||||
{
|
{
|
||||||
unsigned ninputs = ninput_items_required.size ();
|
if (noutput_items != 0)
|
||||||
for (unsigned i = 0; i < ninputs; i++)
|
{
|
||||||
ninput_items_required[i] = noutput_items;
|
unsigned ninputs = ninput_items_required.size ();
|
||||||
|
for (unsigned i = 0; i < ninputs; i++)
|
||||||
|
ninput_items_required[i] = noutput_items;
|
||||||
|
}
|
||||||
//LOG(INFO) << "forecast(): " << "noutput_items=" << noutput_items << "\tninput_items_required ninput_items_required.size()=" << ninput_items_required.size();
|
//LOG(INFO) << "forecast(): " << "noutput_items=" << noutput_items << "\tninput_items_required ninput_items_required.size()=" << ninput_items_required.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -262,6 +258,10 @@ int gps_l2_m_telemetry_decoder_cc::general_work (int noutput_items, gr_vector_in
|
|||||||
}
|
}
|
||||||
|
|
||||||
d_average_count++;
|
d_average_count++;
|
||||||
|
if((noutput_items == 0) || (ninput_items[0] == 0))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "noutput_items = 0";
|
||||||
|
}
|
||||||
if (d_average_count == d_decimation_output_factor)
|
if (d_average_count == d_decimation_output_factor)
|
||||||
{
|
{
|
||||||
d_average_count = 0;
|
d_average_count = 0;
|
||||||
|
@ -53,8 +53,7 @@ class gps_l2_m_telemetry_decoder_cc;
|
|||||||
typedef boost::shared_ptr<gps_l2_m_telemetry_decoder_cc> gps_l2_m_telemetry_decoder_cc_sptr;
|
typedef boost::shared_ptr<gps_l2_m_telemetry_decoder_cc> gps_l2_m_telemetry_decoder_cc_sptr;
|
||||||
|
|
||||||
gps_l2_m_telemetry_decoder_cc_sptr
|
gps_l2_m_telemetry_decoder_cc_sptr
|
||||||
gps_l2_m_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
|
gps_l2_m_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
||||||
int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief This class implements a block that decodes the SBAS integrity and corrections data defined in RTCA MOPS DO-229
|
* \brief This class implements a block that decodes the SBAS integrity and corrections data defined in RTCA MOPS DO-229
|
||||||
@ -87,17 +86,14 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
friend gps_l2_m_telemetry_decoder_cc_sptr
|
friend gps_l2_m_telemetry_decoder_cc_sptr
|
||||||
gps_l2_m_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in,unsigned
|
gps_l2_m_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
||||||
int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
gps_l2_m_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
||||||
gps_l2_m_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
|
|
||||||
int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
|
||||||
|
|
||||||
void viterbi_decoder(double *page_part_symbols, int *page_part_bits);
|
void viterbi_decoder(double *page_part_symbols, int *page_part_bits);
|
||||||
void align_samples();
|
void align_samples();
|
||||||
|
|
||||||
concurrent_queue<Gps_CNAV_Iono> *d_iono_queue;
|
concurrent_queue<Gps_CNAV_Iono> *d_iono_queue;
|
||||||
concurrent_queue<Gps_CNAV_Ephemeris> *d_ephemeris_queue;
|
concurrent_queue<Gps_CNAV_Ephemeris> *d_ephemeris_queue;
|
||||||
long d_fs_in;
|
|
||||||
|
|
||||||
bool d_dump;
|
bool d_dump;
|
||||||
Gnss_Satellite d_satellite;
|
Gnss_Satellite d_satellite;
|
||||||
|
@ -48,21 +48,15 @@ using google::LogMessage;
|
|||||||
|
|
||||||
|
|
||||||
sbas_l1_telemetry_decoder_cc_sptr
|
sbas_l1_telemetry_decoder_cc_sptr
|
||||||
sbas_l1_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
|
sbas_l1_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump)
|
||||||
int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump)
|
|
||||||
{
|
{
|
||||||
return sbas_l1_telemetry_decoder_cc_sptr(new sbas_l1_telemetry_decoder_cc(satellite, if_freq,
|
return sbas_l1_telemetry_decoder_cc_sptr(new sbas_l1_telemetry_decoder_cc(satellite, queue, dump));
|
||||||
fs_in, vector_length, queue, dump));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sbas_l1_telemetry_decoder_cc::sbas_l1_telemetry_decoder_cc(
|
sbas_l1_telemetry_decoder_cc::sbas_l1_telemetry_decoder_cc(
|
||||||
Gnss_Satellite satellite,
|
Gnss_Satellite satellite,
|
||||||
long if_freq,
|
|
||||||
long fs_in,
|
|
||||||
unsigned
|
|
||||||
int vector_length,
|
|
||||||
boost::shared_ptr<gr::msg_queue> queue,
|
boost::shared_ptr<gr::msg_queue> queue,
|
||||||
bool dump) :
|
bool dump) :
|
||||||
gr::block("sbas_l1_telemetry_decoder_cc",
|
gr::block("sbas_l1_telemetry_decoder_cc",
|
||||||
@ -73,7 +67,6 @@ sbas_l1_telemetry_decoder_cc::sbas_l1_telemetry_decoder_cc(
|
|||||||
d_dump = dump;
|
d_dump = dump;
|
||||||
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
||||||
LOG(INFO) << "SBAS L1 TELEMETRY PROCESSING: satellite " << d_satellite;
|
LOG(INFO) << "SBAS L1 TELEMETRY PROCESSING: satellite " << d_satellite;
|
||||||
d_fs_in = fs_in;
|
|
||||||
d_block_size = d_samples_per_symbol * d_symbols_per_bit * d_block_size_in_bits;
|
d_block_size = d_samples_per_symbol * d_symbols_per_bit * d_block_size_in_bits;
|
||||||
d_channel = 0;
|
d_channel = 0;
|
||||||
set_output_multiple (1);
|
set_output_multiple (1);
|
||||||
@ -187,6 +180,10 @@ int sbas_l1_telemetry_decoder_cc::general_work (int noutput_items, gr_vector_int
|
|||||||
current_synchro_data[i].Flag_valid_word = false; // indicate to observable block that this synchro object isn't valid for pseudorange computation
|
current_synchro_data[i].Flag_valid_word = false; // indicate to observable block that this synchro object isn't valid for pseudorange computation
|
||||||
}
|
}
|
||||||
consume_each(noutput_items); // tell scheduler input items consumed
|
consume_each(noutput_items); // tell scheduler input items consumed
|
||||||
|
if((noutput_items == 0) || (ninput_items[0] == 0))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "noutput_items = 0";
|
||||||
|
}
|
||||||
return noutput_items; // tell scheduler output items produced
|
return noutput_items; // tell scheduler output items produced
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,8 +49,7 @@ class sbas_l1_telemetry_decoder_cc;
|
|||||||
typedef boost::shared_ptr<sbas_l1_telemetry_decoder_cc> sbas_l1_telemetry_decoder_cc_sptr;
|
typedef boost::shared_ptr<sbas_l1_telemetry_decoder_cc> sbas_l1_telemetry_decoder_cc_sptr;
|
||||||
|
|
||||||
sbas_l1_telemetry_decoder_cc_sptr
|
sbas_l1_telemetry_decoder_cc_sptr
|
||||||
sbas_l1_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
|
sbas_l1_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
||||||
int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief This class implements a block that decodes the SBAS integrity and corrections data defined in RTCA MOPS DO-229
|
* \brief This class implements a block that decodes the SBAS integrity and corrections data defined in RTCA MOPS DO-229
|
||||||
@ -83,10 +82,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
friend sbas_l1_telemetry_decoder_cc_sptr
|
friend sbas_l1_telemetry_decoder_cc_sptr
|
||||||
sbas_l1_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in,unsigned
|
sbas_l1_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
||||||
int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
sbas_l1_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
||||||
sbas_l1_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
|
|
||||||
int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
|
|
||||||
|
|
||||||
void viterbi_decoder(double *page_part_symbols, int *page_part_bits);
|
void viterbi_decoder(double *page_part_symbols, int *page_part_bits);
|
||||||
void align_samples();
|
void align_samples();
|
||||||
@ -95,8 +92,6 @@ private:
|
|||||||
static const int d_symbols_per_bit = 2;
|
static const int d_symbols_per_bit = 2;
|
||||||
static const int d_block_size_in_bits = 30;
|
static const int d_block_size_in_bits = 30;
|
||||||
|
|
||||||
long d_fs_in;
|
|
||||||
|
|
||||||
bool d_dump;
|
bool d_dump;
|
||||||
Gnss_Satellite d_satellite;
|
Gnss_Satellite d_satellite;
|
||||||
int d_channel;
|
int d_channel;
|
||||||
|
@ -84,7 +84,10 @@ galileo_e1_dll_pll_veml_make_tracking_cc(
|
|||||||
void galileo_e1_dll_pll_veml_tracking_cc::forecast (int noutput_items,
|
void galileo_e1_dll_pll_veml_tracking_cc::forecast (int noutput_items,
|
||||||
gr_vector_int &ninput_items_required)
|
gr_vector_int &ninput_items_required)
|
||||||
{
|
{
|
||||||
ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
|
if (noutput_items != 0)
|
||||||
|
{
|
||||||
|
ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -210,10 +213,10 @@ void galileo_e1_dll_pll_veml_tracking_cc::start_tracking()
|
|||||||
|
|
||||||
d_carrier_lock_fail_counter = 0;
|
d_carrier_lock_fail_counter = 0;
|
||||||
d_rem_code_phase_samples = 0.0;
|
d_rem_code_phase_samples = 0.0;
|
||||||
d_rem_carr_phase_rad = 0;
|
d_rem_carr_phase_rad = 0.0;
|
||||||
d_acc_carrier_phase_rad = 0;
|
d_acc_carrier_phase_rad = 0.0;
|
||||||
|
|
||||||
d_acc_code_phase_secs = 0;
|
d_acc_code_phase_secs = 0.0;
|
||||||
d_carrier_doppler_hz = d_acq_carrier_doppler_hz;
|
d_carrier_doppler_hz = d_acq_carrier_doppler_hz;
|
||||||
d_current_prn_length_samples = d_vector_length;
|
d_current_prn_length_samples = d_vector_length;
|
||||||
|
|
||||||
@ -307,7 +310,7 @@ galileo_e1_dll_pll_veml_tracking_cc::~galileo_e1_dll_pll_veml_tracking_cc()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items,gr_vector_int &ninput_items,
|
int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items, gr_vector_int &ninput_items,
|
||||||
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
|
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
|
||||||
{
|
{
|
||||||
double carr_error_hz = 0.0;
|
double carr_error_hz = 0.0;
|
||||||
@ -326,7 +329,7 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items,gr_vect
|
|||||||
double acq_trk_shif_correction_samples;
|
double acq_trk_shif_correction_samples;
|
||||||
int acq_to_trk_delay_samples;
|
int acq_to_trk_delay_samples;
|
||||||
acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp;
|
acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp;
|
||||||
acq_trk_shif_correction_samples = d_current_prn_length_samples - std::fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_current_prn_length_samples));
|
acq_trk_shif_correction_samples = d_current_prn_length_samples - std::fmod(static_cast<double>(acq_to_trk_delay_samples), static_cast<double>(d_current_prn_length_samples));
|
||||||
samples_offset = std::round(d_acq_code_phase_samples + acq_trk_shif_correction_samples);
|
samples_offset = std::round(d_acq_code_phase_samples + acq_trk_shif_correction_samples);
|
||||||
d_sample_counter = d_sample_counter + samples_offset; //count for the processed samples
|
d_sample_counter = d_sample_counter + samples_offset; //count for the processed samples
|
||||||
d_pull_in = false;
|
d_pull_in = false;
|
||||||
@ -394,7 +397,7 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items,gr_vect
|
|||||||
double T_prn_seconds;
|
double T_prn_seconds;
|
||||||
double T_prn_samples;
|
double T_prn_samples;
|
||||||
double K_blk_samples;
|
double K_blk_samples;
|
||||||
// Compute the next buffer lenght based in the new period of the PRN sequence and the code phase error estimation
|
// Compute the next buffer length based in the new period of the PRN sequence and the code phase error estimation
|
||||||
T_chip_seconds = 1.0 / d_code_freq_chips;
|
T_chip_seconds = 1.0 / d_code_freq_chips;
|
||||||
T_prn_seconds = T_chip_seconds * Galileo_E1_B_CODE_LENGTH_CHIPS;
|
T_prn_seconds = T_chip_seconds * Galileo_E1_B_CODE_LENGTH_CHIPS;
|
||||||
T_prn_samples = T_prn_seconds * static_cast<double>(d_fs_in);
|
T_prn_samples = T_prn_seconds * static_cast<double>(d_fs_in);
|
||||||
@ -582,7 +585,11 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items,gr_vect
|
|||||||
}
|
}
|
||||||
consume_each(d_current_prn_length_samples); // this is required for gr_block derivates
|
consume_each(d_current_prn_length_samples); // this is required for gr_block derivates
|
||||||
d_sample_counter += d_current_prn_length_samples; //count for the processed samples
|
d_sample_counter += d_current_prn_length_samples; //count for the processed samples
|
||||||
//std::cout<<"Galileo tracking output at sample "<<d_sample_counter<<std::endl;
|
|
||||||
|
if((noutput_items == 0) || (ninput_items[0] == 0))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "noutput_items = 0";
|
||||||
|
}
|
||||||
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,10 @@ galileo_e1_tcp_connector_tracking_cc_sptr galileo_e1_tcp_connector_make_tracking
|
|||||||
void Galileo_E1_Tcp_Connector_Tracking_cc::forecast (int noutput_items,
|
void Galileo_E1_Tcp_Connector_Tracking_cc::forecast (int noutput_items,
|
||||||
gr_vector_int &ninput_items_required)
|
gr_vector_int &ninput_items_required)
|
||||||
{
|
{
|
||||||
ninput_items_required[0] = (int)d_vector_length*2; // set the required available samples in each call
|
if (noutput_items != 0)
|
||||||
|
{
|
||||||
|
ninput_items_required[0] = (int)d_vector_length*2; // set the required available samples in each call
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -589,6 +592,10 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items, gr_ve
|
|||||||
}
|
}
|
||||||
consume_each(d_current_prn_length_samples); // this is needed in gr::block derivates
|
consume_each(d_current_prn_length_samples); // this is needed in gr::block derivates
|
||||||
d_sample_counter += d_current_prn_length_samples; //count for the processed samples
|
d_sample_counter += d_current_prn_length_samples; //count for the processed samples
|
||||||
|
if((noutput_items == 0) || (ninput_items[0] == 0))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "noutput_items = 0";
|
||||||
|
}
|
||||||
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,10 @@ galileo_e5a_dll_pll_make_tracking_cc(
|
|||||||
void Galileo_E5a_Dll_Pll_Tracking_cc::forecast (int noutput_items,
|
void Galileo_E5a_Dll_Pll_Tracking_cc::forecast (int noutput_items,
|
||||||
gr_vector_int &ninput_items_required)
|
gr_vector_int &ninput_items_required)
|
||||||
{
|
{
|
||||||
ninput_items_required[0] = static_cast<int>(d_vector_length)*2; //set the required available samples in each call
|
if (noutput_items != 0)
|
||||||
|
{
|
||||||
|
ninput_items_required[0] = static_cast<int>(d_vector_length)*2; //set the required available samples in each call
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Galileo_E5a_Dll_Pll_Tracking_cc::Galileo_E5a_Dll_Pll_Tracking_cc(
|
Galileo_E5a_Dll_Pll_Tracking_cc::Galileo_E5a_Dll_Pll_Tracking_cc(
|
||||||
@ -828,6 +831,10 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items, gr_vector_
|
|||||||
d_secondary_delay = (d_secondary_delay + 1) % Galileo_E5a_Q_SECONDARY_CODE_LENGTH;
|
d_secondary_delay = (d_secondary_delay + 1) % Galileo_E5a_Q_SECONDARY_CODE_LENGTH;
|
||||||
d_sample_counter += d_current_prn_length_samples; //count for the processed samples
|
d_sample_counter += d_current_prn_length_samples; //count for the processed samples
|
||||||
consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
|
consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
|
||||||
|
if((noutput_items == 0) || (ninput_items[0] == 0))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "noutput_items = 0";
|
||||||
|
}
|
||||||
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,7 +85,10 @@ galileo_volk_e1_dll_pll_veml_make_tracking_cc(
|
|||||||
void galileo_volk_e1_dll_pll_veml_tracking_cc::forecast (int noutput_items,
|
void galileo_volk_e1_dll_pll_veml_tracking_cc::forecast (int noutput_items,
|
||||||
gr_vector_int &ninput_items_required)
|
gr_vector_int &ninput_items_required)
|
||||||
{
|
{
|
||||||
ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
|
if (noutput_items != 0)
|
||||||
|
{
|
||||||
|
ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -135,21 +138,21 @@ gr::block("galileo_volk_e1_dll_pll_veml_tracking_cc", gr::io_signature::make(1,
|
|||||||
d_very_late_code = static_cast<gr_complex*>(volk_malloc(2 * d_vector_length * sizeof(gr_complex), volk_get_alignment()));
|
d_very_late_code = static_cast<gr_complex*>(volk_malloc(2 * d_vector_length * sizeof(gr_complex), volk_get_alignment()));
|
||||||
d_carr_sign = static_cast<gr_complex*>(volk_malloc(2*d_vector_length * sizeof(gr_complex), volk_get_alignment()));
|
d_carr_sign = static_cast<gr_complex*>(volk_malloc(2*d_vector_length * sizeof(gr_complex), volk_get_alignment()));
|
||||||
|
|
||||||
d_very_early_code16=static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
|
d_very_early_code16 = static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
|
||||||
d_early_code16=static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
|
d_early_code16 = static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
|
||||||
d_prompt_code16=static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
|
d_prompt_code16 = static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
|
||||||
d_late_code16=static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
|
d_late_code16 = static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
|
||||||
d_very_late_code16=static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
|
d_very_late_code16 = static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
|
||||||
d_carr_sign16=static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
|
d_carr_sign16 = static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
|
||||||
in16=static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
|
in16 = static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
|
||||||
|
|
||||||
d_very_early_code8=static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
|
d_very_early_code8 = static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
|
||||||
d_early_code8=static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
|
d_early_code8 = static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
|
||||||
d_prompt_code8=static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
|
d_prompt_code8 = static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
|
||||||
d_late_code8=static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
|
d_late_code8 = static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
|
||||||
d_very_late_code8=static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
|
d_very_late_code8 = static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
|
||||||
d_carr_sign8=static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
|
d_carr_sign8 = static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
|
||||||
in8=static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
|
in8 = static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
|
||||||
|
|
||||||
// correlator outputs (scalar)
|
// correlator outputs (scalar)
|
||||||
d_Very_Early = static_cast<gr_complex*>(volk_malloc(sizeof(gr_complex), volk_get_alignment()));
|
d_Very_Early = static_cast<gr_complex*>(volk_malloc(sizeof(gr_complex), volk_get_alignment()));
|
||||||
@ -337,13 +340,13 @@ galileo_volk_e1_dll_pll_veml_tracking_cc::~galileo_volk_e1_dll_pll_veml_tracking
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int galileo_volk_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items,gr_vector_int &ninput_items,
|
int galileo_volk_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items, gr_vector_int &ninput_items,
|
||||||
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
|
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
|
||||||
{
|
{
|
||||||
double carr_error_hz;
|
double carr_error_hz = 0.0;
|
||||||
double carr_error_filt_hz;
|
double carr_error_filt_hz = 0.0;
|
||||||
double code_error_chips;
|
double code_error_chips = 0.0;
|
||||||
double code_error_filt_chips;
|
double code_error_filt_chips = 0.0;
|
||||||
|
|
||||||
if (d_enable_tracking == true)
|
if (d_enable_tracking == true)
|
||||||
{
|
{
|
||||||
@ -411,7 +414,7 @@ int galileo_volk_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items,gr
|
|||||||
|
|
||||||
// ################## PLL ##########################################################
|
// ################## PLL ##########################################################
|
||||||
// PLL discriminator
|
// PLL discriminator
|
||||||
carr_error_hz = pll_cloop_two_quadrant_atan(*d_Prompt) / static_cast<float>(GPS_TWO_PI);
|
carr_error_hz = pll_cloop_two_quadrant_atan(*d_Prompt) / GPS_TWO_PI;
|
||||||
// Carrier discriminator filter
|
// Carrier discriminator filter
|
||||||
carr_error_filt_hz = d_carrier_loop_filter.get_carrier_nco(carr_error_hz);
|
carr_error_filt_hz = d_carrier_loop_filter.get_carrier_nco(carr_error_hz);
|
||||||
// New carrier Doppler frequency estimation
|
// New carrier Doppler frequency estimation
|
||||||
@ -629,7 +632,11 @@ int galileo_volk_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items,gr
|
|||||||
}
|
}
|
||||||
consume_each(d_current_prn_length_samples); // this is required for gr_block derivates
|
consume_each(d_current_prn_length_samples); // this is required for gr_block derivates
|
||||||
d_sample_counter += d_current_prn_length_samples; //count for the processed samples
|
d_sample_counter += d_current_prn_length_samples; //count for the processed samples
|
||||||
//std::cout<<"Galileo tracking output at sample "<<d_sample_counter<<std::endl;
|
|
||||||
|
if((noutput_items == 0) || (ninput_items[0] == 0))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "noutput_items = 0";
|
||||||
|
}
|
||||||
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,10 @@ gps_l1_ca_dll_fll_pll_tracking_cc_sptr gps_l1_ca_dll_fll_pll_make_tracking_cc(
|
|||||||
|
|
||||||
void Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc::forecast (int noutput_items, gr_vector_int &ninput_items_required)
|
void Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc::forecast (int noutput_items, gr_vector_int &ninput_items_required)
|
||||||
{
|
{
|
||||||
ninput_items_required[0] = d_vector_length * 2; //set the required available samples in each call
|
if (noutput_items != 0)
|
||||||
|
{
|
||||||
|
ninput_items_required[0] = d_vector_length * 2; //set the required available samples in each call
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -650,6 +653,10 @@ int Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc::general_work (int noutput_items, gr_vecto
|
|||||||
}
|
}
|
||||||
consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
|
consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
|
||||||
d_sample_counter += d_current_prn_length_samples; //count for the processed samples
|
d_sample_counter += d_current_prn_length_samples; //count for the processed samples
|
||||||
|
if((noutput_items == 0) || (ninput_items[0] == 0))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "noutput_items = 0";
|
||||||
|
}
|
||||||
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,7 +77,10 @@ gps_l1_ca_dll_pll_c_aid_make_tracking_cc(
|
|||||||
void gps_l1_ca_dll_pll_c_aid_tracking_cc::forecast (int noutput_items,
|
void gps_l1_ca_dll_pll_c_aid_tracking_cc::forecast (int noutput_items,
|
||||||
gr_vector_int &ninput_items_required)
|
gr_vector_int &ninput_items_required)
|
||||||
{
|
{
|
||||||
ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
|
if (noutput_items != 0)
|
||||||
|
{
|
||||||
|
ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -319,21 +322,21 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items, gr_vec
|
|||||||
// ################# CARRIER WIPEOFF AND CORRELATORS ##############################
|
// ################# CARRIER WIPEOFF AND CORRELATORS ##############################
|
||||||
// perform carrier wipe-off and compute Early, Prompt and Late correlation
|
// perform carrier wipe-off and compute Early, Prompt and Late correlation
|
||||||
multicorrelator_cpu.set_input_output_vectors(d_correlator_outs,in);
|
multicorrelator_cpu.set_input_output_vectors(d_correlator_outs,in);
|
||||||
multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler(d_rem_carrier_phase_rad,d_carrier_phase_step_rad,d_rem_code_phase_chips,d_code_phase_step_chips,d_correlation_length_samples);
|
multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler(d_rem_carrier_phase_rad, d_carrier_phase_step_rad, d_rem_code_phase_chips, d_code_phase_step_chips, d_correlation_length_samples);
|
||||||
|
|
||||||
// UPDATE INTEGRATION TIME
|
// UPDATE INTEGRATION TIME
|
||||||
CURRENT_INTEGRATION_TIME_S=(static_cast<double>(d_correlation_length_samples)/static_cast<double>(d_fs_in));
|
CURRENT_INTEGRATION_TIME_S = static_cast<double>(d_correlation_length_samples) / static_cast<double>(d_fs_in);
|
||||||
|
|
||||||
// ################## PLL ##########################################################
|
// ################## PLL ##########################################################
|
||||||
// Update PLL discriminator [rads/Ti -> Secs/Ti]
|
// Update PLL discriminator [rads/Ti -> Secs/Ti]
|
||||||
carr_phase_error_secs_Ti = pll_cloop_two_quadrant_atan(d_correlator_outs[1])/GPS_TWO_PI; //prompt output
|
carr_phase_error_secs_Ti = pll_cloop_two_quadrant_atan(d_correlator_outs[1]) / GPS_TWO_PI; //prompt output
|
||||||
// Carrier discriminator filter
|
// Carrier discriminator filter
|
||||||
// NOTICE: The carrier loop filter includes the Carrier Doppler accumulator, as described in Kaplan
|
// NOTICE: The carrier loop filter includes the Carrier Doppler accumulator, as described in Kaplan
|
||||||
//d_carrier_doppler_hz = d_acq_carrier_doppler_hz + carr_phase_error_filt_secs_ti/INTEGRATION_TIME;
|
//d_carrier_doppler_hz = d_acq_carrier_doppler_hz + carr_phase_error_filt_secs_ti/INTEGRATION_TIME;
|
||||||
// Input [s/Ti] -> output [Hz]
|
// Input [s/Ti] -> output [Hz]
|
||||||
d_carrier_doppler_hz = d_carrier_loop_filter.get_carrier_error(0.0, carr_phase_error_secs_Ti, CURRENT_INTEGRATION_TIME_S);
|
d_carrier_doppler_hz = d_carrier_loop_filter.get_carrier_error(0.0, carr_phase_error_secs_Ti, CURRENT_INTEGRATION_TIME_S);
|
||||||
// PLL to DLL assistance [Secs/Ti]
|
// PLL to DLL assistance [Secs/Ti]
|
||||||
d_pll_to_dll_assist_secs_Ti = (d_carrier_doppler_hz*CURRENT_INTEGRATION_TIME_S)/GPS_L1_FREQ_HZ;
|
d_pll_to_dll_assist_secs_Ti = (d_carrier_doppler_hz * CURRENT_INTEGRATION_TIME_S) / GPS_L1_FREQ_HZ;
|
||||||
// code Doppler frequency update
|
// code Doppler frequency update
|
||||||
d_code_freq_chips = GPS_L1_CA_CODE_RATE_HZ + ((d_carrier_doppler_hz * GPS_L1_CA_CODE_RATE_HZ) / GPS_L1_FREQ_HZ);
|
d_code_freq_chips = GPS_L1_CA_CODE_RATE_HZ + ((d_carrier_doppler_hz * GPS_L1_CA_CODE_RATE_HZ) / GPS_L1_FREQ_HZ);
|
||||||
|
|
||||||
@ -345,7 +348,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items, gr_vec
|
|||||||
code_error_filt_secs_Ti = code_error_filt_chips*CURRENT_INTEGRATION_TIME_S/d_code_freq_chips; // [s/Ti]
|
code_error_filt_secs_Ti = code_error_filt_chips*CURRENT_INTEGRATION_TIME_S/d_code_freq_chips; // [s/Ti]
|
||||||
// DLL code error estimation [s/Ti]
|
// DLL code error estimation [s/Ti]
|
||||||
// TODO: PLL carrier aid to DLL is disabled. Re-enable it and measure performance
|
// TODO: PLL carrier aid to DLL is disabled. Re-enable it and measure performance
|
||||||
dll_code_error_secs_Ti=-code_error_filt_secs_Ti+d_pll_to_dll_assist_secs_Ti;
|
dll_code_error_secs_Ti = - code_error_filt_secs_Ti + d_pll_to_dll_assist_secs_Ti;
|
||||||
|
|
||||||
// ################## CARRIER AND CODE NCO BUFFER ALIGNEMENT #######################
|
// ################## CARRIER AND CODE NCO BUFFER ALIGNEMENT #######################
|
||||||
// keep alignment parameters for the next input buffer
|
// keep alignment parameters for the next input buffer
|
||||||
@ -363,19 +366,17 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items, gr_vec
|
|||||||
old_d_rem_code_phase_samples=d_rem_code_phase_samples;
|
old_d_rem_code_phase_samples=d_rem_code_phase_samples;
|
||||||
d_rem_code_phase_samples = K_blk_samples - static_cast<double>(d_correlation_length_samples); //rounding error < 1 sample
|
d_rem_code_phase_samples = K_blk_samples - static_cast<double>(d_correlation_length_samples); //rounding error < 1 sample
|
||||||
|
|
||||||
|
|
||||||
// UPDATE REMNANT CARRIER PHASE
|
// UPDATE REMNANT CARRIER PHASE
|
||||||
CORRECTED_INTEGRATION_TIME_S=(static_cast<double>(d_correlation_length_samples)/static_cast<double>(d_fs_in));
|
CORRECTED_INTEGRATION_TIME_S=(static_cast<double>(d_correlation_length_samples)/static_cast<double>(d_fs_in));
|
||||||
//remnant carrier phase [rad]
|
//remnant carrier phase [rad]
|
||||||
d_rem_carrier_phase_rad = fmod(d_rem_carrier_phase_rad + GPS_TWO_PI * d_carrier_doppler_hz * CORRECTED_INTEGRATION_TIME_S,GPS_TWO_PI);
|
d_rem_carrier_phase_rad = fmod(d_rem_carrier_phase_rad + GPS_TWO_PI * d_carrier_doppler_hz * CORRECTED_INTEGRATION_TIME_S, GPS_TWO_PI);
|
||||||
// UPDATE CARRIER PHASE ACCUULATOR
|
// UPDATE CARRIER PHASE ACCUULATOR
|
||||||
//carrier phase accumulator prior to update the PLL estimators (accumulated carrier in this loop depends on the old estimations!)
|
//carrier phase accumulator prior to update the PLL estimators (accumulated carrier in this loop depends on the old estimations!)
|
||||||
d_acc_carrier_phase_cycles -= d_carrier_doppler_hz*CORRECTED_INTEGRATION_TIME_S;
|
d_acc_carrier_phase_cycles -= d_carrier_doppler_hz * CORRECTED_INTEGRATION_TIME_S;
|
||||||
|
|
||||||
|
|
||||||
//################### PLL COMMANDS #################################################
|
//################### PLL COMMANDS #################################################
|
||||||
//carrier phase step (NCO phase increment per sample) [rads/sample]
|
//carrier phase step (NCO phase increment per sample) [rads/sample]
|
||||||
d_carrier_phase_step_rad=GPS_TWO_PI*d_carrier_doppler_hz/static_cast<double>(d_fs_in);
|
d_carrier_phase_step_rad = GPS_TWO_PI * d_carrier_doppler_hz / static_cast<double>(d_fs_in);
|
||||||
|
|
||||||
//################### DLL COMMANDS #################################################
|
//################### DLL COMMANDS #################################################
|
||||||
//code phase step (Code resampler phase increment per sample) [chips/sample]
|
//code phase step (Code resampler phase increment per sample) [chips/sample]
|
||||||
@ -383,7 +384,6 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items, gr_vec
|
|||||||
//remnant code phase [chips]
|
//remnant code phase [chips]
|
||||||
d_rem_code_phase_chips = d_rem_code_phase_samples * (d_code_freq_chips / static_cast<double>(d_fs_in));
|
d_rem_code_phase_chips = d_rem_code_phase_samples * (d_code_freq_chips / static_cast<double>(d_fs_in));
|
||||||
|
|
||||||
|
|
||||||
// ####### CN0 ESTIMATION AND LOCK DETECTORS #######################################
|
// ####### CN0 ESTIMATION AND LOCK DETECTORS #######################################
|
||||||
if (d_cn0_estimation_counter < CN0_ESTIMATION_SAMPLES)
|
if (d_cn0_estimation_counter < CN0_ESTIMATION_SAMPLES)
|
||||||
{
|
{
|
||||||
@ -428,7 +428,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items, gr_vec
|
|||||||
current_synchro_data.Tracking_timestamp_secs = (static_cast<double>(d_sample_counter) + old_d_rem_code_phase_samples) / static_cast<double>(d_fs_in);
|
current_synchro_data.Tracking_timestamp_secs = (static_cast<double>(d_sample_counter) + old_d_rem_code_phase_samples) / static_cast<double>(d_fs_in);
|
||||||
// This tracking block aligns the Tracking_timestamp_secs with the start sample of the PRN, thus, Code_phase_secs=0
|
// This tracking block aligns the Tracking_timestamp_secs with the start sample of the PRN, thus, Code_phase_secs=0
|
||||||
current_synchro_data.Code_phase_secs = 0;
|
current_synchro_data.Code_phase_secs = 0;
|
||||||
current_synchro_data.Carrier_phase_rads = GPS_TWO_PI*d_acc_carrier_phase_cycles;
|
current_synchro_data.Carrier_phase_rads = GPS_TWO_PI * d_acc_carrier_phase_cycles;
|
||||||
current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz;
|
current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz;
|
||||||
current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz;
|
current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz;
|
||||||
current_synchro_data.Flag_valid_pseudorange = false;
|
current_synchro_data.Flag_valid_pseudorange = false;
|
||||||
@ -446,7 +446,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items, gr_vec
|
|||||||
d_last_seg = floor(d_sample_counter / d_fs_in);
|
d_last_seg = floor(d_sample_counter / d_fs_in);
|
||||||
std::cout << "Current input signal time = " << d_last_seg << " [s]" << std::endl;
|
std::cout << "Current input signal time = " << d_last_seg << " [s]" << std::endl;
|
||||||
DLOG(INFO) << "GPS L1 C/A Tracking CH " << d_channel << ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN)
|
DLOG(INFO) << "GPS L1 C/A Tracking CH " << d_channel << ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN)
|
||||||
<< ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl;
|
<< ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl;
|
||||||
//if (d_last_seg==5) d_carrier_lock_fail_counter=500; //DEBUG: force unlock!
|
//if (d_last_seg==5) d_carrier_lock_fail_counter=500; //DEBUG: force unlock!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -456,7 +456,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items, gr_vec
|
|||||||
{
|
{
|
||||||
d_last_seg = floor(d_sample_counter / d_fs_in);
|
d_last_seg = floor(d_sample_counter / d_fs_in);
|
||||||
DLOG(INFO) << "Tracking CH " << d_channel << ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN)
|
DLOG(INFO) << "Tracking CH " << d_channel << ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN)
|
||||||
<< ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]";
|
<< ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -544,9 +544,13 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items, gr_vec
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates
|
consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates
|
||||||
d_sample_counter += d_correlation_length_samples; //count for the processed samples
|
d_sample_counter += d_correlation_length_samples; //count for the processed samples
|
||||||
|
|
||||||
|
if((noutput_items == 0) || (ninput_items[0] == 0))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "noutput_items = 0";
|
||||||
|
}
|
||||||
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +82,10 @@ gps_l1_ca_dll_pll_make_optim_tracking_cc(
|
|||||||
void Gps_L1_Ca_Dll_Pll_Optim_Tracking_cc::forecast (int noutput_items,
|
void Gps_L1_Ca_Dll_Pll_Optim_Tracking_cc::forecast (int noutput_items,
|
||||||
gr_vector_int &ninput_items_required)
|
gr_vector_int &ninput_items_required)
|
||||||
{
|
{
|
||||||
ninput_items_required[0] = d_gnuradio_forecast_samples; //set the required available samples in each call
|
if (noutput_items != 0)
|
||||||
|
{
|
||||||
|
ninput_items_required[0] = d_gnuradio_forecast_samples; //set the required available samples in each call
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -338,10 +341,10 @@ int Gps_L1_Ca_Dll_Pll_Optim_Tracking_cc::general_work (int noutput_items, gr_vec
|
|||||||
{
|
{
|
||||||
// stream to collect cout calls to improve thread safety
|
// stream to collect cout calls to improve thread safety
|
||||||
std::stringstream tmp_str_stream;
|
std::stringstream tmp_str_stream;
|
||||||
double carr_error_hz;
|
double carr_error_hz = 0.0;
|
||||||
double carr_error_filt_hz;
|
double carr_error_filt_hz = 0.0;
|
||||||
double code_error_chips;
|
double code_error_chips = 0.0;
|
||||||
double code_error_filt_chips;
|
double code_error_filt_chips = 0.0;
|
||||||
|
|
||||||
if (d_enable_tracking == true)
|
if (d_enable_tracking == true)
|
||||||
{
|
{
|
||||||
@ -604,6 +607,10 @@ int Gps_L1_Ca_Dll_Pll_Optim_Tracking_cc::general_work (int noutput_items, gr_vec
|
|||||||
|
|
||||||
consume_each(d_current_prn_length_samples); // this is necesary in gr_block derivates
|
consume_each(d_current_prn_length_samples); // this is necesary in gr_block derivates
|
||||||
d_sample_counter += d_current_prn_length_samples; //count for the processed samples
|
d_sample_counter += d_current_prn_length_samples; //count for the processed samples
|
||||||
|
if((noutput_items == 0) || (ninput_items[0] == 0))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "noutput_items = 0";
|
||||||
|
}
|
||||||
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,10 @@ gps_l1_ca_dll_pll_make_tracking_cc(
|
|||||||
void Gps_L1_Ca_Dll_Pll_Tracking_cc::forecast (int noutput_items,
|
void Gps_L1_Ca_Dll_Pll_Tracking_cc::forecast (int noutput_items,
|
||||||
gr_vector_int &ninput_items_required)
|
gr_vector_int &ninput_items_required)
|
||||||
{
|
{
|
||||||
ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
|
if (noutput_items != 0)
|
||||||
|
{
|
||||||
|
ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -204,16 +207,16 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::start_tracking()
|
|||||||
d_code_freq_chips = radial_velocity * GPS_L1_CA_CODE_RATE_HZ;
|
d_code_freq_chips = radial_velocity * GPS_L1_CA_CODE_RATE_HZ;
|
||||||
T_chip_mod_seconds = 1/d_code_freq_chips;
|
T_chip_mod_seconds = 1/d_code_freq_chips;
|
||||||
T_prn_mod_seconds = T_chip_mod_seconds * GPS_L1_CA_CODE_LENGTH_CHIPS;
|
T_prn_mod_seconds = T_chip_mod_seconds * GPS_L1_CA_CODE_LENGTH_CHIPS;
|
||||||
T_prn_mod_samples = T_prn_mod_seconds * static_cast<float>(d_fs_in);
|
T_prn_mod_samples = T_prn_mod_seconds * static_cast<double>(d_fs_in);
|
||||||
|
|
||||||
d_current_prn_length_samples = round(T_prn_mod_samples);
|
d_current_prn_length_samples = round(T_prn_mod_samples);
|
||||||
|
|
||||||
double T_prn_true_seconds = GPS_L1_CA_CODE_LENGTH_CHIPS / GPS_L1_CA_CODE_RATE_HZ;
|
double T_prn_true_seconds = GPS_L1_CA_CODE_LENGTH_CHIPS / GPS_L1_CA_CODE_RATE_HZ;
|
||||||
double T_prn_true_samples = T_prn_true_seconds * static_cast<float>(d_fs_in);
|
double T_prn_true_samples = T_prn_true_seconds * static_cast<double>(d_fs_in);
|
||||||
double T_prn_diff_seconds= T_prn_true_seconds - T_prn_mod_seconds;
|
double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds;
|
||||||
double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds;
|
double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds;
|
||||||
double corrected_acq_phase_samples, delay_correction_samples;
|
double corrected_acq_phase_samples, delay_correction_samples;
|
||||||
corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<float>(d_fs_in)), T_prn_true_samples);
|
corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<double>(d_fs_in)), T_prn_true_samples);
|
||||||
if (corrected_acq_phase_samples < 0)
|
if (corrected_acq_phase_samples < 0)
|
||||||
{
|
{
|
||||||
corrected_acq_phase_samples = T_prn_mod_samples + corrected_acq_phase_samples;
|
corrected_acq_phase_samples = T_prn_mod_samples + corrected_acq_phase_samples;
|
||||||
@ -235,9 +238,9 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::start_tracking()
|
|||||||
|
|
||||||
d_carrier_lock_fail_counter = 0;
|
d_carrier_lock_fail_counter = 0;
|
||||||
d_rem_code_phase_samples = 0;
|
d_rem_code_phase_samples = 0;
|
||||||
d_rem_carr_phase_rad = 0;
|
d_rem_carr_phase_rad = 0.0;
|
||||||
d_acc_carrier_phase_rad = 0;
|
d_acc_carrier_phase_rad = 0.0;
|
||||||
d_acc_code_phase_secs = 0;
|
d_acc_code_phase_secs = 0.0;
|
||||||
|
|
||||||
d_code_phase_samples = d_acq_code_phase_samples;
|
d_code_phase_samples = d_acq_code_phase_samples;
|
||||||
|
|
||||||
@ -248,7 +251,6 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::start_tracking()
|
|||||||
std::cout << "Tracking start on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl;
|
std::cout << "Tracking start on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl;
|
||||||
LOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel;
|
LOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel;
|
||||||
|
|
||||||
|
|
||||||
// enable tracking
|
// enable tracking
|
||||||
d_pull_in = true;
|
d_pull_in = true;
|
||||||
d_enable_tracking = true;
|
d_enable_tracking = true;
|
||||||
@ -336,10 +338,10 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items, gr_vector_in
|
|||||||
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
|
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
|
||||||
{
|
{
|
||||||
// process vars
|
// process vars
|
||||||
double carr_error_hz;
|
double carr_error_hz = 0.0;
|
||||||
double carr_error_filt_hz;
|
double carr_error_filt_hz = 0.0;
|
||||||
double code_error_chips;
|
double code_error_chips = 0.0;
|
||||||
double code_error_filt_chips;
|
double code_error_filt_chips = 0.0;
|
||||||
|
|
||||||
// Block input data and block output stream pointers
|
// Block input data and block output stream pointers
|
||||||
const gr_complex* in = (gr_complex*) input_items[0]; //PRN start block alignment
|
const gr_complex* in = (gr_complex*) input_items[0]; //PRN start block alignment
|
||||||
@ -623,7 +625,11 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items, gr_vector_in
|
|||||||
|
|
||||||
consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
|
consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
|
||||||
d_sample_counter += d_current_prn_length_samples; //count for the processed samples
|
d_sample_counter += d_current_prn_length_samples; //count for the processed samples
|
||||||
//LOG(INFO)<<"GPS tracking output end on CH="<<this->d_channel << " SAMPLE STAMP="<<d_sample_counter<<std::endl;
|
|
||||||
|
if((noutput_items == 0) || (ninput_items[0] == 0))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "noutput_items = 0";
|
||||||
|
}
|
||||||
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,10 @@ gps_l1_ca_dll_pll_make_tracking_gpu_cc(
|
|||||||
void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::forecast (int noutput_items,
|
void Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::forecast (int noutput_items,
|
||||||
gr_vector_int &ninput_items_required)
|
gr_vector_int &ninput_items_required)
|
||||||
{
|
{
|
||||||
ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
|
if (noutput_items != 0)
|
||||||
|
{
|
||||||
|
ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -286,10 +289,10 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items, gr_vecto
|
|||||||
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
|
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
|
||||||
{
|
{
|
||||||
// process vars
|
// process vars
|
||||||
float carr_error_hz=0.0;
|
float carr_error_hz = 0.0;
|
||||||
float carr_error_filt_hz=0.0;
|
float carr_error_filt_hz = 0.0;
|
||||||
float code_error_chips=0.0;
|
float code_error_chips = 0.0;
|
||||||
float code_error_filt_chips=0.0;
|
float code_error_filt_chips = 0.0;
|
||||||
|
|
||||||
// Block input data and block output stream pointers
|
// Block input data and block output stream pointers
|
||||||
const gr_complex* in = (gr_complex*) input_items[0];
|
const gr_complex* in = (gr_complex*) input_items[0];
|
||||||
@ -541,7 +544,10 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items, gr_vecto
|
|||||||
|
|
||||||
consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
|
consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
|
||||||
d_sample_counter += d_current_prn_length_samples; //count for the processed samples
|
d_sample_counter += d_current_prn_length_samples; //count for the processed samples
|
||||||
//LOG(INFO)<<"GPS tracking output end on CH="<<this->d_channel << " SAMPLE STAMP="<<d_sample_counter<<std::endl;
|
if((noutput_items == 0) || (ninput_items[0] == 0))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "noutput_items = 0";
|
||||||
|
}
|
||||||
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,10 @@ gps_l1_ca_tcp_connector_make_tracking_cc(
|
|||||||
void Gps_L1_Ca_Tcp_Connector_Tracking_cc::forecast (int noutput_items,
|
void Gps_L1_Ca_Tcp_Connector_Tracking_cc::forecast (int noutput_items,
|
||||||
gr_vector_int &ninput_items_required)
|
gr_vector_int &ninput_items_required)
|
||||||
{
|
{
|
||||||
ninput_items_required[0] = (int)d_vector_length*2; //set the required available samples in each call
|
if (noutput_items != 0)
|
||||||
|
{
|
||||||
|
ninput_items_required[0] = (int)d_vector_length*2; //set the required available samples in each call
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -660,6 +663,10 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items, gr_vec
|
|||||||
consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
|
consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
|
||||||
d_sample_counter_seconds = d_sample_counter_seconds + ( ((double)d_current_prn_length_samples) / (double)d_fs_in );
|
d_sample_counter_seconds = d_sample_counter_seconds + ( ((double)d_current_prn_length_samples) / (double)d_fs_in );
|
||||||
d_sample_counter += d_current_prn_length_samples; //count for the processed samples
|
d_sample_counter += d_current_prn_length_samples; //count for the processed samples
|
||||||
|
if((noutput_items == 0) || (ninput_items[0] == 0))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "noutput_items = 0";
|
||||||
|
}
|
||||||
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +82,10 @@ gps_l2_m_dll_pll_make_tracking_cc(
|
|||||||
void gps_l2_m_dll_pll_tracking_cc::forecast (int noutput_items,
|
void gps_l2_m_dll_pll_tracking_cc::forecast (int noutput_items,
|
||||||
gr_vector_int &ninput_items_required)
|
gr_vector_int &ninput_items_required)
|
||||||
{
|
{
|
||||||
ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
|
if (noutput_items != 0)
|
||||||
|
{
|
||||||
|
ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -627,7 +630,10 @@ int gps_l2_m_dll_pll_tracking_cc::general_work (int noutput_items, gr_vector_int
|
|||||||
}
|
}
|
||||||
consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
|
consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
|
||||||
d_sample_counter += d_current_prn_length_samples; //count for the processed samples
|
d_sample_counter += d_current_prn_length_samples; //count for the processed samples
|
||||||
//LOG(INFO)<<"GPS L2 tracking output end on CH="<<this->d_channel << " SAMPLE STAMP="<<d_sample_counter<<std::endl;
|
if((noutput_items == 0) || (ninput_items[0] == 0))
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "noutput_items = 0";
|
||||||
|
}
|
||||||
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ gnss_sdr_supl_client::gnss_sdr_supl_client()
|
|||||||
lac = 0;
|
lac = 0;
|
||||||
ci = 0;
|
ci = 0;
|
||||||
supl_ctx_new(&ctx);
|
supl_ctx_new(&ctx);
|
||||||
assist = {0};
|
assist = {};
|
||||||
server_port = 0;
|
server_port = 0;
|
||||||
request = 0;
|
request = 0;
|
||||||
}
|
}
|
||||||
|
@ -1434,7 +1434,6 @@ int Rtcm::set_DF011(const Gnss_Synchro & gnss_synchro)
|
|||||||
int Rtcm::set_DF012(const Gnss_Synchro & gnss_synchro)
|
int Rtcm::set_DF012(const Gnss_Synchro & gnss_synchro)
|
||||||
{
|
{
|
||||||
const double lambda = GPS_C_m_s / GPS_L1_FREQ_HZ;
|
const double lambda = GPS_C_m_s / GPS_L1_FREQ_HZ;
|
||||||
double L1_pseudorange = gnss_synchro.Pseudorange_m;
|
|
||||||
double ambiguity = std::floor( gnss_synchro.Pseudorange_m / 299792.458 );
|
double ambiguity = std::floor( gnss_synchro.Pseudorange_m / 299792.458 );
|
||||||
double gps_L1_pseudorange = std::round(( gnss_synchro.Pseudorange_m - ambiguity * 299792.458) / 0.02 );
|
double gps_L1_pseudorange = std::round(( gnss_synchro.Pseudorange_m - ambiguity * 299792.458) / 0.02 );
|
||||||
double gps_L1_pseudorange_c = static_cast<double>(gps_L1_pseudorange) * 0.02 + ambiguity * 299792.458;
|
double gps_L1_pseudorange_c = static_cast<double>(gps_L1_pseudorange) * 0.02 + ambiguity * 299792.458;
|
||||||
|
@ -467,8 +467,8 @@ int Sbas_Telemetry_Data::getbits(const unsigned char *buff, int pos, int len)
|
|||||||
*-----------------------------------------------------------------------------*/
|
*-----------------------------------------------------------------------------*/
|
||||||
Sbas_Telemetry_Data::gtime_t Sbas_Telemetry_Data::epoch2time(const double *ep)
|
Sbas_Telemetry_Data::gtime_t Sbas_Telemetry_Data::epoch2time(const double *ep)
|
||||||
{
|
{
|
||||||
const int doy[]={1, 32, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335};
|
const int doy[] = {1, 32, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335};
|
||||||
gtime_t time = {0};
|
gtime_t time = {};
|
||||||
int days, sec, year = (int)ep[0], mon = (int)ep[1], day = (int)ep[2];
|
int days, sec, year = (int)ep[0], mon = (int)ep[1], day = (int)ep[2];
|
||||||
|
|
||||||
if (year < 1970 || 2099 < year || mon < 1 || 12 < mon) return time;
|
if (year < 1970 || 2099 < year || mon < 1 || 12 < mon) return time;
|
||||||
|
@ -30,8 +30,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "tracking_loop_filter.h"
|
#include "tracking_loop_filter.h"
|
||||||
#include "tracking_2nd_PLL_filter.h"
|
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
TEST(TrackingLoopFilterTest, FirstOrderLoop)
|
TEST(TrackingLoopFilterTest, FirstOrderLoop)
|
||||||
@ -51,21 +49,21 @@ TEST(TrackingLoopFilterTest, FirstOrderLoop)
|
|||||||
EXPECT_EQ( theFilter.get_include_last_integrator(), include_last_integrator );
|
EXPECT_EQ( theFilter.get_include_last_integrator(), include_last_integrator );
|
||||||
EXPECT_EQ( theFilter.get_order(), loop_order );
|
EXPECT_EQ( theFilter.get_order(), loop_order );
|
||||||
|
|
||||||
std::vector< float > sample_data = { 0, 0, 1.0, 0.0, 0.0, 0.0 };
|
std::vector< float > sample_data = { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 };
|
||||||
|
|
||||||
theFilter.initialize( 0.0 );
|
theFilter.initialize( 0.0 );
|
||||||
|
|
||||||
float g1 = noise_bandwidth*4.0;
|
float g1 = noise_bandwidth * 4.0;
|
||||||
|
|
||||||
float result = 0.0;
|
float result = 0.0;
|
||||||
for( unsigned int i = 0; i < sample_data.size(); ++i )
|
for( unsigned int i = 0; i < sample_data.size(); ++i )
|
||||||
{
|
{
|
||||||
result = theFilter.apply( sample_data[i] );
|
result = theFilter.apply( sample_data[i] );
|
||||||
|
EXPECT_FLOAT_EQ( result, sample_data[i]*g1 );
|
||||||
ASSERT_FLOAT_EQ( result, sample_data[i]*g1 );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TEST(TrackingLoopFilterTest, FirstOrderLoopWithLastIntegrator)
|
TEST(TrackingLoopFilterTest, FirstOrderLoopWithLastIntegrator)
|
||||||
{
|
{
|
||||||
int loop_order = 1;
|
int loop_order = 1;
|
||||||
@ -83,20 +81,17 @@ TEST(TrackingLoopFilterTest, FirstOrderLoopWithLastIntegrator)
|
|||||||
EXPECT_EQ( theFilter.get_include_last_integrator(), include_last_integrator );
|
EXPECT_EQ( theFilter.get_include_last_integrator(), include_last_integrator );
|
||||||
EXPECT_EQ( theFilter.get_order(), loop_order );
|
EXPECT_EQ( theFilter.get_order(), loop_order );
|
||||||
|
|
||||||
std::vector< float > sample_data = { 0, 0, 1.0, 0.0, 0.0, 0.0 };
|
std::vector< float > sample_data = { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 };
|
||||||
std::vector< float > expected_out = { 0.0, 0.0, 0.01, 0.02, 0.02, 0.02 };
|
std::vector< float > expected_out = { 0.0, 0.0, 0.01, 0.02, 0.02, 0.02 };
|
||||||
|
|
||||||
theFilter.initialize( 0.0 );
|
theFilter.initialize( 0.0 );
|
||||||
|
|
||||||
float g1 = noise_bandwidth*4.0;
|
|
||||||
|
|
||||||
float result = 0.0;
|
float result = 0.0;
|
||||||
for( unsigned int i = 0; i < sample_data.size(); ++i )
|
for( unsigned int i = 0; i < sample_data.size(); ++i )
|
||||||
{
|
{
|
||||||
result = theFilter.apply( sample_data[i] );
|
result = theFilter.apply( sample_data[i] );
|
||||||
ASSERT_NEAR( result, expected_out[i], 1e-4 );
|
EXPECT_NEAR( result, expected_out[i], 1e-4 );
|
||||||
}
|
}
|
||||||
std::cout << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -118,7 +113,7 @@ TEST(TrackingLoopFilterTest, SecondOrderLoop)
|
|||||||
EXPECT_EQ( theFilter.get_include_last_integrator(), include_last_integrator );
|
EXPECT_EQ( theFilter.get_include_last_integrator(), include_last_integrator );
|
||||||
EXPECT_EQ( theFilter.get_order(), loop_order );
|
EXPECT_EQ( theFilter.get_order(), loop_order );
|
||||||
|
|
||||||
std::vector< float > sample_data = { 0, 0, 1.0, 0.0, 0.0, 0.0 };
|
std::vector< float > sample_data = { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 };
|
||||||
std::vector< float > expected_out = { 0.0, 0.0, 13.37778, 0.0889, 0.0889, 0.0889 };
|
std::vector< float > expected_out = { 0.0, 0.0, 13.37778, 0.0889, 0.0889, 0.0889 };
|
||||||
|
|
||||||
theFilter.initialize( 0.0 );
|
theFilter.initialize( 0.0 );
|
||||||
@ -127,11 +122,11 @@ TEST(TrackingLoopFilterTest, SecondOrderLoop)
|
|||||||
for( unsigned int i = 0; i < sample_data.size(); ++i )
|
for( unsigned int i = 0; i < sample_data.size(); ++i )
|
||||||
{
|
{
|
||||||
result = theFilter.apply( sample_data[i] );
|
result = theFilter.apply( sample_data[i] );
|
||||||
|
EXPECT_NEAR( result, expected_out[i], 1e-4 );
|
||||||
ASSERT_NEAR( result, expected_out[i], 1e-4 );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TEST(TrackingLoopFilterTest, SecondOrderLoopWithLastIntegrator)
|
TEST(TrackingLoopFilterTest, SecondOrderLoopWithLastIntegrator)
|
||||||
{
|
{
|
||||||
int loop_order = 2;
|
int loop_order = 2;
|
||||||
@ -149,21 +144,17 @@ TEST(TrackingLoopFilterTest, SecondOrderLoopWithLastIntegrator)
|
|||||||
EXPECT_EQ( theFilter.get_include_last_integrator(), include_last_integrator );
|
EXPECT_EQ( theFilter.get_include_last_integrator(), include_last_integrator );
|
||||||
EXPECT_EQ( theFilter.get_order(), loop_order );
|
EXPECT_EQ( theFilter.get_order(), loop_order );
|
||||||
|
|
||||||
std::vector< float > sample_data = { 0, 0, 1.0, 0.0, 0.0, 0.0 };
|
std::vector< float > sample_data = { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 };
|
||||||
std::vector< float > expected_out = { 0.0, 0.0, 0.006689, 0.013422, 0.013511, 0.013600 };
|
std::vector< float > expected_out = { 0.0, 0.0, 0.006689, 0.013422, 0.013511, 0.013600 };
|
||||||
|
|
||||||
theFilter.initialize( 0.0 );
|
theFilter.initialize( 0.0 );
|
||||||
|
|
||||||
float g1 = noise_bandwidth*4.0;
|
|
||||||
|
|
||||||
float result = 0.0;
|
float result = 0.0;
|
||||||
for( unsigned int i = 0; i < sample_data.size(); ++i )
|
for( unsigned int i = 0; i < sample_data.size(); ++i )
|
||||||
{
|
{
|
||||||
result = theFilter.apply( sample_data[i] );
|
result = theFilter.apply( sample_data[i] );
|
||||||
|
EXPECT_NEAR( result, expected_out[i], 1e-4 );
|
||||||
ASSERT_NEAR( result, expected_out[i], 1e-4 );
|
|
||||||
}
|
}
|
||||||
std::cout << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -184,7 +175,7 @@ TEST(TrackingLoopFilterTest, ThirdOrderLoop)
|
|||||||
EXPECT_EQ( theFilter.get_include_last_integrator(), include_last_integrator );
|
EXPECT_EQ( theFilter.get_include_last_integrator(), include_last_integrator );
|
||||||
EXPECT_EQ( theFilter.get_order(), loop_order );
|
EXPECT_EQ( theFilter.get_order(), loop_order );
|
||||||
|
|
||||||
std::vector< float > sample_data = { 0, 0, 1.0, 0.0, 0.0, 0.0 };
|
std::vector< float > sample_data = { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 };
|
||||||
std::vector< float > expected_out = { 0.0, 0.0, 15.31877, 0.04494, 0.04520, 0.04546};
|
std::vector< float > expected_out = { 0.0, 0.0, 15.31877, 0.04494, 0.04520, 0.04546};
|
||||||
|
|
||||||
theFilter.initialize( 0.0 );
|
theFilter.initialize( 0.0 );
|
||||||
@ -193,11 +184,11 @@ TEST(TrackingLoopFilterTest, ThirdOrderLoop)
|
|||||||
for( unsigned int i = 0; i < sample_data.size(); ++i )
|
for( unsigned int i = 0; i < sample_data.size(); ++i )
|
||||||
{
|
{
|
||||||
result = theFilter.apply( sample_data[i] );
|
result = theFilter.apply( sample_data[i] );
|
||||||
|
EXPECT_NEAR( result, expected_out[i], 1e-4 );
|
||||||
ASSERT_NEAR( result, expected_out[i], 1e-4 );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TEST(TrackingLoopFilterTest, ThirdOrderLoopWithLastIntegrator)
|
TEST(TrackingLoopFilterTest, ThirdOrderLoopWithLastIntegrator)
|
||||||
{
|
{
|
||||||
int loop_order = 3;
|
int loop_order = 3;
|
||||||
@ -215,20 +206,17 @@ TEST(TrackingLoopFilterTest, ThirdOrderLoopWithLastIntegrator)
|
|||||||
EXPECT_EQ( theFilter.get_include_last_integrator(), include_last_integrator );
|
EXPECT_EQ( theFilter.get_include_last_integrator(), include_last_integrator );
|
||||||
EXPECT_EQ( theFilter.get_order(), loop_order );
|
EXPECT_EQ( theFilter.get_order(), loop_order );
|
||||||
|
|
||||||
std::vector< float > sample_data = { 0, 0, 1.0, 0.0, 0.0, 0.0 };
|
std::vector< float > sample_data = { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 };
|
||||||
std::vector< float > expected_out = { 0.0, 0.0, 0.007659, 0.015341, 0.015386, 0.015432};
|
std::vector< float > expected_out = { 0.0, 0.0, 0.007659, 0.015341, 0.015386, 0.015432};
|
||||||
|
|
||||||
theFilter.initialize( 0.0 );
|
theFilter.initialize( 0.0 );
|
||||||
|
|
||||||
float g1 = noise_bandwidth*4.0;
|
|
||||||
|
|
||||||
float result = 0.0;
|
float result = 0.0;
|
||||||
for( unsigned int i = 0; i < sample_data.size(); ++i )
|
for( unsigned int i = 0; i < sample_data.size(); ++i )
|
||||||
{
|
{
|
||||||
result = theFilter.apply( sample_data[i] );
|
result = theFilter.apply( sample_data[i] );
|
||||||
ASSERT_NEAR( result, expected_out[i], 1e-4 );
|
EXPECT_NEAR( result, expected_out[i], 1e-4 );
|
||||||
}
|
}
|
||||||
std::cout << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -73,6 +73,7 @@ DECLARE_string(log_dir);
|
|||||||
#include "arithmetic/magnitude_squared_test.cc"
|
#include "arithmetic/magnitude_squared_test.cc"
|
||||||
#include "arithmetic/multiply_test.cc"
|
#include "arithmetic/multiply_test.cc"
|
||||||
#include "arithmetic/code_generation_test.cc"
|
#include "arithmetic/code_generation_test.cc"
|
||||||
|
#include "arithmetic/tracking_loop_filter_test.cc"
|
||||||
#include "configuration/file_configuration_test.cc"
|
#include "configuration/file_configuration_test.cc"
|
||||||
#include "configuration/in_memory_configuration_test.cc"
|
#include "configuration/in_memory_configuration_test.cc"
|
||||||
#include "control_thread/control_message_factory_test.cc"
|
#include "control_thread/control_message_factory_test.cc"
|
||||||
|
Loading…
Reference in New Issue
Block a user