pypho_functions

pypho_functions is a collection of usefull functions to make your coding live easier.

dbm2w( power_dbm )

Converts a power value from dBm to W: $P|_{W} = 10^{\frac{P|_{dBm}}{10}}$ W

Parameter Type Description
power_dbm float Power value in dBm ($P|_{dBm}$).

Output Type Description
Power value in W float $P|_{W}$

w2dbm( power_w )

Converts a power value from W to dBm: $P|_{dBm} = 10\cdot \lg{\left(\frac{P|_{W}}{1mW}\right)}$ dBm.

Parameter Type Description
power_dbm float Power value in W ($P|_{W}$).

Output Type Description
Power value in dBm float $P|_{dBm}$

getpower_W( E )

Calculates the mean power in W of an optical Signal $E$: $P|_{dBm} = \frac{1}{T} \int _{ \tau=0 }^{ T } \left( \left\lvert E_x(\tau) \right\rvert^{ 2 } +\left\lvert E_y(\tau) \right\rvert^{ 2 }\right) d\tau$.

Parameter Type Description
E numpy.ndarray 2 dimensional array with complex values, which represents the sample points over time of the X- and Y-polarisation.
For example E[0]['E'].

Output Type Description
Power value in W float $P|_{W}$

getpower_dBm( E )

Same as getpower_w( E ), but output is in dBm.