-
Notifications
You must be signed in to change notification settings - Fork 85
/
fspl.cpp
33 lines (28 loc) · 1.08 KB
/
fspl.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*****************************************************************************
* ITU-R P.525 Free Space Path Loss model for Signal Server by Alex Farrant *
* 15 January 2014 *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License or any later *
* version. *
* *
* This program is distributed in the hope that it will useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
* for more details. *
* */
#include <stdlib.h>
#include <math.h>
#include <iostream>
using namespace std;
double FsplLinkdB(float f, float d){
/*
Free Space Path Loss model
Frequency: Any
Distance: Any
*/
//MHz to GHz
f = f / 1000;
double dbloss = (20 * log10(d)) + (20 * log10(f)) + 92.45;
return dbloss;
}