Class that stores power levels (in dBm) at various gains, frequencies, and temperatures.
This container class is suitable for all cases where devices want to store a gain-to-power mapping from a single, overall gain value.
The underlying data structure stores the power level for every gain/frequency point that is part of this data set. It can also do a reverse look-up of gain values for a given power value.
The interpolation algorithms assume a monotonic gain/power profile, i.e., f(gain) = power is monotonically increasing. If the power is not monotonically increasing, the interpolation algorithms still work, but get_gain() might produce a greater than necessary interpolation error. For that case, this class provides get_gain_coerced(), which helps with both coercion of the interpolated gain into a gain value that can be used at the call site, as well as minimizing the effect on the application using this container.
All interpolation algorithms first interpolate temperature by finding the nearest available temperature data. For example, if the data set includes calibration data for 40C and 50C, and the actual temperature is measured at 48C, then the data set for 50C is used, and the data set for 40C is not considered at all. Within a data set, frequency and gain are interpolated in two dimensions (the same is true for frequency and power for get_gain() and get_gain_coerced()) using a bilinear interpolation.
|
| virtual void | add_power_table (const std::map< double, double > &gain_power_map, const double min_power, const double max_power, const double freq, const std::optional< int > temperature={})=0 |
| |
| void | add_power_table (const std::map< double, double > &gain_power_map, const double min_power, const double max_power, const double freq, const int temperature) |
| |
| void | add_power_table (const std::map< double, double > &gain_power_map, const double min_power, const double max_power, const double freq, const boost::optional< int > temperature) |
| |
| virtual void | clear ()=0 |
| |
| virtual void | set_temperature (const int temperature)=0 |
| |
| virtual int | get_temperature () const =0 |
| | Return the current default temperature. More...
|
| |
| virtual void | set_ref_gain (const double gain)=0 |
| |
| virtual double | get_ref_gain () const =0 |
| |
| virtual uhd::meta_range_t | get_power_limits (const double freq, const std::optional< int > temperature={}) const =0 |
| |
| uhd::meta_range_t | get_power_limits (const double freq, const int temperature) const |
| |
| uhd::meta_range_t | get_power_limits (const double freq, const boost::optional< int > temperature) const |
| |
| virtual double | get_power (const double gain, const double freq, const std::optional< int > temperature={}) const =0 |
| |
| double | get_power (const double gain, const double freq, const int temperature) const |
| |
| double | get_power (const double gain, const double freq, const boost::optional< int > temperature) const |
| |
| virtual double | get_gain (const double power_dbm, const double freq, const std::optional< int > temperature={}) const =0 |
| |
| double | get_gain (const double power_dbm, const double freq, const int temperature) const |
| |
| double | get_gain (const double power_dbm, const double freq, const boost::optional< int > temperature) const |
| |
| virtual | ~container ()=default |
| |
| virtual std::string | get_name () const =0 |
| | Return the name of this calibration table. More...
|
| |
| virtual std::string | get_serial () const =0 |
| | Return the device serial of this calibration table. More...
|
| |
| virtual uint64_t | get_timestamp () const =0 |
| | Timestamp of acquisition time. More...
|
| |
| virtual std::vector< uint8_t > | serialize ()=0 |
| | Return a serialized version of this container. More...
|
| |
| virtual void | deserialize (const std::vector< uint8_t > &data)=0 |
| | Populate this class from the serialized data. More...
|
| |