31 if (val < 0.0 || val > 6.0) {
return 255; }
32 if (val <= 0.5) {
return static_cast<uint8_t
>(
static_cast<unsigned int>(val) / 0.01); }
33 if (val <= 1.0) {
return static_cast<uint8_t
>(
static_cast<unsigned int>((val - 0.5)) / 0.02) + 50; }
34 if (val <= 2.0) {
return static_cast<uint8_t
>(
static_cast<unsigned int>((val - 1.0)) / 0.04) + 75; }
35 return static_cast<uint8_t
>(
static_cast<unsigned int>((val - 2.0)) / 0.16) + 100;
40 if (idx <= 49) {
return static_cast<double>(idx) * 0.01; }
41 if (idx <= 74) {
return 0.5 + (
static_cast<double>(idx) - 50.0) * 0.02; }
42 if (idx <= 99) {
return 1.0 + (
static_cast<double>(idx) - 75.0) * 0.04; }
43 if (idx <= 125) {
return 2.0 + (
static_cast<double>(idx) - 100.0) * 0.16; }
49 constexpr std::array<double, 15> URA = { 2.4, 3.4, 4.85, 6.85, 9.65, 13.65, 24.0, 48.0, 96.0, 192.0, 384.0, 768.0, 1536.0, 3072.0, 6144.0 };
50 return val < 0.0 ?
static_cast<uint8_t
>(URA.size())
51 :
static_cast<uint8_t
>(std::ranges::lower_bound(URA, val) - URA.begin());
56 if (idx == 1) {
return 2.8; }
57 if (idx == 3) {
return 5.7; }
58 if (idx == 5) {
return 11.3; }
59 if (idx <= 6) {
return std::pow(2, 1.0 + idx / 2.0); }
60 if (idx < 15) {
return std::pow(2, idx - 2); }
Frequency definition for different satellite systems.
double getFrequency(int8_t num) const
Get the frequency in [Hz].
static constexpr double C
Speed of light [m/s].
double galSisaIdx2Val(uint8_t idx)
Converts a GALILEO SISA (Signal in space accuracy) index to it's value.
double ratioFreqSquared(Frequency f1, Frequency f2, int8_t num1, int8_t num2)
Calculates the ration of the frequencies squared γ
double gpsUraIdx2Val(uint8_t idx)
Converts a GPS URA (user range accuracy) index to it's value.
uint8_t galSisaVal2Idx(double val)
Converts a GALILEO SISA (Signal in space accuracy) value to it's index.
uint8_t gpsUraVal2Idx(double val)
Converts a GPS URA (user range accuracy) value to it's index.
double doppler2rangeRate(double doppler, Frequency freq, int8_t num)
Transforms a doppler-shift into a range-rate.
double rangeRate2doppler(double rangeRate, Frequency freq, int8_t num)
Transforms a range-rate into a doppler-shift.