Free Space Path Loss Calculator with API


Github: https://github.com/DoctorLai/FreeSpaceCalculator

The Path Loss is often referred to the wireless attenuation (in the unit of Decibel i.e. dB) between transmitter and receiver, as shown below.

pathloss Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools Free Space Path Loss

Free Space Path Loss Formula

To compute the Path Loss (dB), you will need the following factors:

  • Emitting Frequency i.e. f (usually seen in the unit of MHz or GHz)
  • Distance separation between Tx and Rx i.e. (usually seen in the unit of meters of kilo-meters)
  • Transmitter Antenna Gain (in the unit of dBi)
  • Receiver Antenna Gain (in the unit of dBi)

The path loss (dB) then can be computed via the following formula:

tex_8c776fc78e980fe399fa4222a5922e10 Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools

Where tex_283f8305ff6eb45145d2a1d63758d478 Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools is the speed of light in vacuum roughly tex_6152f50bab643dbd3220d0cbb584a43f Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools meters per second. tex_0a3117ceb000e31cdfb64b84c7f0fa71 Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools is the distance in the unit of meter and tex_7a28c7edfc7772451020109504284ed3 Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools is the emitting frequency in the unit of Hertz.

This can be further simplified to:

tex_5489cc51a56209eeaf40173ed8cdc0fc Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools

Where tex_0a3117ceb000e31cdfb64b84c7f0fa71 Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools is the distance in the unit of kilo-meter and tex_7a28c7edfc7772451020109504284ed3 Free Space Path Loss Calculator with API API Free Space Path Loss Online Tools is the emitting frequency in the unit of Mhz.

Path Loss Calculator Online

This calculator is available in the non-AMP version of this page.

Frequency (MHz):
Distance (Meter):
Transmitter Antenna Gain (dBi):
Receiver Antenna Gain (dBi):

Path Loss (dB):

Free Space Path Loss API

The Free Space Path Loss API is implemented in PHP, and the full source code is:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
https://propagationtools.com
$mhz = (float)($_GET['mhz'] ?? ($_POST['mhz'] ?? 0));
$meter = (float)($_GET['meter'] ?? ($_POST['meter'] ?? 0));
$gt = (float)($_GET['gt'] ?? ($_POST['gt'] ?? 0)); 
$gr = (float)($_GET['gr'] ?? ($_POST['gr'] ?? 0));
$data = array();
$data['err'] = array();
if ($mhz <= 0) {
  $data['err'][] = 'Frequency (MHz) Invalid';
}
if ($meter <= 0) {
  $data['err'][] = 'Distance (Meter) Invalid';
}
if (count($data['err']) == 0) {
  $data['db'] = 20.0 * log10($mhz * $meter * 0.001) + 32.44 - $gt - $gr;
}
header("Access-Control-Allow-Origin: *");  
header('Content-Type: application/json');
die(json_encode($data));  
https://propagationtools.com
$mhz = (float)($_GET['mhz'] ?? ($_POST['mhz'] ?? 0));
$meter = (float)($_GET['meter'] ?? ($_POST['meter'] ?? 0));
$gt = (float)($_GET['gt'] ?? ($_POST['gt'] ?? 0)); 
$gr = (float)($_GET['gr'] ?? ($_POST['gr'] ?? 0));
$data = array();
$data['err'] = array();
if ($mhz <= 0) {
  $data['err'][] = 'Frequency (MHz) Invalid';
}
if ($meter <= 0) {
  $data['err'][] = 'Distance (Meter) Invalid';
}
if (count($data['err']) == 0) {
  $data['db'] = 20.0 * log10($mhz * $meter * 0.001) + 32.44 - $gt - $gr;
}
header("Access-Control-Allow-Origin: *");  
header('Content-Type: application/json');
die(json_encode($data));  

For example, you can invoke the API at the following end-point:

https://propagationtools.com/api/freespace/?mhz=947&meter=234&gt=15&gr=10

and, the returned format is JSON:

{"err":[],"db":54.361316728268}

And, you could pass the parameters via the POST method:

1
2
? curl -s -X POST "https://propagationtools.com/api/freespace/" -d "mhz=947" -d "meter=234"
{"err":[],"db":79.361316728268}
? curl -s -X POST "https://propagationtools.com/api/freespace/" -d "mhz=947" -d "meter=234"
{"err":[],"db":79.361316728268}

The antenna gain values (dBi) for transmitter and receiver are optional, which are zeros by default.

926 words Last Post: Building Significant Factors Affect 5G Propagation Modelling
Next Post: Introducing the Simple OBL Vector Building Data Format


Leave a Reply

Your email address will not be published. Required fields are marked *