# HG changeset patch # User Mychaela Falconia # Date 1500152803 0 # Node ID 394daa4ad6e88328bb4851a04f7910ac41a9c9b7 # Parent 1d3dd589a85744fb204d3e04cb3784199380f368 fc-rfcal-txband: dBm to Vout function implemented diff -r 1d3dd589a857 -r 394daa4ad6e8 autocal/Makefile --- a/autocal/Makefile Sat Jul 15 20:47:31 2017 +0000 +++ b/autocal/Makefile Sat Jul 15 21:06:43 2017 +0000 @@ -11,7 +11,7 @@ rxupload.o sockopts.o tsidsock.o TXBAND_OBJS= l1tmops.o rvinterf.o sockopts.o tsidsock.o txbandmain.o \ - txcalchan.o txcalconf.o txpwrmeas.o + txcalchan.o txcalconf.o txpwrmeas.o txvout.o TXBASIS_OBJS= l1tmops.o rvinterf.o tsidsock.o txpwrmeas.o txstandbas.o @@ -29,7 +29,7 @@ ${CC} -o $@ ${RXBAND_OBJS} fc-rfcal-txband: ${TXBAND_OBJS} - ${CC} -o $@ ${TXBAND_OBJS} + ${CC} -o $@ ${TXBAND_OBJS} -lm fc-rfcal-txbasis: ${TXBASIS_OBJS} ${CC} -o $@ ${TXBASIS_OBJS} diff -r 1d3dd589a857 -r 394daa4ad6e8 autocal/txvout.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/autocal/txvout.c Sat Jul 15 21:06:43 2017 +0000 @@ -0,0 +1,19 @@ +/* + * This module contains the function that converts Tx power values in dBm + * (either measured or set targets) to Vout for the purpose of piecewise + * linear modeling of APC. + */ + +#include +#include "txband.h" + +vout_t +dbm_to_vout(dbm) + double dbm; +{ + double milliwatts, vout; + + milliwatts = pow(10.0, dbm / 10.0); + vout = sqrt(milliwatts * 0.050); + return vout; +}