This commit is contained in:
alex
2015-02-27 21:27:10 +00:00
parent 506049d823
commit c36e13eb38
11 changed files with 4353 additions and 4273 deletions

View File

@@ -1,16 +1,31 @@
Signal Server changelog
SIGNAL SERVER CHANGE LOG
v2.3 - 29 September 2014
v2.41 - 27 February 2015
Simpler PPA output for scripting
Enabled new models for PPA (previously just ITM)
#Define to enable HD mem options/build at build time (-DHD)
Optimised build command (-Ofast) to improve speed by 14%
Improved test script
2.4 - January 2015
Added SUI, ECC33, Ericsson models in new 'models' module
Added model validation
Retired individual model files as some models only 1 or 2 lines of code
2.31 - October 2014
ERP up to 5MW for Mexican TV(!)
2.3 - 29 September 2014
Replaced itm.cpp with itwom3.0.cpp and added ITWOM model as result
v2.23 - 14 August 2014
2.23 - 14 August 2014
Improved diffraction model to work only for dips deeper than 20m and not to exaggerate result by an arbitrary figure (3)
Fixed false 'frequency too low' error message for FSPL model which was intended for Hata models only.
v2.22 -
2.22 -
Fixed LOS not outputting bounds
v2.2 -
2.2 -
Made .dot output opt in to save some disk space
Changed version number to line 1 of main.cpp instead of buried in code in two places.
@@ -18,55 +33,54 @@ v2.1 -
Added experimental dual core support with -haf
Requires double the RAM
v1.3.8 - 16 Jan 2014
1.3.8 - 16 Jan 2014
Added Free Space Path Loss model (with optional diffraction)
v1.3.7 - 30 Dec 2013
1.3.7 - 30 Dec 2013
Added propagation model option (-pm)
Added HATA urban/suburban/open models (150-1500MHz)
Added COST231-Hata (urban) model (1500-2000MHz)
Added custom Knife Edge Diffraction option (-ked) to enhance new models
Removed unused variables
v1.3.6 - 12 Aug 2013
1.3.6 - 12 Aug 2013
Added LOS model for up to 100GHz
Added 1 arc second (3600 pixels/degree) support (-res 3600)
v1.3.5 - 07 Jul 2013
1.3.5 - 07 Jul 2013
Reduced maxpages to 9
Added memset() to clear DEM before use
v1.3.4 - 16 May 2013
1.3.4 - 16 May 2013
High resolution SRTM1 1-arc second DEM support added.
Use -res 3600 and ensure .sdf files are produced with srtm2sdf-hd
v1.3.3 - 04 Nov 2012
1.3.3 - 04 Nov 2012
Air planning:
Increased maximum Tx height to 60,000 (m/f)
Increased maximum Rx height to 60,000 (m/f)
v1.3.2 - 04 Oct 2012
1.3.2 - 04 Oct 2012
Re-instated grey scale option to allow for terrain background.
Off by default. Enable with switch -t
v1.3 - 03 Jan 2012
1.3 - 03 Jan 2012
Added user defined clutter layers from SPLAT! (-udt switch)
v1.2 - 31 Dec 2011
1.2 - 31 Dec 2011
Max colours increased from 32 to 128
Radius value fixed at metric
Metric / Imperial conversion bug fixed
v1.1 - 08 Dec 2011
1.1 - 08 Dec 2011
Max Tx altitude increased to 20,000(m) for high altitude aircraft. "Can you 'ere me now?"
Added 2 new options -tercon, -terdic for *custom* dielectric values and ground conductivity. -te terrain option remains. Use with care!
New Earth Dielectric range (Permittivity): 80 to 0.1
New Conductivity range (Siemens/m): 0.01 to 0.000001
v1.0 - 19 November 2011
1.0 - 19 November 2011
SS released.

View File

