diff --git a/CMakeLists.txt b/CMakeLists.txt index ac275151c..13b5ae872 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -338,7 +338,7 @@ set(GNSSSDR_PYTHON3_MIN_VERSION "3.4") set(GNSSSDR_ARMADILLO_LOCAL_VERSION "12.6.x") set(GNSSSDR_GFLAGS_LOCAL_VERSION "2.2.2") set(GNSSSDR_GLOG_LOCAL_VERSION "0.6.0") -set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.23") +set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.24") set(GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION "24.4") set(GNSSSDR_PUGIXML_LOCAL_VERSION "1.14") set(GNSSSDR_GTEST_LOCAL_VERSION "1.13.0") diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc index 311122427..2257e51f0 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/lib/qa_utils.cc @@ -33,59 +33,94 @@ void random_values(T *buf, unsigned int n, std::default_random_engine &e1) void load_random_data(void *data, volk_gnsssdr_type_t type, unsigned int n) { - std::random_device r; - std::default_random_engine e1(r()); - std::default_random_engine e2(r()); + std::random_device rnd_device; + std::default_random_engine rnd_engine(rnd_device()); if (type.is_complex) n *= 2; if (type.is_float) { if (type.size == 8) - random_values((double *)data, n, e1); + random_values((double *)data, n, rnd_engine); else - random_values((float *)data, n, e1); + random_values((float *)data, n, rnd_engine); } else { - float int_max = float(uint64_t(2) << (type.size * 8)); - if (type.is_signed) int_max /= 2.0; - std::uniform_real_distribution uniform_dist(-int_max, int_max); - for (unsigned int i = 0; i < n; i++) + switch (type.size) { - float scaled_rand = uniform_dist(e2); - - switch (type.size) + case 8: + if (type.is_signed) { - case 8: - if (type.is_signed) - ((int64_t *)data)[i] = (int64_t)scaled_rand; - else - ((uint64_t *)data)[i] = (uint64_t)scaled_rand; - break; - case 4: - if (type.is_signed) - ((int32_t *)data)[i] = (int32_t)scaled_rand; - else - ((uint32_t *)data)[i] = (uint32_t)scaled_rand; - break; - case 2: - // 16 bit multiplication saturates very fast - // we produce here only 3 bits input range - if (type.is_signed) - ((int16_t *)data)[i] = (int16_t)((int16_t)scaled_rand % 8); - else - ((uint16_t *)data)[i] = (uint16_t)(int16_t)((int16_t)scaled_rand % 8); - break; - case 1: - if (type.is_signed) - ((int8_t *)data)[i] = (int8_t)scaled_rand; - else - ((uint8_t *)data)[i] = (uint8_t)scaled_rand; - break; - default: - throw "load_random_data: no support for data size > 8 or < 1"; // no shenanigans here + std::uniform_int_distribution uniform_dist( + std::numeric_limits::min(), + std::numeric_limits::max()); + for (unsigned int i = 0; i < n; i++) + ((int64_t *)data)[i] = uniform_dist(rnd_engine); } + else + { + std::uniform_int_distribution uniform_dist( + std::numeric_limits::min(), + std::numeric_limits::max()); + for (unsigned int i = 0; i < n; i++) + ((uint64_t *)data)[i] = uniform_dist(rnd_engine); + } + break; + case 4: + if (type.is_signed) + { + std::uniform_int_distribution uniform_dist( + std::numeric_limits::min(), + std::numeric_limits::max()); + for (unsigned int i = 0; i < n; i++) + ((int32_t *)data)[i] = uniform_dist(rnd_engine); + } + else + { + std::uniform_int_distribution uniform_dist( + std::numeric_limits::min(), + std::numeric_limits::max()); + for (unsigned int i = 0; i < n; i++) + ((uint32_t *)data)[i] = uniform_dist(rnd_engine); + } + break; + case 2: + if (type.is_signed) + { + std::uniform_int_distribution uniform_dist(-7, 7); + for (unsigned int i = 0; i < n; i++) + ((int16_t *)data)[i] = uniform_dist(rnd_engine); + } + else + { + std::uniform_int_distribution uniform_dist( + std::numeric_limits::min(), + std::numeric_limits::max()); + for (unsigned int i = 0; i < n; i++) + ((uint16_t *)data)[i] = uniform_dist(rnd_engine); + } + break; + case 1: + if (type.is_signed) + { + std::uniform_int_distribution uniform_dist( + std::numeric_limits::min(), + std::numeric_limits::max()); + for (unsigned int i = 0; i < n; i++) + ((int8_t *)data)[i] = uniform_dist(rnd_engine); + } + else + { + std::uniform_int_distribution uniform_dist( + std::numeric_limits::min(), + std::numeric_limits::max()); + for (unsigned int i = 0; i < n; i++) + ((uint8_t *)data)[i] = uniform_dist(rnd_engine); + } + break; + default: + throw "load_random_data: no support for data size > 8 or < 1"; // no shenanigans here } } } diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc index 50d667c81..8511080d5 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_telemetry_decoder_gs.cc @@ -614,9 +614,9 @@ void galileo_telemetry_decoder_gs::decode_FNAV_word(float *page_symbols, int32_t this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj)); const auto default_precision{std::cout.precision()}; std::cout << TEXT_MAGENTA << "New Galileo E5a F/NAV message received in channel " - << d_channel << ": ephemeris from satellite " << d_satellite << " with CN0=" << std::setprecision(2) << cn0 + << d_channel << ": ephemeris from satellite " << d_satellite << " with CN0=" + << std::setprecision(2) << cn0 << std::setprecision(default_precision) << " dB-Hz" << TEXT_RESET << std::endl; - std::cout << std::setprecision(default_precision); // restore defaults } if (d_fnav_nav.have_new_iono_and_GST() == true) @@ -626,9 +626,8 @@ void galileo_telemetry_decoder_gs::decode_FNAV_word(float *page_symbols, int32_t const auto default_precision{std::cout.precision()}; std::cout << TEXT_MAGENTA << "New Galileo E5a F/NAV message received in channel " << d_channel << ": iono/GST model parameters from satellite " << d_satellite - << " with CN0=" << std::setprecision(2) << cn0 + << " with CN0=" << std::setprecision(2) << cn0 << std::setprecision(default_precision) << " dB-Hz" << TEXT_RESET << std::endl; - std::cout << std::setprecision(default_precision); // restore defaults } if (d_fnav_nav.have_new_utc_model() == true) @@ -638,8 +637,8 @@ void galileo_telemetry_decoder_gs::decode_FNAV_word(float *page_symbols, int32_t const auto default_precision{std::cout.precision()}; std::cout << TEXT_MAGENTA << "New Galileo E5a F/NAV message received in channel " << d_channel << ": UTC model parameters from satellite " << d_satellite + << " with CN0=" << std::setprecision(2) << cn0 << std::setprecision(default_precision) << " dB-Hz" << TEXT_RESET << std::endl; - std::cout << std::setprecision(default_precision); // restore defaults } }