diff 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
line wrap: on
line diff
--- /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 <math.h>
+#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;
+}