@@ -1,55 +1,63 @@
Signal-Server RF coverage calculator
====================================
/****************************************************************************\
* Signal Server: Server optimised SPLAT! by Alex Farrant *
* Signal Server: Server optimised SPLAT! by Alex Farrant *
******************************************************************************
* SPLAT! Project started in 1997 by John A. Magliacane, KD2BD *
* *
* SPLAT! Project started in 1997 by John A. Magliacane, KD2BD *
* *
******************************************************************************
* Please consult the SPLAT! documentation for a complete list of *
* individuals who have contributed to this project. *
* individuals who have contributed to this project. *
******************************************************************************
* *
* 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. *
* *
* 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. *
* *
******************************************************************************
* g++ -Wall -O3 -s -lm -fomit-frame-pointer itwom3.0.cpp cost.cpp hata.cpp fspl.cpp main.cpp -o ss *
* for more details. *
* *
\****************************************************************************/
Usage: signalserver (options)
-d Directory containing .sdf tiles
-lat Tx Latitude (decimal degrees)
-lon Tx Longitude (decimal degrees) Positive 0-360
-txh Tx Height (above ground), 0 to 60,000 f/m
-f Tx Frequency, 20MHz to 100GHz
-erp Tx Effective Radiated Power, 0.01 to 5,000,000 Watts
-rxh Rx Height(s) (optional. Default=0.1), 0 to 60,000 f/m
-rt Rx Threshold (dB / dBm / dBuV/m)
-hp Horizontal Polarisation (default=vertical)
-gc Ground clutter (feet/meters)
-udt User defined terrain filename
-dbm Plot Rxd signal power instead of field strength
-m Metric units of measurement
-te Terrain code 1-6 (optional)
-terdic Terrain dielectric value 2-80 (optional)
-tercon Terrain conductivity 0.01-0.0001 (optional)
-cl Climate code 1-6 (optional)
-o Filename. Required.
-R Radius (miles/kilometers)
-res Pixels per degree. 300/600/1200(default)/3600 (optional)
-t Terrain background
-pm Propagation model. 1: ITM (Default), 2: LOS, 3-5: Hata
-ked Knife edge diffraction (Default for ITM)
-wf Win32 SDF tile names ('=' not ':')
-dbg Debug mode
/*
REQUIRES GCC >= 4.7
90m mode
g++ -Wall -Ofast -s -lm itwom3.0.cpp models.cpp main.cpp -o signalserver
30m HD mode
g++ -Wall -Ofast -s -lm itwom3.0.cpp models.cpp main.cpp -DHD -o signalserverHD
*/
-- Signal Server 2.41 --
Compiled for 64 tiles at 1200 pixels/degree
-d Directory containing .sdf tiles
-lat Tx Latitude (decimal degrees) -70/+70
-lon Tx Longitude (decimal degrees) -180/+180
-txh Tx Height (above ground)
-rla (Optional) Rx Latitude for PPA (decimal degrees) -70/+70
-rlo (Optional) Rx Longitude for PPA (decimal degrees) -180/+180
-f Tx Frequency (MHz) 20MHz to 100GHz (LOS after 20GHz)
-erp Tx Effective Radiated Power (Watts)
-rxh Rx Height(s) (optional. Default=0.1)
-rt Rx Threshold (dB / dBm / dBuV/m)
-hp Horizontal Polarisation (default=vertical)
-gc Ground clutter (feet/meters)
-udt User defined terrain filename
-dbm Plot Rxd signal power instead of field strength
-m Metric units of measurement
-te Terrain code 1-6 (optional)
-terdic Terrain dielectric value 2-80 (optional)
-tercon Terrain conductivity 0.01-0.0001 (optional)
-cl Climate code 1-6 (optional)
-o Filename. Required.
-R Radius (miles/kilometers)
-res Pixels per degree. 300/600/1200(default)/3600 (optional)
-t Terrain background
-pm Prop model. 1: ITM, 2: LOS, 3: Hata, 4: ECC33,
5: SUI, 6: COST-Hata, 7: FSPL, 8: ITWOM, 9: Ericsson
-pe Prop model mode: 1=Urban,2=Suburban,3=Rural
-ked Knife edge diffraction (Default for ITM)
-ng Normalise Path Profile graph
-haf Halve 1 or 2 (optional)

6
build.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/bash
rm -f signalserver
rm -f signalserverHD
g++ -Wall -O3 -s -lm -fomit-frame-pointer itwom3.0.cpp models.cpp main.cpp -o signalserver
./signalserver

8218
main.cpp Normal file → Executable file

File diff suppressed because it is too large Load Diff

248
models.cpp Normal file
View File

