view pathloss/egli.c @ 74:e78c6b1ecb91

trau-decode: refactor trau-hr-dump The desire is to create a companion program that will read hex lines representing TRAU-8k frames and then decode those frames in exactly the same way how we currently decode frames read from binary capture files. Hence the decoder portion of trau-hr-dump needs to be factored out.
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 08 Feb 2025 03:00:31 +0000
parents 0cfea66a15f3
children
line wrap: on
line source

/*
 * RF range calculation per Egli model
 */

#define	_GNU_SOURCE
#include <math.h>
#include "range_func.h"

float rf_range_egli(float freq_mhz, float path_loss, float bts_ant_m,
		    float ms_ant_m)
{
	float l, r, x;

	l = 20.0f * log10f(freq_mhz / 40.0f);
	r = path_loss - l;
	x = bts_ant_m * ms_ant_m;
	return sqrtf(x / pow10f(r / -20.0f));
}