Boost.Units: unit type for dBm
Hi, I have a system that uses dBm to indicate Signal Amplitude, how do I create a type using Boost.Units for this? At the moment I am not concerned about any type of conversions between power and this ratio. Any help will be appreciated. I am already using boost.unit successfully for other units and conversions with the help from the mailing list. I want to now define the correct strong type for this type for consistency. Regards, Carel
On 13/06/2019 22:54, Carel Combrink wrote:
I have a system that uses dBm to indicate Signal Amplitude, how do I create a type using Boost.Units for this?
At the moment I am not concerned about any type of conversions between power and this ratio.
See https://www.boost.org/doc/libs/1_70_0/doc/html/boost_units/Dimensional_Analy... and https://www.boost.org/doc/libs/1_70_0/doc/html/boost_units/Units.html. If you're not interested in any conversions, then you can simply define a new system containing a single new dimension and new base unit. These will happily coexist with other systems and units, as long as you never try to mix values from the two. Things get more complicated if you want to perform conversions from other units, however.
participants (2)
-
Carel Combrink
-
Gavin Lambert