The Terrain Profile
The terrain profile can be obtained using the NASA srtm V 4 data. This a set of terrain maps between
the 60 degree parallels. There are two versions on a 100m square or 30m square on most of the land mass.
Plotting the height of each square between the Tx and the Rx we obtain a height profile for the terrain.

Where
Roughness = average terrain height.
h = array of heights along the terrain profile.
n = number heights in the profile.
The Method qlrps.
Complex qlrps(Double fmhz, Double zsys, Double en0, Polarization ipol, Double eps, Double sgm)
{
const Double gma = 157e-9;
_wn = fmhz * 0.02096436058;
_ens = en0;
if (zsys != 0) _ens = _ens * Math.Exp(-zsys / 9460.0);
_gme = gma * (1 - (0.04665 * Math.Exp(_ens * 5.5772448e-3)));
var zq = new Complex(eps, (376.62 * sgm / _wn));
var prop_zgnd = Complex.Sqrt(zq - 1);
if (ipol != Polarization.Horizontal) prop_zgnd = prop_zgnd / zq;
_zgnd = prop_zgnd;
return _zgnd;
}
Algorithm 1.1
k = 2 Π \ λ = f \ f0 with f0 = 47.70 MHz
λ is wavelength m and f frequency MHz
Algorithm 1.2
Ng = No * exp(zs \ z1) with z1 = 9.46 Km
No = surface resistivity reduced to sea level.
zs = general elevation over terrain profile.
Algorithm 1.3
γe = γa * (1.0 - 0.04665 * exp(Ng / N1)
N1 = 179.3 N-units,.
γa = 157 N-units/km.
The surface transfer impedance is defined in terms of surface relative permittivity,
surface conductivity and polarisation.
Horizontal Polarisation: Zg = √(εr - 1)
Vertical Polarisation: Zg = √(εr - 1) / εr
εr is the complex relative permittivity.
Where: εr = ε + jZo σ / k
Zo = 376.62 Ohms.
σ = surface conductivity.