-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for logarithmic units #201
Comments
I've only briefly looked at the problem so far. I think what would need to be done is to pull conversion formulas ( |
I see that @iliekturtles you added some more changes to @Atmelfan PRs in #310 but never merged. |
I just haven't had a chance to get back to this since then. |
While not strictly supported by SI it's common in electronics and other industries to use logarithmic quantities expressed in Decibels such as
dBm[W]
,dBuV/m
.It would be nice to have a decibel_<unit> (Ex: decibel_milliwatt) for these common usages which converts them to the linear base quantities or vice versa.
It would need to perform different conversion to power and field quantities (see below).
Power quantities (watt):
Field quantities (volt, ampere etc):
Where:
Usually the reference is provided as a suffix behind dB, e.g. dBuV => F0 = 1uV.
The simple decibel (dB) and derivatives (dBi etc) would also be applicable as a Ratio unit.
The Bell (B) and Neper (Np) could also be supported but nobody cares about those.
Not sure how hard this would be to implement as it would not be a simple coefficient and offset.
A reasonable alternative would be a special functions like
new_db::<reference>(logvalue)
andget_db::<reference>()
but would not be as versatile and consistent.If I can understand how all the macros and generics works I'll try to implement something...
The text was updated successfully, but these errors were encountered: