# Decibels: Engineers often measure the ratio of two power measurements in decibels…

##### Home/Education/Expert Q&A/Decibels: Engineers often measure the ratio of two power measurements in decibels…

**Question:**

**Decibels:** Engineers often measure the ratio of two power measurements in decibels, or dB. The equation

for the ratio of two power measurements in decibels is

dB=10log(P2 /P1)

where P2 is the power level being measured, and P1 is some reference power level.

**(a)** Assume that the reference power level P1 is 1 milliwatt, and write a program that accepts an input power P2 and converts it into dB with respect to 1 mW reference level.(Engineers have a special unit for dB power level with respect to a 1 mW reference level: dBm. Use good programming practices in your program.

**(b)** Write a program that creates a plot of power in watts verses power in dBm with respect to a 1 mW reference level. Create both linear xy plot and a log-linear xy plot

**Click the button below to view answer!**

If you happen to run into some problem while following the steps, please make sure to let us know in the comment section below, and we’ll do our best to solve it. Apart from that, you can contact us on Facebook and Twitter, however we can’t guarantee a rapid reaction time over those platform

## 0 Comments