FreeCalypso > hg > gsm-net-reveng
comparison 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 |
comparison
equal
deleted
inserted
replaced
65:b3f04535eb14 | 66:599fac1b882d |
---|---|
1 /* | |
2 * Free Space Loss calculation | |
3 */ | |
4 | |
5 #define _GNU_SOURCE | |
6 #include <math.h> | |
7 #include "range_func.h" | |
8 | |
9 #define PI_f ((float) M_PI) | |
10 | |
11 float rf_range_freespace(float freq_mhz, float path_loss) | |
12 { | |
13 float wavelen = 300.0f / freq_mhz; | |
14 | |
15 return (wavelen / pow10f(path_loss / -20.0f)) / (PI_f * 4.0f); | |
16 } |