mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-10-30 22:56:22 +00:00
Merge branch 'next' into osnma
This commit is contained in:
commit
bcc1bb7b39
@ -338,7 +338,7 @@ set(GNSSSDR_PYTHON3_MIN_VERSION "3.4")
|
|||||||
set(GNSSSDR_ARMADILLO_LOCAL_VERSION "12.6.x")
|
set(GNSSSDR_ARMADILLO_LOCAL_VERSION "12.6.x")
|
||||||
set(GNSSSDR_GFLAGS_LOCAL_VERSION "2.2.2")
|
set(GNSSSDR_GFLAGS_LOCAL_VERSION "2.2.2")
|
||||||
set(GNSSSDR_GLOG_LOCAL_VERSION "0.6.0")
|
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_PROTOCOLBUFFERS_LOCAL_VERSION "24.4")
|
||||||
set(GNSSSDR_PUGIXML_LOCAL_VERSION "1.14")
|
set(GNSSSDR_PUGIXML_LOCAL_VERSION "1.14")
|
||||||
set(GNSSSDR_GTEST_LOCAL_VERSION "1.13.0")
|
set(GNSSSDR_GTEST_LOCAL_VERSION "1.13.0")
|
||||||
|
@ -33,61 +33,96 @@ 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)
|
void load_random_data(void *data, volk_gnsssdr_type_t type, unsigned int n)
|
||||||
{
|
{
|
||||||
std::random_device r;
|
std::random_device rnd_device;
|
||||||
std::default_random_engine e1(r());
|
std::default_random_engine rnd_engine(rnd_device());
|
||||||
std::default_random_engine e2(r());
|
|
||||||
|
|
||||||
if (type.is_complex) n *= 2;
|
if (type.is_complex) n *= 2;
|
||||||
|
|
||||||
if (type.is_float)
|
if (type.is_float)
|
||||||
{
|
{
|
||||||
if (type.size == 8)
|
if (type.size == 8)
|
||||||
random_values<double>((double *)data, n, e1);
|
random_values<double>((double *)data, n, rnd_engine);
|
||||||
else
|
else
|
||||||
random_values<float>((float *)data, n, e1);
|
random_values<float>((float *)data, n, rnd_engine);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
float int_max = float(uint64_t(2) << (type.size * 8));
|
|
||||||
if (type.is_signed) int_max /= 2.0;
|
|
||||||
std::uniform_real_distribution<float> uniform_dist(-int_max, int_max);
|
|
||||||
for (unsigned int i = 0; i < n; i++)
|
|
||||||
{
|
|
||||||
float scaled_rand = uniform_dist(e2);
|
|
||||||
|
|
||||||
switch (type.size)
|
switch (type.size)
|
||||||
{
|
{
|
||||||
case 8:
|
case 8:
|
||||||
if (type.is_signed)
|
if (type.is_signed)
|
||||||
((int64_t *)data)[i] = (int64_t)scaled_rand;
|
{
|
||||||
|
std::uniform_int_distribution<int64_t> uniform_dist(
|
||||||
|
std::numeric_limits<int64_t>::min(),
|
||||||
|
std::numeric_limits<int64_t>::max());
|
||||||
|
for (unsigned int i = 0; i < n; i++)
|
||||||
|
((int64_t *)data)[i] = uniform_dist(rnd_engine);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
((uint64_t *)data)[i] = (uint64_t)scaled_rand;
|
{
|
||||||
|
std::uniform_int_distribution<uint64_t> uniform_dist(
|
||||||
|
std::numeric_limits<uint64_t>::min(),
|
||||||
|
std::numeric_limits<uint64_t>::max());
|
||||||
|
for (unsigned int i = 0; i < n; i++)
|
||||||
|
((uint64_t *)data)[i] = uniform_dist(rnd_engine);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
if (type.is_signed)
|
if (type.is_signed)
|
||||||
((int32_t *)data)[i] = (int32_t)scaled_rand;
|
{
|
||||||
|
std::uniform_int_distribution<int32_t> uniform_dist(
|
||||||
|
std::numeric_limits<int32_t>::min(),
|
||||||
|
std::numeric_limits<int32_t>::max());
|
||||||
|
for (unsigned int i = 0; i < n; i++)
|
||||||
|
((int32_t *)data)[i] = uniform_dist(rnd_engine);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
((uint32_t *)data)[i] = (uint32_t)scaled_rand;
|
{
|
||||||
|
std::uniform_int_distribution<uint32_t> uniform_dist(
|
||||||
|
std::numeric_limits<uint32_t>::min(),
|
||||||
|
std::numeric_limits<uint32_t>::max());
|
||||||
|
for (unsigned int i = 0; i < n; i++)
|
||||||
|
((uint32_t *)data)[i] = uniform_dist(rnd_engine);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
// 16 bit multiplication saturates very fast
|
|
||||||
// we produce here only 3 bits input range
|
|
||||||
if (type.is_signed)
|
if (type.is_signed)
|
||||||
((int16_t *)data)[i] = (int16_t)((int16_t)scaled_rand % 8);
|
{
|
||||||
|
std::uniform_int_distribution<int16_t> uniform_dist(-7, 7);
|
||||||
|
for (unsigned int i = 0; i < n; i++)
|
||||||
|
((int16_t *)data)[i] = uniform_dist(rnd_engine);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
((uint16_t *)data)[i] = (uint16_t)(int16_t)((int16_t)scaled_rand % 8);
|
{
|
||||||
|
std::uniform_int_distribution<uint16_t> uniform_dist(
|
||||||
|
std::numeric_limits<uint16_t>::min(),
|
||||||
|
std::numeric_limits<uint16_t>::max());
|
||||||
|
for (unsigned int i = 0; i < n; i++)
|
||||||
|
((uint16_t *)data)[i] = uniform_dist(rnd_engine);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (type.is_signed)
|
if (type.is_signed)
|
||||||
((int8_t *)data)[i] = (int8_t)scaled_rand;
|
{
|
||||||
|
std::uniform_int_distribution<int16_t> uniform_dist(
|
||||||
|
std::numeric_limits<int8_t>::min(),
|
||||||
|
std::numeric_limits<int8_t>::max());
|
||||||
|
for (unsigned int i = 0; i < n; i++)
|
||||||
|
((int8_t *)data)[i] = uniform_dist(rnd_engine);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
((uint8_t *)data)[i] = (uint8_t)scaled_rand;
|
{
|
||||||
|
std::uniform_int_distribution<uint16_t> uniform_dist(
|
||||||
|
std::numeric_limits<uint8_t>::min(),
|
||||||
|
std::numeric_limits<uint8_t>::max());
|
||||||
|
for (unsigned int i = 0; i < n; i++)
|
||||||
|
((uint8_t *)data)[i] = uniform_dist(rnd_engine);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw "load_random_data: no support for data size > 8 or < 1"; // no shenanigans here
|
throw "load_random_data: no support for data size > 8 or < 1"; // no shenanigans here
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::vector<std::string> get_arch_list(volk_gnsssdr_func_desc_t desc)
|
static std::vector<std::string> get_arch_list(volk_gnsssdr_func_desc_t desc)
|
||||||
|
@ -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));
|
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
|
||||||
const auto default_precision{std::cout.precision()};
|
const auto default_precision{std::cout.precision()};
|
||||||
std::cout << TEXT_MAGENTA << "New Galileo E5a F/NAV message received in channel "
|
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;
|
<< " dB-Hz" << TEXT_RESET << std::endl;
|
||||||
std::cout << std::setprecision(default_precision); // restore defaults
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (d_fnav_nav.have_new_iono_and_GST() == true)
|
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()};
|
const auto default_precision{std::cout.precision()};
|
||||||
std::cout << TEXT_MAGENTA << "New Galileo E5a F/NAV message received in channel "
|
std::cout << TEXT_MAGENTA << "New Galileo E5a F/NAV message received in channel "
|
||||||
<< d_channel << ": iono/GST model parameters from satellite " << d_satellite
|
<< 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;
|
<< " dB-Hz" << TEXT_RESET << std::endl;
|
||||||
std::cout << std::setprecision(default_precision); // restore defaults
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (d_fnav_nav.have_new_utc_model() == true)
|
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()};
|
const auto default_precision{std::cout.precision()};
|
||||||
std::cout << TEXT_MAGENTA << "New Galileo E5a F/NAV message received in channel "
|
std::cout << TEXT_MAGENTA << "New Galileo E5a F/NAV message received in channel "
|
||||||
<< d_channel << ": UTC model parameters from satellite " << d_satellite
|
<< 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;
|
<< " dB-Hz" << TEXT_RESET << std::endl;
|
||||||
std::cout << std::setprecision(default_precision); // restore defaults
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user