Skip to content

Commit 07dedef

Browse files
committed
v1.3.8
Added Free Space Path Loss model (ITU-R P.525)
1 parent cdabfd5 commit 07dedef

File tree

2 files changed

+44
-4
lines changed

2 files changed

+44
-4
lines changed

fspl.cpp

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

main.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/****************************************************************************\
2-
* Signal Server 1.3.7: Server optimised SPLAT! by Alex Farrant *
2+
* Signal Server 1.3.8: Server optimised SPLAT! by Alex Farrant *
33
******************************************************************************
44
* SPLAT! Project started in 1997 by John A. Magliacane, KD2BD *
55
* *
@@ -19,7 +19,7 @@
1919
* for more details. *
2020
* *
2121
******************************************************************************
22-
* g++ -Wall -O3 -s -lm -fomit-frame-pointer itm.cpp cost.cpp hata.cpp main.cpp -o ss *
22+
* g++ -Wall -O3 -s -lm -fomit-frame-pointer itm.cpp hata.cpp cost.cpp fspl.cpp main.cpp -o ss *
2323
\****************************************************************************/
2424

2525
#include <stdio.h>
@@ -122,6 +122,8 @@ double HataLinkdB(float f,float h_B, float h_M, float d, int mode);
122122

123123
double CostHataLinkdB(float f,float h_B, float h_M, float d);
124124

125+
double FsplLinkdB(float f, float d);
126+
125127
double ked(double freq, double elev[], double rxh, double dkm);
126128

127129
double arccos(double x, double y)
@@ -1788,6 +1790,11 @@ void PlotPropPath(struct site source, struct site destination, unsigned char mas
17881790
// COST231-HATA
17891791
loss=CostHataLinkdB(LR.frq_mhz,txelev,path.elevation[y]+(destination.alt*METERS_PER_FOOT),dkm);
17901792
break;
1793+
case 7:
1794+
// ITU-R P.525 Free space path loss
1795+
loss=FsplLinkdB(LR.frq_mhz,dkm);
1796+
//fprintf(stdout,"MHz: %1f KM: %1f = %1fdB",LR.frq_mhz,dkm,loss);
1797+
break;
17911798

17921799
default:
17931800
point_to_point(elev,source.alt*METERS_PER_FOOT,
@@ -3803,7 +3810,7 @@ int main(int argc, char *argv[])
38033810

38043811

38053812

3806-
strncpy(ss_version,"1.3.7\0",6);
3813+
strncpy(ss_version,"1.3.8\0",6);
38073814
strncpy(ss_name,"Signal Server\0",14);
38083815

38093816
if (argc==1)
@@ -3830,7 +3837,7 @@ int main(int argc, char *argv[])
38303837
fprintf(stdout," -R Radius (miles/kilometers)\n");
38313838
fprintf(stdout," -res Pixels per degree. 300/600/1200(default)/3600 (optional)\n");
38323839
fprintf(stdout," -t Terrain background\n");
3833-
fprintf(stdout," -pm Propagation model. 1: ITM (Default), 2: LOS, 3-5: Hata\n");
3840+
fprintf(stdout," -pm Propagation model. 1: ITM (Default), 2: LOS, 3-5: Hata, 6: COST231, 7: ITU525\n");
38343841
fprintf(stdout," -ked Knife edge diffraction (Default for ITM)\n");
38353842
fprintf(stdout," -wf Win32 SDF tile names ('=' not ':')\n");
38363843
fprintf(stdout," -dbg Debug mode\n\n");

0 commit comments

Comments
 (0)