annotate autocal/txvout.c @ 79:394daa4ad6e8

fc-rfcal-txband: dBm to Vout function implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 15 Jul 2017 21:06:43 +0000
parents
children 4c3f4231a021
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
79
394daa4ad6e8 fc-rfcal-txband: dBm to Vout function implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
394daa4ad6e8 fc-rfcal-txband: dBm to Vout function implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * This module contains the function that converts Tx power values in dBm
394daa4ad6e8 fc-rfcal-txband: dBm to Vout function implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * (either measured or set targets) to Vout for the purpose of piecewise
394daa4ad6e8 fc-rfcal-txband: dBm to Vout function implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 * linear modeling of APC.
394daa4ad6e8 fc-rfcal-txband: dBm to Vout function implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 */
394daa4ad6e8 fc-rfcal-txband: dBm to Vout function implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6
394daa4ad6e8 fc-rfcal-txband: dBm to Vout function implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 #include <math.h>
394daa4ad6e8 fc-rfcal-txband: dBm to Vout function implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 #include "txband.h"
394daa4ad6e8 fc-rfcal-txband: dBm to Vout function implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9
394daa4ad6e8 fc-rfcal-txband: dBm to Vout function implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 vout_t
394daa4ad6e8 fc-rfcal-txband: dBm to Vout function implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 dbm_to_vout(dbm)
394daa4ad6e8 fc-rfcal-txband: dBm to Vout function implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 double dbm;
394daa4ad6e8 fc-rfcal-txband: dBm to Vout function implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 {
394daa4ad6e8 fc-rfcal-txband: dBm to Vout function implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 double milliwatts, vout;
394daa4ad6e8 fc-rfcal-txband: dBm to Vout function implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15
394daa4ad6e8 fc-rfcal-txband: dBm to Vout function implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 milliwatts = pow(10.0, dbm / 10.0);
394daa4ad6e8 fc-rfcal-txband: dBm to Vout function implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 vout = sqrt(milliwatts * 0.050);
394daa4ad6e8 fc-rfcal-txband: dBm to Vout function implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 return vout;
394daa4ad6e8 fc-rfcal-txband: dBm to Vout function implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 }