@@ -0,0 +1,248 @@
/*****************************************************************************
* RF propagation models for Signal Server by Alex Farrant, CloudRF.com *
* *
* 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>
#include <stdio.h>
using namespace std;
/*
Whilst every effort has been made to ensure the accuracy of the models, their accuracy is not guaranteed.
Finding a reputable paper to source these models from took a while. There was lots of bad copy-pasta out there.
A good paper: http://www.cl.cam.ac.uk/research/dtg/lce-pub/public/vsa23/VTC05_Empirical.pdf
*/
#define PI 3.14159265
/* Acute Angle from Rx point to an obstacle of height (opp) and distance (adj) */
double incidenceAngle(double opp, double adj){
return atan2(opp,adj) * 180 / PI;
}
/*
Knife edge diffraction:
This is based upon a recognised formula like Huygens, but trades thoroughness for increased speed
which adds a proportional diffraction effect to obstacles.
*/
double ked(double freq, double elev[], double rxh, double dkm){
double obh,obd,rxobaoi=0,d,dipheight=25;
obh=0; // Obstacle height
obd=0; // Obstacle distance
dkm=dkm*1000; // KM to metres
// walk along path
for(int n=2;n<(dkm/elev[1]);n++){
d = (n-2)*elev[1]; // no of points * delta = km
//Find dip(s)
if(elev[n]<(obh+dipheight)){
// Angle from Rx point to obstacle
rxobaoi = incidenceAngle((obh-(elev[n]+rxh)),d-obd);
} else{
// Line of sight or higher
rxobaoi=0;
}
//note the highest point
if(elev[n]>obh){
obh=elev[n];
obd=d;
}
}
if(rxobaoi >= 0){
return rxobaoi / (300/freq); // Diffraction angle divided by wavelength (m)
}else{
return 0;
}
}
double HATApathLoss(float f,float TxH, float RxH, float d, int mode){
/*
HATA model for cellular planning
Frequency (MHz) 150 to 1500MHz
Base station height 30-200m
Mobile station height 1-10m
Distance 1-20km
modes 1 = URBAN, 2 = SUBURBAN, 3 = OPEN
*/
if(f<150 || f>1500){
printf("Error: Hata model frequency range 150-1500MHz\n");
return 0;
}
float lRxH = log10(11.75*RxH);
float C_H = 3.2*lRxH*lRxH-4.97;
float logf = log10(f);
float L_u = 69.55 + 26.16*logf - 13.82*log10(TxH) - C_H + (44.9 - 6.55*log10(TxH))*log10(d);
if(!mode || mode==1){
return L_u; //URBAN
}
if(mode==2){ //SUBURBAN
float logf_28 = log10(f/28);
return L_u - 2*logf_28*logf_28 - 5.4;
}
if(mode==3){ //OPEN
return L_u - 4.78*logf*logf + 18.33*logf - 40.94;
}
return 0;
}
double COST231pathLoss(float f,float TxH, float RxH, float d, int mode){
/*
COST231 extension to HATA model
Frequency 1500 to 2000MHz
TxH = Base station height 30 to 200m
RxH = Mobile station height 1 to 10m
Distance 1-20km
modes 1 = URBAN, 2 = SUBURBAN, 3 = OPEN
*/
if(f<1500 || f>2000){
printf("Error: COST231 Hata model frequency range 1500-2000MHz\n");
return 0;
}
int C = 3; // 3dB for Urban
if(mode==2){
C = 0; // Suburban, rural
}
if(mode==3){
C = -3; // Suburban, rural
}
float lRxH = log10(11.75*RxH);
float C_H = 3.2*lRxH*lRxH-4.97;
float logf = log10(f);
double dbloss = 46.3 + (33.9 * logf) - (13.82 * log10(TxH)) - C_H + (44.9 - 6.55 * log10(TxH)) * log10(d) + C;
return dbloss;
}
double SUIpathLoss(float f,float TxH, float RxH, float d, int mode){
/*
f = Frequency (MHz)
TxH = Transmitter height (m)
RxH = Receiver height (m)
d = distance (km)
mode 1 = Hilly + trees
mode 2 = Flat + trees OR hilly + light foliage
mode 3 = Flat + light foliage
*/
d=d*1000; // km to m
if(f<1900 || f>11000){
printf("Error: SUI model frequency range 1.9-11GHz\n");
return 0;
}
// Terrain mode A is default
double a = 4.6;
double b = 0.0075;
double c = 12.6;
double s = 10.6;
int XhCF = -10.8;
if(mode==2){
a=4.0;
b=0.0065;
c=17.1;
s=9.6;
}
if(mode==3){
a=3.6;
b=0.005;
c=20;
s=8.2;
XhCF = -20;
}
double d0 = 100;
double A = 20 * log10((4*M_PI*d0)/(300/f));
double y = (a - b * TxH) + (c/TxH);
double Xf = 6 * log10(f/2000);
double Xh = XhCF * log10(RxH/2);
return A + (10*y*log10(d/d0)) + Xf + Xh + s;
}
double ECC33pathLoss(float f,float TxH, float RxH, float d, int mode){
// MHz to GHz
f=f/1000;
double Gr = 0.759 * RxH - 1.862; // Big city (1)
// PL = Afs + Abm - Gb - Gr
double Afs = 92.4 + 20 * log10(d) + 20 * log10(f);
double Abm = 20.41 + 9.83 * log10(d) + 7.894 * log10(f) + 9.56 * (log10(f) * log10(f));
double Gb = log10(TxH/200) * (13.958 + 5.8 * (log10(d) * log10(d)));
if(mode>1){ // Medium city
Gr = (42.57 + 13.7 * log10(f)) * (log10(RxH) - 0.585);
}
return Afs+Abm-Gb-Gr;
}
double EricssonpathLoss(float f,float TxH, float RxH, float d, int mode){
double a0=36.2, a1=30.2, a2=12, a3=0.1;
if(mode==2){ // Med loss
a0=43.2;
a1=68.93;
}
if(mode==1){ // High loss
a0=45.95;
a1=100.6;
}
double g1 = (11.75 * RxH) * (11.75 * RxH);
double g2 = (44.49 * log10(f)) - 4.78 * ((log10(f) * log10(f)));
double PL = a0+ a1 * log10(d) + a2 * log10(TxH) + a3 * log10(TxH) * log10(d) - (3.2 * log10(g1)) + g2;
return PL;
}
double FSPLpathLoss(float f, float d){
/*
Free Space Path Loss (ITU-R P.525) model
Frequency: Any
Distance: Any
*/
//MHz to GHz
f = f / 1000;
double dbloss = (20 * log10(d)) + (20 * log10(f)) + 92.45;
return dbloss;
}
/*
int main(int argc, char* argv[]){
if(argc<5){
printf("Need freq,TxH,RxH,dist,terr\n");
return 0;
}
int dis, ter;
double frq, TxH, RxH;
sscanf(argv[1],"%lf",&frq);
sscanf(argv[2],"%lf",&TxH);
sscanf(argv[3],"%lf",&RxH);
sscanf(argv[4],"%d",&dis);
sscanf(argv[5],"%d",&ter);
// ALL are freq in MHz and distances in metres
printf("FSPL: %.2f dB\n",FSPLpathLoss(frq,dis));
printf("HATA (%d): %.2f dB\n",ter,HATApathLoss(frq,TxH,RxH,dis,ter));
printf("COST-HATA (%d): %.2f dB\n",ter,COST231pathLoss(frq,TxH,RxH,dis,ter));
printf("SUI (%d): %.2f dB\n",ter,SUIpathLoss(frq,TxH,RxH,dis,ter));
printf("ECC33 (%d): %.2f dB\n",ter,ECC33pathLoss(frq,TxH,RxH,dis,ter));
printf("Ericsson (%d): %.2f dB\n",ter,EricssonpathLoss(frq,TxH,RxH,dis,ter));
}
*/

BIN
signalserver Executable file

Binary file not shown.

16
test.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
mkdir test
RAD=10
MAXRAD=30
FRQ=800
ERP=20
while [ $RAD -lt $MAXRAD ]; do
echo "Calculating $FRQ MHz @ $ERP Watts for $RAD km radius..."
time ./signalserver -m -d /var/SRTM3 -lat 51.47 -lon -1.50 -txh 15 -gc 2 -rxh 2 -m -dbm -rt -120 -R $RAD -erp $ERP -f $FRQ -o test/$RAD -pm 1 -res 1200 -t
convert test/$RAD.ppm test/$RAD.png
rm test/$RAD.ppm
rm test/$RAD.*cf
let RAD=RAD+5
done

BIN
test/10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 685 KiB

BIN
test/15.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 KiB

BIN
test/20.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 KiB

BIN
test/25.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 KiB