diff pathloss/fsl.c @ 66:599fac1b882d

pathloss: implement FSL
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 25 Oct 2024 08:12:28 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pathloss/fsl.c	Fri Oct 25 08:12:28 2024 +0000
@@ -0,0 +1,16 @@
+/*
+ * Free Space Loss calculation
+ */
+
+#define	_GNU_SOURCE
+#include <math.h>
+#include "range_func.h"
+
+#define	PI_f	((float) M_PI)
+
+float rf_range_freespace(float freq_mhz, float path_loss)
+{
+	float wavelen = 300.0f / freq_mhz;
+
+	return (wavelen / pow10f(path_loss / -20.0f)) / (PI_f * 4.0f);
+}