Added Free Space Path Loss model (ITU-R P.525)
This commit is contained in:
Cloud-RF
2014-01-15 20:33:51 +00:00
parent cdabfd517a
commit 07dedef969
2 changed files with 44 additions and 4 deletions

33
fspl.cpp Normal file
View File

@@ -0,0 +1,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;
}

View File

@@ -1,5 +1,5 @@
/****************************************************************************\ /****************************************************************************\
* Signal Server 1.3.7: Server optimised SPLAT! by Alex Farrant * * Signal Server 1.3.8: 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 *
* * * *
@@ -19,7 +19,7 @@
* for more details. * * for more details. *
* * * *
****************************************************************************** ******************************************************************************
* g++ -Wall -O3 -s -lm -fomit-frame-pointer itm.cpp cost.cpp hata.cpp main.cpp -o ss * * g++ -Wall -O3 -s -lm -fomit-frame-pointer itm.cpp hata.cpp cost.cpp fspl.cpp main.cpp -o ss *
\****************************************************************************/ \****************************************************************************/
#include <stdio.h> #include <stdio.h>
@@ -122,6 +122,8 @@ double HataLinkdB(float f,float h_B, float h_M, float d, int mode);
double CostHataLinkdB(float f,float h_B, float h_M, float d); double CostHataLinkdB(float f,float h_B, float h_M, float d);
double FsplLinkdB(float f, float d);
double ked(double freq, double elev[], double rxh, double dkm); double ked(double freq, double elev[], double rxh, double dkm);
double arccos(double x, double y) double arccos(double x, double y)
@@ -1788,6 +1790,11 @@ void PlotPropPath(struct site source, struct site destination, unsigned char mas
// COST231-HATA // COST231-HATA
loss=CostHataLinkdB(LR.frq_mhz,txelev,path.elevation[y]+(destination.alt*METERS_PER_FOOT),dkm); loss=CostHataLinkdB(LR.frq_mhz,txelev,path.elevation[y]+(destination.alt*METERS_PER_FOOT),dkm);
break; break;
case 7:
// ITU-R P.525 Free space path loss
loss=FsplLinkdB(LR.frq_mhz,dkm);
//fprintf(stdout,"MHz: %1f KM: %1f = %1fdB",LR.frq_mhz,dkm,loss);
break;
default: default:
point_to_point(elev,source.alt*METERS_PER_FOOT, point_to_point(elev,source.alt*METERS_PER_FOOT,
@@ -3803,7 +3810,7 @@ int main(int argc, char *argv[])
strncpy(ss_version,"1.3.7\0",6); strncpy(ss_version,"1.3.8\0",6);
strncpy(ss_name,"Signal Server\0",14); strncpy(ss_name,"Signal Server\0",14);
if (argc==1) if (argc==1)
@@ -3830,7 +3837,7 @@ int main(int argc, char *argv[])
fprintf(stdout," -R Radius (miles/kilometers)\n"); fprintf(stdout," -R Radius (miles/kilometers)\n");
fprintf(stdout," -res Pixels per degree. 300/600/1200(default)/3600 (optional)\n"); fprintf(stdout," -res Pixels per degree. 300/600/1200(default)/3600 (optional)\n");
fprintf(stdout," -t Terrain background\n"); fprintf(stdout," -t Terrain background\n");
fprintf(stdout," -pm Propagation model. 1: ITM (Default), 2: LOS, 3-5: Hata\n"); fprintf(stdout," -pm Propagation model. 1: ITM (Default), 2: LOS, 3-5: Hata, 6: COST231, 7: ITU525\n");
fprintf(stdout," -ked Knife edge diffraction (Default for ITM)\n"); fprintf(stdout," -ked Knife edge diffraction (Default for ITM)\n");
fprintf(stdout," -wf Win32 SDF tile names ('=' not ':')\n"); fprintf(stdout," -wf Win32 SDF tile names ('=' not ':')\n");
fprintf(stdout," -dbg Debug mode\n\n"); fprintf(stdout," -dbg Debug mode\n\n");