forked from ExternalVendorCode/Signal-Server
Ericcsson bugfix
This commit is contained in:
2
main.cc
2
main.cc
@@ -1,4 +1,4 @@
|
|||||||
double version = 3.01;
|
double version = 3.02;
|
||||||
/****************************************************************************\
|
/****************************************************************************\
|
||||||
* Signal Server: Radio propagation simulator by Alex Farrant QCVS, 2E0TDW *
|
* Signal Server: Radio propagation simulator by Alex Farrant QCVS, 2E0TDW *
|
||||||
******************************************************************************
|
******************************************************************************
|
||||||
|
@@ -5,15 +5,14 @@
|
|||||||
double EricssonpathLoss(float f, float TxH, float RxH, float d, int mode)
|
double EricssonpathLoss(float f, float TxH, float RxH, float d, int mode)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
http://research.ijcaonline.org/volume84/number7/pxc3892830.pdf
|
|
||||||
AKA Ericsson 9999 model
|
AKA Ericsson 9999 model
|
||||||
*/
|
*/
|
||||||
// Default is Urban which bizarrely has lowest loss
|
// Urban
|
||||||
double a0 = 36.2, a1 = 30.2, a2 = -12, a3 = 0.1;
|
double a0 = 36.2, a1 = 30.2, a2 = -12, a3 = 0.1;
|
||||||
|
|
||||||
if (f < 150 || f > 3500) {
|
if (f < 150 || f > 1900) {
|
||||||
fprintf
|
fprintf
|
||||||
(stderr,"Error: Ericsson9999 model frequency range 150-3500MHz\n");
|
(stderr,"Error: Ericsson9999 model frequency range 150-1900MHz\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,13 +20,13 @@ double EricssonpathLoss(float f, float TxH, float RxH, float d, int mode)
|
|||||||
a0 = 43.2;
|
a0 = 43.2;
|
||||||
a1 = 68.93;
|
a1 = 68.93;
|
||||||
}
|
}
|
||||||
if (mode == 1) { // "Rural" but has highest loss according to Ericsson.
|
if (mode == 1) { // Rural
|
||||||
a0 = 45.95;
|
a0 = 45.95;
|
||||||
a1 = 100.6;
|
a1 = 100.6;
|
||||||
}
|
}
|
||||||
double g1 = (11.75 * RxH) * (11.75 * RxH);
|
double g1 = 3.2 * (log10(11.75 * RxH) * log10(11.75 * RxH));
|
||||||
double g2 = (44.49 * log10(f)) - 4.78 * ((log10(f) * log10(f)));
|
double g2 = (44.49 * log10(f)) - 4.78 * ((log10(f) * log10(f)));
|
||||||
|
|
||||||
return a0 + a1 * log10(d) + a2 * log10(TxH) +
|
return a0 + a1 * log10(d) + a2 * log10(TxH) +
|
||||||
a3 * log10(TxH) * log10(d) - (3.2 * log10(g1)) + g2;
|
a3 * log10(TxH) * log10(d) - g1 + g2;
|
||||||
}
|
}
|
||||||
|
76
outputs.cc
76
outputs.cc
@@ -1012,7 +1012,7 @@ void PathReport(struct site source, struct site destination, char *name,
|
|||||||
source_alt, test_alt, dest_alt, source_alt2, dest_alt2,
|
source_alt, test_alt, dest_alt, source_alt2, dest_alt2,
|
||||||
distance, elevation, four_thirds_earth,
|
distance, elevation, four_thirds_earth,
|
||||||
free_space_loss = 0.0, eirp =
|
free_space_loss = 0.0, eirp =
|
||||||
0.0, voltage, rxp, power_density, dkm, txelev;
|
0.0, voltage, rxp, power_density, dkm;
|
||||||
FILE *fd = NULL, *fd2 = NULL;
|
FILE *fd = NULL, *fd2 = NULL;
|
||||||
|
|
||||||
snprintf(report_name, 80, "%s.txt%c", name, 0);
|
snprintf(report_name, 80, "%s.txt%c", name, 0);
|
||||||
@@ -1080,23 +1080,14 @@ void PathReport(struct site source, struct site destination, char *name,
|
|||||||
fprintf(fd2, "Distance to %s: %.2f miles\n", destination.name,
|
fprintf(fd2, "Distance to %s: %.2f miles\n", destination.name,
|
||||||
Distance(source, destination));
|
Distance(source, destination));
|
||||||
|
|
||||||
fprintf(fd2, "Azimuth to %s: %.2f degrees\n", destination.name,
|
fprintf(fd2, "Azimuth to %s: %.2f degrees grid\n", destination.name,
|
||||||
azimuth);
|
azimuth);
|
||||||
|
|
||||||
if (angle1 >= 0.0)
|
|
||||||
fprintf(fd2, "Elevation angle to %s: %+.4f degrees\n",
|
|
||||||
destination.name, angle1);
|
|
||||||
|
|
||||||
else
|
fprintf(fd2, "Downtilt angle to %s: %+.4f degrees\n",
|
||||||
fprintf(fd2, "Depression angle to %s: %+.4f degrees\n",
|
destination.name, angle1);
|
||||||
destination.name, angle1);
|
|
||||||
|
|
||||||
if ((angle2 - angle1) > 0.0001) {
|
|
||||||
if (angle2 < 0.0)
|
|
||||||
fprintf(fd2, "Depression\n");
|
|
||||||
else
|
|
||||||
fprintf(fd2, "Elevation\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Receiver */
|
/* Receiver */
|
||||||
|
|
||||||
@@ -1151,22 +1142,11 @@ void PathReport(struct site source, struct site destination, char *name,
|
|||||||
angle1 = ElevationAngle(destination, source);
|
angle1 = ElevationAngle(destination, source);
|
||||||
angle2 = ElevationAngle2(destination, source, earthradius);
|
angle2 = ElevationAngle2(destination, source, earthradius);
|
||||||
|
|
||||||
fprintf(fd2, "Azimuth to %s: %.2f degrees\n", source.name, azimuth);
|
fprintf(fd2, "Azimuth to %s: %.2f degrees grid\n", source.name, azimuth);
|
||||||
|
|
||||||
if (angle1 >= 0.0)
|
|
||||||
fprintf(fd2, "Elevation angle to %s: %+.4f degrees\n",
|
|
||||||
source.name, angle1);
|
|
||||||
|
|
||||||
else
|
fprintf(fd2, "Downtilt angle to %s: %+.4f degrees\n",
|
||||||
fprintf(fd2, "Depression angle to %s: %+.4f degrees\n",
|
source.name, angle1);
|
||||||
source.name, angle1);
|
|
||||||
|
|
||||||
if ((angle2 - angle1) > 0.0001) {
|
|
||||||
if (angle2 < 0.0)
|
|
||||||
fprintf(fd2, "Depression");
|
|
||||||
else
|
|
||||||
fprintf(fd2, "Elevation");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (LR.frq_mhz > 0.0) {
|
if (LR.frq_mhz > 0.0) {
|
||||||
fprintf(fd2, "\n\nPropagation model: ");
|
fprintf(fd2, "\n\nPropagation model: ");
|
||||||
@@ -1270,8 +1250,7 @@ void PathReport(struct site source, struct site destination, char *name,
|
|||||||
fprintf(fd2, "Fraction of Time: %.1lf%c\n", LR.rel * 100.0, 37);
|
fprintf(fd2, "Fraction of Time: %.1lf%c\n", LR.rel * 100.0, 37);
|
||||||
|
|
||||||
if (LR.erp != 0.0) {
|
if (LR.erp != 0.0) {
|
||||||
fprintf(fd2, "\nReceiver gain: %.2f dBd\n", rxGain);
|
fprintf(fd2, "\nReceiver gain: %.1f dBd / %.1f dBi\n", rxGain, rxGain+2.14);
|
||||||
fprintf(fd2, "Receiver gain: %.2f dBi\n", rxGain+2.14);
|
|
||||||
fprintf(fd2, "Transmitter ERP plus Receiver gain: ");
|
fprintf(fd2, "Transmitter ERP plus Receiver gain: ");
|
||||||
|
|
||||||
if (LR.erp < 1.0)
|
if (LR.erp < 1.0)
|
||||||
@@ -1426,8 +1405,7 @@ void PathReport(struct site source, struct site destination, char *name,
|
|||||||
strmode, errnum);
|
strmode, errnum);
|
||||||
*/
|
*/
|
||||||
dkm = (elev[1] * elev[0]) / 1000; // km
|
dkm = (elev[1] * elev[0]) / 1000; // km
|
||||||
txelev = elev[2] + (source.alt * METERS_PER_FOOT);
|
|
||||||
|
|
||||||
switch (propmodel) {
|
switch (propmodel) {
|
||||||
case 1:
|
case 1:
|
||||||
// Longley Rice ITM
|
// Longley Rice ITM
|
||||||
@@ -1444,35 +1422,29 @@ void PathReport(struct site source, struct site destination, char *name,
|
|||||||
case 3:
|
case 3:
|
||||||
//HATA 1, 2 & 3
|
//HATA 1, 2 & 3
|
||||||
loss =
|
loss =
|
||||||
HATApathLoss(LR.frq_mhz, txelev,
|
HATApathLoss(LR.frq_mhz, source_alt * METERS_PER_FOOT,
|
||||||
path.elevation[y] +
|
(path.elevation[y] * METERS_PER_FOOT) +
|
||||||
(destination.alt *
|
(destination.alt * METERS_PER_FOOT), dkm, pmenv);
|
||||||
METERS_PER_FOOT), dkm, pmenv);
|
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
// COST231-HATA
|
// COST231-HATA
|
||||||
loss =
|
loss =
|
||||||
ECC33pathLoss(LR.frq_mhz, txelev,
|
ECC33pathLoss(LR.frq_mhz, source_alt * METERS_PER_FOOT,
|
||||||
path.elevation[y] +
|
(path.elevation[y] * METERS_PER_FOOT) +
|
||||||
(destination.alt *
|
(destination.alt * METERS_PER_FOOT), dkm, pmenv);
|
||||||
METERS_PER_FOOT), dkm,
|
|
||||||
pmenv);
|
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
// SUI
|
// SUI
|
||||||
loss =
|
loss =
|
||||||
SUIpathLoss(LR.frq_mhz, txelev,
|
SUIpathLoss(LR.frq_mhz, source.alt * METERS_PER_FOOT,
|
||||||
path.elevation[y] +
|
(path.elevation[y] * METERS_PER_FOOT) +
|
||||||
(destination.alt *
|
(destination.alt * METERS_PER_FOOT), dkm, pmenv);
|
||||||
METERS_PER_FOOT), dkm, pmenv);
|
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
loss =
|
loss =
|
||||||
COST231pathLoss(LR.frq_mhz, txelev,
|
COST231pathLoss(LR.frq_mhz, source_alt * METERS_PER_FOOT,
|
||||||
path.elevation[y] +
|
(path.elevation[y] * METERS_PER_FOOT) +
|
||||||
(destination.alt *
|
(destination.alt * METERS_PER_FOOT), dkm,pmenv);
|
||||||
METERS_PER_FOOT), dkm,
|
|
||||||
pmenv);
|
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
// ITU-R P.525 Free space path loss
|
// ITU-R P.525 Free space path loss
|
||||||
@@ -1492,8 +1464,8 @@ void PathReport(struct site source, struct site destination, char *name,
|
|||||||
case 9:
|
case 9:
|
||||||
// Ericsson
|
// Ericsson
|
||||||
loss =
|
loss =
|
||||||
EricssonpathLoss(LR.frq_mhz, txelev,
|
EricssonpathLoss(LR.frq_mhz, source_alt * METERS_PER_FOOT,
|
||||||
path.elevation[y] +
|
(path.elevation[y] * METERS_PER_FOOT) +
|
||||||
(destination.alt *
|
(destination.alt *
|
||||||
METERS_PER_FOOT), dkm,
|
METERS_PER_FOOT), dkm,
|
||||||
pmenv);
|
pmenv);
|
||||||
|
Reference in New Issue
Block a user