eeveetza / Py1812

Python Implementation of Recommendation ITU-R P.1812
GNU General Public License v3.0
7 stars 1 forks source link

Correction for Free-Space Path Loss Calculation in P.1812 Implementation #6

Closed drcaguiar closed 7 months ago

drcaguiar commented 7 months ago

Hello,

I've noticed a potential issue with the implementation of the free-space path loss calculation. According to the ITU-R P.1812 recommendation, the basic transmission loss due to free-space propagation (Lbfs) should be calculated with the formula: image However, in the current implementation, the second log10 multiplication factor for dfs2 seems to be 10 instead of the required 20:

Lbfs = 92.4 + 20.0 * np.log10(f) + 10.0 * np.log10(dfs2)

This could lead to an underestimation of the basic transmission loss. The correct implementation, according to the standard formula, should be:

Lbfs = 92.4 + 20.0 * np.log10(f) + 20.0 * np.log10(dfs2)

I suggest revising the calculation to align with the recommendation to ensure the accuracy of the loss predictions.

eeveetza commented 7 months ago

Note that since dfs2 denotes the 3D distance squared $d_{fs}^2$, the following is equivalent:

$10\log{10} d{fs}^2 = 20\log{10}d{fs}$

For that reason, the code implementing formula (8) is correct and there is no need for any revision:

    # Basic transmission loss due to free-space propagation
    dfs2 = d**2 + ((hts - hrs) / 1000.0) ** 2  # (8a)

    Lbfs = 92.4 + 20.0 * np.log10(f) + 10.0 * np.log10(dfs2)  # (8)

Also note that the basic transmission loss results obtained using the python code agree well with the reference results produced by the reference MATLAB/Octave implementation of the same Recommendation, which have been validated and approved by the ITU-R WP 3K (and defined in ./tests).

Based on the above, this issue is closed.