mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-06-17 22:14:10 +00:00
changing integer absolute value function 'abs' when argument is of
floating point type by std::abs
This commit is contained in:
parent
cec1aa2e75
commit
7cbc0a6efa
@ -262,13 +262,12 @@ void galileo_e5a_noncoherentIQ_acquisition_caf_cc::init()
|
|||||||
{
|
{
|
||||||
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()));
|
d_grid_doppler_wipeoffs[doppler_index] = static_cast<gr_complex*>(volk_malloc(d_fft_size * sizeof(gr_complex), volk_get_alignment()));
|
||||||
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
|
int doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
|
||||||
complex_exp_gen_conj(d_grid_doppler_wipeoffs[doppler_index],
|
complex_exp_gen_conj(d_grid_doppler_wipeoffs[doppler_index], d_freq + doppler, d_fs_in, d_fft_size);
|
||||||
d_freq + doppler, d_fs_in, d_fft_size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CAF Filtering to resolve doppler ambiguity. Phase and quadrature must be processed
|
/* CAF Filtering to resolve doppler ambiguity. Phase and quadrature must be processed
|
||||||
* separately before non-coherent integration */
|
* separately before non-coherent integration */
|
||||||
// if (d_CAF_filter)
|
// if (d_CAF_filter)
|
||||||
if (d_CAF_window_hz > 0)
|
if (d_CAF_window_hz > 0)
|
||||||
{
|
{
|
||||||
d_CAF_vector = static_cast<float*>(volk_malloc(d_num_doppler_bins * sizeof(float), volk_get_alignment()));
|
d_CAF_vector = static_cast<float*>(volk_malloc(d_num_doppler_bins * sizeof(float), volk_get_alignment()));
|
||||||
@ -480,14 +479,14 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
|||||||
{
|
{
|
||||||
if (magt_IA >= magt_IB)
|
if (magt_IA >= magt_IB)
|
||||||
{
|
{
|
||||||
// if (d_CAF_filter) {d_CAF_vector_I[doppler_index] = magt_IA;}
|
// if (d_CAF_filter) {d_CAF_vector_I[doppler_index] = magt_IA;}
|
||||||
if (d_CAF_window_hz > 0) {d_CAF_vector_I[doppler_index] = d_magnitudeIA[indext_IA];}
|
if (d_CAF_window_hz > 0) {d_CAF_vector_I[doppler_index] = d_magnitudeIA[indext_IA];}
|
||||||
if (d_both_signal_components)
|
if (d_both_signal_components)
|
||||||
{
|
{
|
||||||
// Integrate non-coherently I+Q
|
// Integrate non-coherently I+Q
|
||||||
if (magt_QA >= magt_QB)
|
if (magt_QA >= magt_QB)
|
||||||
{
|
{
|
||||||
// if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QA;}
|
// if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QA;}
|
||||||
if (d_CAF_window_hz > 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQA[indext_QA];}
|
if (d_CAF_window_hz > 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQA[indext_QA];}
|
||||||
for (unsigned int i=0; i<d_fft_size; i++)
|
for (unsigned int i=0; i<d_fft_size; i++)
|
||||||
{
|
{
|
||||||
@ -496,7 +495,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QB;}
|
// if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QB;}
|
||||||
if (d_CAF_window_hz > 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQB[indext_QB];}
|
if (d_CAF_window_hz > 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQB[indext_QB];}
|
||||||
for (unsigned int i=0; i<d_fft_size; i++)
|
for (unsigned int i=0; i<d_fft_size; i++)
|
||||||
{
|
{
|
||||||
@ -509,7 +508,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// if (d_CAF_filter) {d_CAF_vector_I[doppler_index] = magt_IB;}
|
// if (d_CAF_filter) {d_CAF_vector_I[doppler_index] = magt_IB;}
|
||||||
if (d_CAF_window_hz > 0) {d_CAF_vector_I[doppler_index] = d_magnitudeIB[indext_IB];}
|
if (d_CAF_window_hz > 0) {d_CAF_vector_I[doppler_index] = d_magnitudeIB[indext_IB];}
|
||||||
if (d_both_signal_components)
|
if (d_both_signal_components)
|
||||||
{
|
{
|
||||||
@ -525,7 +524,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QB;}
|
// if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QB;}
|
||||||
if (d_CAF_window_hz > 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQB[indext_QB];}
|
if (d_CAF_window_hz > 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQB[indext_QB];}
|
||||||
for (unsigned int i=0; i<d_fft_size; i++)
|
for (unsigned int i=0; i<d_fft_size; i++)
|
||||||
{
|
{
|
||||||
@ -539,11 +538,11 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// if (d_CAF_filter) {d_CAF_vector_I[doppler_index] = magt_IA;}
|
// if (d_CAF_filter) {d_CAF_vector_I[doppler_index] = magt_IA;}
|
||||||
if (d_CAF_window_hz > 0) {d_CAF_vector_I[doppler_index] = d_magnitudeIA[indext_IA];}
|
if (d_CAF_window_hz > 0) {d_CAF_vector_I[doppler_index] = d_magnitudeIA[indext_IA];}
|
||||||
if (d_both_signal_components)
|
if (d_both_signal_components)
|
||||||
{
|
{
|
||||||
// if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QA;}
|
// if (d_CAF_filter) {d_CAF_vector_Q[doppler_index] = magt_QA;}
|
||||||
if (d_CAF_window_hz > 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQA[indext_QA];}
|
if (d_CAF_window_hz > 0) {d_CAF_vector_Q[doppler_index] = d_magnitudeQA[indext_QA];}
|
||||||
// NON-Coherent integration of only 1 code
|
// NON-Coherent integration of only 1 code
|
||||||
for (unsigned int i=0; i<d_fft_size; i++)
|
for (unsigned int i=0; i<d_fft_size; i++)
|
||||||
@ -604,7 +603,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
|||||||
d_dump_file.close();
|
d_dump_file.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// std::cout << "d_mag " << d_mag << ".d_sample_counter " << d_sample_counter << ". acq delay " << d_gnss_synchro->Acq_delay_samples<< " indext "<< indext << std::endl;
|
// std::cout << "d_mag " << d_mag << ".d_sample_counter " << d_sample_counter << ". acq delay " << d_gnss_synchro->Acq_delay_samples<< " indext "<< indext << std::endl;
|
||||||
// 6 OPTIONAL: CAF filter to avoid Doppler ambiguity in bit transition.
|
// 6 OPTIONAL: CAF filter to avoid Doppler ambiguity in bit transition.
|
||||||
if (d_CAF_window_hz > 0)
|
if (d_CAF_window_hz > 0)
|
||||||
{
|
{
|
||||||
@ -622,7 +621,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
|||||||
// 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);
|
||||||
for (int i = 0; i < CAF_bins_half + doppler_index + 1; i++)
|
for (int i = 0; i < CAF_bins_half + doppler_index + 1; i++)
|
||||||
{
|
{
|
||||||
d_CAF_vector[doppler_index] += d_CAF_vector_I[i] * (1 - weighting_factor * static_cast<unsigned int>(abs(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]
|
||||||
@ -630,12 +629,12 @@ 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, CAF_bins_half+doppler_index+1);
|
// volk_32f_accumulator_s32f_a(&accum[0], d_CAF_vector_Q, CAF_bins_half+doppler_index+1);
|
||||||
for (int i = 0; i < CAF_bins_half+doppler_index+1; i++)
|
for (int i = 0; i < CAF_bins_half + doppler_index + 1; i++)
|
||||||
{
|
{
|
||||||
accum[0] += d_CAF_vector_Q[i] * (1 - weighting_factor * static_cast<unsigned int>(abs(doppler_index - i)));
|
accum[0] += d_CAF_vector_Q[i] * (1 - weighting_factor * static_cast<unsigned int>(abs(doppler_index - i)));
|
||||||
}
|
}
|
||||||
// accum[0] /= CAF_bins_half+doppler_index+1;
|
// accum[0] /= CAF_bins_half+doppler_index+1;
|
||||||
accum[0] /= 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]
|
accum[0] /= 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] += accum[0];
|
d_CAF_vector[doppler_index] += accum[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -644,27 +643,27 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
|||||||
{
|
{
|
||||||
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 < doppler_index+CAF_bins_half + 1; i++)
|
||||||
{
|
{
|
||||||
d_CAF_vector[doppler_index] += d_CAF_vector_I[i] * (1-weighting_factor * static_cast<unsigned int>(abs(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 < doppler_index + CAF_bins_half + 1; i++)
|
||||||
{
|
{
|
||||||
accum[0] += d_CAF_vector_Q[i] * (1 -weighting_factor * static_cast<unsigned int>(abs(doppler_index - i)));
|
accum[0] += d_CAF_vector_Q[i] * (1 - weighting_factor * static_cast<unsigned int>((doppler_index - i)));
|
||||||
}
|
}
|
||||||
// accum[0] /= 2*CAF_bins_half+1;
|
// accum[0] /= 2*CAF_bins_half+1;
|
||||||
accum[0] /= 1+2*CAF_bins_half - 2*weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2;
|
accum[0] /= 1 + 2 * CAF_bins_half - 2 * weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2;
|
||||||
d_CAF_vector[doppler_index] += accum[0];
|
d_CAF_vector[doppler_index] += accum[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Final iterations
|
// Final iterations
|
||||||
for (unsigned 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 < 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));
|
||||||
@ -673,7 +672,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 * (abs(doppler_index - i)));
|
d_CAF_vector[doppler_index] += d_CAF_vector_I[i] * (1 - weighting_factor * (abs(doppler_index - i)));
|
||||||
}
|
}
|
||||||
// d_CAF_vector[doppler_index] /= CAF_bins_half+(d_num_doppler_bins-doppler_index);
|
// d_CAF_vector[doppler_index] /= CAF_bins_half+(d_num_doppler_bins-doppler_index);
|
||||||
d_CAF_vector[doppler_index] /= 1+CAF_bins_half+(d_num_doppler_bins-doppler_index-1) - weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2 - weighting_factor * (d_num_doppler_bins - doppler_index - 1) * (d_num_doppler_bins - doppler_index) / 2;
|
d_CAF_vector[doppler_index] /= 1 + CAF_bins_half + (d_num_doppler_bins - doppler_index - 1) - weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2 - weighting_factor * (d_num_doppler_bins - doppler_index - 1) * (d_num_doppler_bins - doppler_index) / 2;
|
||||||
if (d_both_signal_components)
|
if (d_both_signal_components)
|
||||||
{
|
{
|
||||||
accum[0] = 0;
|
accum[0] = 0;
|
||||||
@ -698,8 +697,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
|
|||||||
std::stringstream filename;
|
std::stringstream filename;
|
||||||
std::streamsize n = sizeof(float) * (d_num_doppler_bins); // noncomplex file write
|
std::streamsize n = sizeof(float) * (d_num_doppler_bins); // noncomplex file write
|
||||||
filename.str("");
|
filename.str("");
|
||||||
filename << "../data/test_statistics_E5a_sat_"
|
filename << "../data/test_statistics_E5a_sat_" << d_gnss_synchro->PRN << "_CAF.dat";
|
||||||
<< d_gnss_synchro->PRN << "_CAF.dat";
|
|
||||||
d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
|
d_dump_file.open(filename.str().c_str(), std::ios::out | std::ios::binary);
|
||||||
d_dump_file.write((char*)d_CAF_vector, n);
|
d_dump_file.write((char*)d_CAF_vector, n);
|
||||||
d_dump_file.close();
|
d_dump_file.close();
|
||||||
|
@ -356,14 +356,14 @@ int pcps_acquisition_fine_doppler_cc::estimate_Doppler(gr_vector_const_void_star
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 5. Update the Doppler estimation in Hz
|
// 5. Update the Doppler estimation in Hz
|
||||||
if (abs(fftFreqBins[tmp_index_freq] - d_gnss_synchro->Acq_doppler_hz) < 1000)
|
if (std::abs(fftFreqBins[tmp_index_freq] - d_gnss_synchro->Acq_doppler_hz) < 1000)
|
||||||
{
|
{
|
||||||
d_gnss_synchro->Acq_doppler_hz = static_cast<double>(fftFreqBins[tmp_index_freq]);
|
d_gnss_synchro->Acq_doppler_hz = static_cast<double>(fftFreqBins[tmp_index_freq]);
|
||||||
//std::cout<<"FFT maximum present at "<<fftFreqBins[tmp_index_freq]<<" [Hz]"<<std::endl;
|
//std::cout<<"FFT maximum present at "<<fftFreqBins[tmp_index_freq]<<" [Hz]"<<std::endl;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DLOG(INFO) << "Abs(Grid Doppler - FFT Doppler)=" << abs(fftFreqBins[tmp_index_freq] - d_gnss_synchro->Acq_doppler_hz);
|
DLOG(INFO) << "Abs(Grid Doppler - FFT Doppler)=" << std::abs(fftFreqBins[tmp_index_freq] - d_gnss_synchro->Acq_doppler_hz);
|
||||||
DLOG(INFO) << "Error estimating fine frequency Doppler";
|
DLOG(INFO) << "Error estimating fine frequency Doppler";
|
||||||
//debug log
|
//debug log
|
||||||
//
|
//
|
||||||
|
@ -326,7 +326,7 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items, gr_vector
|
|||||||
if (abs(corr_value) >= d_symbols_per_preamble)
|
if (abs(corr_value) >= d_symbols_per_preamble)
|
||||||
{
|
{
|
||||||
//check preamble separation
|
//check preamble separation
|
||||||
preamble_diff = abs(d_sample_counter - d_preamble_index);
|
preamble_diff = d_sample_counter - d_preamble_index;
|
||||||
if (abs(preamble_diff - GALILEO_INAV_PREAMBLE_PERIOD_SYMBOLS) == 0)
|
if (abs(preamble_diff - GALILEO_INAV_PREAMBLE_PERIOD_SYMBOLS) == 0)
|
||||||
{
|
{
|
||||||
//try to decode frame
|
//try to decode frame
|
||||||
|
@ -209,7 +209,7 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items, gr_vector_i
|
|||||||
}
|
}
|
||||||
else if (d_stat == 1) //check 6 seconds of preamble separation
|
else if (d_stat == 1) //check 6 seconds of preamble separation
|
||||||
{
|
{
|
||||||
preamble_diff = abs(d_sample_counter - d_preamble_index);
|
preamble_diff = d_sample_counter - d_preamble_index;
|
||||||
if (abs(preamble_diff - 6000) < 1)
|
if (abs(preamble_diff - 6000) < 1)
|
||||||
{
|
{
|
||||||
d_GPS_FSM.Event_gps_word_preamble();
|
d_GPS_FSM.Event_gps_word_preamble();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* \file Galileo_Navigation_Message.cc
|
* \file galileo_navigation_message.cc
|
||||||
* \brief Implementation of a Galileo I/NAV Data message
|
* \brief Implementation of a Galileo I/NAV Data message
|
||||||
* as described in Galileo OS SIS ICD Issue 1.1 (Sept. 2010)
|
* as described in Galileo OS SIS ICD Issue 1.1 (Sept. 2010)
|
||||||
* \author Mara Branzanti 2013. mara.branzanti(at)gmail.com
|
* \author Mara Branzanti 2013. mara.branzanti(at)gmail.com
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "galileo_utc_model.h"
|
#include "galileo_utc_model.h"
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
Galileo_Utc_Model::Galileo_Utc_Model()
|
Galileo_Utc_Model::Galileo_Utc_Model()
|
||||||
{
|
{
|
||||||
@ -57,7 +58,7 @@ double Galileo_Utc_Model::GST_to_UTC_time(double t_e, int WN)
|
|||||||
{
|
{
|
||||||
//Detect if the effectivity time and user's time is within six hours = 6 * 60 *60 = 21600 s
|
//Detect if the effectivity time and user's time is within six hours = 6 * 60 *60 = 21600 s
|
||||||
int secondOfLeapSecondEvent = DN_6 * 24 * 60 * 60;
|
int secondOfLeapSecondEvent = DN_6 * 24 * 60 * 60;
|
||||||
if (abs(t_e - secondOfLeapSecondEvent) > 21600)
|
if (std::abs(t_e - secondOfLeapSecondEvent) > 21600)
|
||||||
{
|
{
|
||||||
/* 5.1.7a GST->UTC case a
|
/* 5.1.7a GST->UTC case a
|
||||||
* Whenever the leap second adjusted time indicated by the WN_LSF and the DN values
|
* Whenever the leap second adjusted time indicated by the WN_LSF and the DN values
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "gps_navigation_message.h"
|
#include "gps_navigation_message.h"
|
||||||
|
#include <cmath>
|
||||||
#include "boost/date_time/posix_time/posix_time.hpp"
|
#include "boost/date_time/posix_time/posix_time.hpp"
|
||||||
|
|
||||||
|
|
||||||
@ -697,7 +698,7 @@ double Gps_Navigation_Message::utc_time(const double gpstime_corrected) const
|
|||||||
}
|
}
|
||||||
else //we are in the same week than the leap second event
|
else //we are in the same week than the leap second event
|
||||||
{
|
{
|
||||||
if (abs(gpstime_corrected - secondOfLeapSecondEvent) > 21600)
|
if (std::abs(gpstime_corrected - secondOfLeapSecondEvent) > 21600)
|
||||||
{
|
{
|
||||||
/* 20.3.3.5.2.4a
|
/* 20.3.3.5.2.4a
|
||||||
* Whenever the effectivity time indicated by the WN_LSF and the DN values
|
* Whenever the effectivity time indicated by the WN_LSF and the DN values
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "gps_utc_model.h"
|
#include "gps_utc_model.h"
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
Gps_Utc_Model::Gps_Utc_Model()
|
Gps_Utc_Model::Gps_Utc_Model()
|
||||||
{
|
{
|
||||||
@ -62,7 +63,7 @@ double Gps_Utc_Model::utc_time(double gpstime_corrected, int i_GPS_week)
|
|||||||
}
|
}
|
||||||
else //we are in the same week than the leap second event
|
else //we are in the same week than the leap second event
|
||||||
{
|
{
|
||||||
if (abs(gpstime_corrected - secondOfLeapSecondEvent) > 21600)
|
if (std::abs(gpstime_corrected - secondOfLeapSecondEvent) > 21600)
|
||||||
{
|
{
|
||||||
/* 20.3.3.5.2.4a
|
/* 20.3.3.5.2.4a
|
||||||
* Whenever the effectivity time indicated by the WN_LSF and the DN values
|
* Whenever the effectivity time indicated by the WN_LSF and the DN values
|
||||||
|
@ -28,10 +28,11 @@
|
|||||||
* -------------------------------------------------------------------------
|
* -------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <cmath>
|
||||||
#include <stdio.h>
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <glog/logging.h>
|
#include <glog/logging.h>
|
||||||
#include "sbas_telemetry_data.h"
|
#include "sbas_telemetry_data.h"
|
||||||
#include "sbas_ionospheric_correction.h"
|
#include "sbas_ionospheric_correction.h"
|
||||||
@ -722,7 +723,7 @@ int Sbas_Telemetry_Data::decode_sbstype9(const sbsmsg_t *msg, nav_t *nav)
|
|||||||
seph.af1 = getbits(msg->msg, 218, 8)*P2_39/2.0;
|
seph.af1 = getbits(msg->msg, 218, 8)*P2_39/2.0;
|
||||||
|
|
||||||
i = msg->prn-MINPRNSBS;
|
i = msg->prn-MINPRNSBS;
|
||||||
if (!nav->seph || fabs(nav->seph[i].t0 - seph.t0) < 1E-3)
|
if (!nav->seph || std::abs(nav->seph[i].t0 - seph.t0) < 1E-3)
|
||||||
{ /* not change */
|
{ /* not change */
|
||||||
VLOG(FLOW) << "<<T>> no change in ephemeris -> won't parse";
|
VLOG(FLOW) << "<<T>> no change in ephemeris -> won't parse";
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -320,8 +320,8 @@ void GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test::process_message()
|
|||||||
detection_counter++;
|
detection_counter++;
|
||||||
|
|
||||||
// The term -5 is here to correct the additional delay introduced by the FIR filter
|
// The term -5 is here to correct the additional delay introduced by the FIR filter
|
||||||
double delay_error_chips = abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
|
double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
|
||||||
double doppler_error_hz = abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
||||||
|
|
||||||
mse_delay += std::pow(delay_error_chips, 2);
|
mse_delay += std::pow(delay_error_chips, 2);
|
||||||
mse_doppler += std::pow(doppler_error_hz, 2);
|
mse_doppler += std::pow(doppler_error_hz, 2);
|
||||||
|
@ -323,8 +323,8 @@ void GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test::process_message()
|
|||||||
detection_counter++;
|
detection_counter++;
|
||||||
|
|
||||||
// The term -5 is here to correct the additional delay introduced by the FIR filter
|
// The term -5 is here to correct the additional delay introduced by the FIR filter
|
||||||
double delay_error_chips = abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
|
double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
|
||||||
double doppler_error_hz = abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
||||||
|
|
||||||
mse_delay += std::pow(delay_error_chips, 2);
|
mse_delay += std::pow(delay_error_chips, 2);
|
||||||
mse_doppler += std::pow(doppler_error_hz, 2);
|
mse_doppler += std::pow(doppler_error_hz, 2);
|
||||||
|
@ -240,9 +240,9 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ValidationOfResults)
|
|||||||
std::cout << "Delay: " << gnss_synchro.Acq_delay_samples << std::endl;
|
std::cout << "Delay: " << gnss_synchro.Acq_delay_samples << std::endl;
|
||||||
std::cout << "Doppler: " << gnss_synchro.Acq_doppler_hz << std::endl;
|
std::cout << "Doppler: " << gnss_synchro.Acq_doppler_hz << std::endl;
|
||||||
|
|
||||||
double delay_error_samples = abs(expected_delay_samples - gnss_synchro.Acq_delay_samples);
|
double delay_error_samples = std::abs(expected_delay_samples - gnss_synchro.Acq_delay_samples);
|
||||||
float delay_error_chips = (float)(delay_error_samples * 1023 / 4000000);
|
float delay_error_chips = (float)(delay_error_samples * 1023 / 4000000);
|
||||||
double doppler_error_hz = abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
||||||
|
|
||||||
EXPECT_LE(doppler_error_hz, 166) << "Doppler error exceeds the expected value: 166 Hz = 2/(3*integration period)";
|
EXPECT_LE(doppler_error_hz, 166) << "Doppler error exceeds the expected value: 166 Hz = 2/(3*integration period)";
|
||||||
EXPECT_LT(delay_error_chips, 0.175) << "Delay error exceeds the expected value: 0.175 chips";
|
EXPECT_LT(delay_error_chips, 0.175) << "Delay error exceeds the expected value: 0.175 chips";
|
||||||
|
@ -321,8 +321,8 @@ void GalileoE1PcpsCccwsrAmbiguousAcquisitionTest::process_message()
|
|||||||
detection_counter++;
|
detection_counter++;
|
||||||
|
|
||||||
// The term -5 is here to correct the additional delay introduced by the FIR filter
|
// The term -5 is here to correct the additional delay introduced by the FIR filter
|
||||||
double delay_error_chips = abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
|
double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
|
||||||
double doppler_error_hz = abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
||||||
|
|
||||||
mse_delay += std::pow(delay_error_chips, 2);
|
mse_delay += std::pow(delay_error_chips, 2);
|
||||||
mse_doppler += std::pow(doppler_error_hz, 2);
|
mse_doppler += std::pow(doppler_error_hz, 2);
|
||||||
|
@ -436,8 +436,8 @@ void GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test::process_message()
|
|||||||
detection_counter++;
|
detection_counter++;
|
||||||
|
|
||||||
// The term -5 is here to correct the additional delay introduced by the FIR filter
|
// The term -5 is here to correct the additional delay introduced by the FIR filter
|
||||||
double delay_error_chips = abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples - 5) * 1023.0 / ((double)fs_in * 1e-3));
|
double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples - 5) * 1023.0 / ((double)fs_in * 1e-3));
|
||||||
double doppler_error_hz = abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
||||||
|
|
||||||
mse_delay += std::pow(delay_error_chips, 2);
|
mse_delay += std::pow(delay_error_chips, 2);
|
||||||
mse_doppler += std::pow(doppler_error_hz, 2);
|
mse_doppler += std::pow(doppler_error_hz, 2);
|
||||||
|
@ -328,8 +328,8 @@ void GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test::process_message()
|
|||||||
detection_counter++;
|
detection_counter++;
|
||||||
|
|
||||||
// The term -5 is here to correct the additional delay introduced by the FIR filter
|
// The term -5 is here to correct the additional delay introduced by the FIR filter
|
||||||
double delay_error_chips = abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
|
double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
|
||||||
double doppler_error_hz = abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
||||||
|
|
||||||
mse_delay += std::pow(delay_error_chips, 2);
|
mse_delay += std::pow(delay_error_chips, 2);
|
||||||
mse_doppler += std::pow(doppler_error_hz, 2);
|
mse_doppler += std::pow(doppler_error_hz, 2);
|
||||||
|
@ -446,20 +446,20 @@ void GalileoE5aPcpsAcquisitionGSoC2014GensourceTest::process_message()
|
|||||||
switch (sat)
|
switch (sat)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
delay_error_chips = abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*10230.0/((double)fs_in*1e-3));
|
delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*10230.0/((double)fs_in*1e-3));
|
||||||
doppler_error_hz = abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
delay_error_chips = abs((double)expected_delay_chips1 - (double)(gnss_synchro.Acq_delay_samples-5)*10230.0/((double)fs_in*1e-3));
|
delay_error_chips = std::abs((double)expected_delay_chips1 - (double)(gnss_synchro.Acq_delay_samples-5)*10230.0/((double)fs_in*1e-3));
|
||||||
doppler_error_hz = abs(expected_doppler_hz1 - gnss_synchro.Acq_doppler_hz);
|
doppler_error_hz = std::abs(expected_doppler_hz1 - gnss_synchro.Acq_doppler_hz);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
delay_error_chips = abs((double)expected_delay_chips2 - (double)(gnss_synchro.Acq_delay_samples-5)*10230.0/((double)fs_in*1e-3));
|
delay_error_chips = std::abs((double)expected_delay_chips2 - (double)(gnss_synchro.Acq_delay_samples-5)*10230.0/((double)fs_in*1e-3));
|
||||||
doppler_error_hz = abs(expected_doppler_hz2 - gnss_synchro.Acq_doppler_hz);
|
doppler_error_hz = std::abs(expected_doppler_hz2 - gnss_synchro.Acq_doppler_hz);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
delay_error_chips = abs((double)expected_delay_chips3 - (double)(gnss_synchro.Acq_delay_samples-5)*10230.0/((double)fs_in*1e-3));
|
delay_error_chips = std::abs((double)expected_delay_chips3 - (double)(gnss_synchro.Acq_delay_samples-5)*10230.0/((double)fs_in*1e-3));
|
||||||
doppler_error_hz = abs(expected_doppler_hz3 - gnss_synchro.Acq_doppler_hz);
|
doppler_error_hz = std::abs(expected_doppler_hz3 - gnss_synchro.Acq_doppler_hz);
|
||||||
break;
|
break;
|
||||||
default: // case 3
|
default: // case 3
|
||||||
std::cout << "Error: message from unexpected acquisition channel" << std::endl;
|
std::cout << "Error: message from unexpected acquisition channel" << std::endl;
|
||||||
|
@ -318,8 +318,8 @@ void GpsL1CaPcpsAcquisitionGSoC2013Test::process_message()
|
|||||||
detection_counter++;
|
detection_counter++;
|
||||||
|
|
||||||
// The term -5 is here to correct the additional delay introduced by the FIR filter
|
// The term -5 is here to correct the additional delay introduced by the FIR filter
|
||||||
double delay_error_chips = abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
|
double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
|
||||||
double doppler_error_hz = abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
||||||
|
|
||||||
mse_delay += std::pow(delay_error_chips, 2);
|
mse_delay += std::pow(delay_error_chips, 2);
|
||||||
mse_doppler += std::pow(doppler_error_hz, 2);
|
mse_doppler += std::pow(doppler_error_hz, 2);
|
||||||
|
@ -322,8 +322,8 @@ void GpsL1CaPcpsMultithreadAcquisitionGSoC2013Test::process_message()
|
|||||||
detection_counter++;
|
detection_counter++;
|
||||||
|
|
||||||
// The term -5 is here to correct the additional delay introduced by the FIR filter
|
// The term -5 is here to correct the additional delay introduced by the FIR filter
|
||||||
double delay_error_chips = abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
|
double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
|
||||||
double doppler_error_hz = abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
||||||
|
|
||||||
mse_delay += std::pow(delay_error_chips, 2);
|
mse_delay += std::pow(delay_error_chips, 2);
|
||||||
mse_doppler += std::pow(doppler_error_hz, 2);
|
mse_doppler += std::pow(doppler_error_hz, 2);
|
||||||
|
@ -317,8 +317,8 @@ void GpsL1CaPcpsOpenClAcquisitionGSoC2013Test::process_message()
|
|||||||
detection_counter++;
|
detection_counter++;
|
||||||
|
|
||||||
// The term -5 is here to correct the additional delay introduced by the FIR filter
|
// The term -5 is here to correct the additional delay introduced by the FIR filter
|
||||||
double delay_error_chips = abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples- 5 )*1023.0/((double)fs_in*1e-3));
|
double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples- 5 )*1023.0/((double)fs_in*1e-3));
|
||||||
double doppler_error_hz = abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
||||||
|
|
||||||
mse_delay += std::pow(delay_error_chips, 2);
|
mse_delay += std::pow(delay_error_chips, 2);
|
||||||
mse_doppler += std::pow(doppler_error_hz, 2);
|
mse_doppler += std::pow(doppler_error_hz, 2);
|
||||||
|
@ -429,8 +429,8 @@ void GpsL1CaPcpsQuickSyncAcquisitionGSoC2014Test::process_message()
|
|||||||
detection_counter++;
|
detection_counter++;
|
||||||
|
|
||||||
// The term -5 is here to correct the additional delay introduced by the FIR filter
|
// The term -5 is here to correct the additional delay introduced by the FIR filter
|
||||||
double delay_error_chips = abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples - 5) * 1023.0/ ((double)fs_in * 1e-3));
|
double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples - 5) * 1023.0/ ((double)fs_in * 1e-3));
|
||||||
double doppler_error_hz = abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
||||||
|
|
||||||
mse_delay += std::pow(delay_error_chips, 2);
|
mse_delay += std::pow(delay_error_chips, 2);
|
||||||
mse_doppler += std::pow(doppler_error_hz, 2);
|
mse_doppler += std::pow(doppler_error_hz, 2);
|
||||||
|
@ -319,8 +319,8 @@ void GpsL1CaPcpsTongAcquisitionGSoC2013Test::process_message()
|
|||||||
detection_counter++;
|
detection_counter++;
|
||||||
|
|
||||||
// The term -5 is here to correct the additional delay introduced by the FIR filter
|
// The term -5 is here to correct the additional delay introduced by the FIR filter
|
||||||
double delay_error_chips = abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
|
double delay_error_chips = std::abs((double)expected_delay_chips - (double)(gnss_synchro.Acq_delay_samples-5)*1023.0/((double)fs_in*1e-3));
|
||||||
double doppler_error_hz = abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
double doppler_error_hz = std::abs(expected_doppler_hz - gnss_synchro.Acq_doppler_hz);
|
||||||
|
|
||||||
mse_delay += std::pow(delay_error_chips, 2);
|
mse_delay += std::pow(delay_error_chips, 2);
|
||||||
mse_doppler += std::pow(doppler_error_hz, 2);
|
mse_doppler += std::pow(doppler_error_hz, 2);
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
* -------------------------------------------------------------------------
|
* -------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include <boost/thread.hpp>
|
#include <boost/thread.hpp>
|
||||||
|
@ -29,9 +29,7 @@
|
|||||||
* -------------------------------------------------------------------------
|
* -------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user