forked from ExternalVendorCode/Signal-Server
2.5 - Major refactor
This commit is contained in:
26
models/ecc33.cc
Normal file
26
models/ecc33.cc
Normal file
@@ -0,0 +1,26 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
double ECC33pathLoss(float f, float TxH, float RxH, float d, int mode)
|
||||
{
|
||||
|
||||
if (f < 700 || f > 3500) {
|
||||
printf("Error: ECC33 model frequency range 700-3500MHz\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
// MHz to GHz
|
||||
f = f / 1000;
|
||||
|
||||
double Gr = 0.759 * RxH - 1.862; // Big city with tall buildings (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 (Europe)
|
||||
Gr = (42.57 + 13.7 * log10(f)) * (log10(RxH) - 0.585);
|
||||
}
|
||||
return Afs + Abm - Gb - Gr;
|
||||
}
|
Reference in New Issue
Block a user