File Exchange

image thumbnail


version (65.7 KB) by Grant Lohsen
A class that contains two RF propagation loss models; longley-rice and hata


Updated 15 Jun 2016

View License

-An implementation of a point to point Longley-Rice model in matlab based on FORTAN and C implementation from NTIS ITS:
-A Hata model for cellular

-a velocity of propagation algorithm from "Compensating for propagation errors in elecgtromagnetic measuring systems" by Sidney Bertram. Published in Volume 8 issue 3, march 1971 pg 58-63 of IEEE Spectrum.

Cite As

Grant Lohsen (2020). CL_Propagation_RF_LR (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (14)

B. van den Heuvel

Thanks for sharing this code, it got me started nicely when studying the Longley-Rice model in Area mode. However, I found a few bugs when comparing results to the C++/Fortran implementation as provided by NTIA/ITS. Let me document these bugs for the sake of other people considering using this code. Actually, you may want instead to write a simple mex-file wrapper around the C++ source code of NTIA/ITS.
Identified bugs:
1) Bug in “fHeightGain” (Line 344):
% output=2.5e-5*x^2/pk+20*log(pk)-15; %Wrong! This deviates from NTIA/ITS
output=2.5e-5*x^2/pk+8.686*log(pk)-15; % Correct. ‘log’ is the natural logarithm, not log10
2) Bug in “fTroposcatterAtt” (Line 430): the variable ‘Tempvars’ is changed, but this is not remembered inbetween calls, as it should be according to the C++ implementation.

There are also a couple of other issues:
Missing classes “Constants_” and "signalType_"
Incorrect implementation of “updateAreaCalcsForNewDistance”: Inconsistent use of substruct ‘struct_Internal’
These problems are easy to identify and solve. The bugs above proved to be nastier to track down.

B. van den Heuvel

Minor correction on my bug-report: the second identified bug is in line 430, not line 438.

Paul Cuda

Smith Bob

Great job Grant and wencheng zuo! However owing to the obstacles described earlier of Alejandro , can you elaborate on how to use this code? Or send an email to:

wencheng zuo

Thanks for your code, which has been successfully debugged

wencheng zuo

Great job! But as with the problem described earlier, can you elaborate on how to use this code? Or send an email to:

Alejandro Jimenez

I seem to also get an error like that described by Sang Woo

>> CL_Propagation_RF_LR
Invalid default value for property 'cID' in class 'CL_Propagation_RF_LR':
Undefined variable "signalType_" or class "signalType_.LR".

Not sure why it is not working, could someone help?

Shahzaib Amjad

sang woo

Great work Grant. This is just what i need. However, i got problem to activate code. Example
obj = CL_Propagation_RF_LR; => error at "cID = signalType_.LR;" error said signalType_.LR is not defind.
If i remove "cID = signalType_.LR;" and conduct obj.test then Constants_.Z0 parameter is not found.

Also operation of point to point also not working due to some input value problem.
I confuses with elevation data input type. other i just input simple values but does not working.

struct_Input.Frequency = 1000000000;
struct_Input.Elevation = 10; %%.Elevation - terrain elevation profile, (list of points) (m)
struct_Input.Resolution = 1000;
struct_Input.TX_Height = 100;
struct_Input.RX_Height = 1;
struct_Input.eps = 1;
struct_Input.sgm =1;
struct_Input.surfref = 1;
struct_Input.Climate = 1;
struct_Input.Polarization =1;
struct_Input.Confidence = 0.99;
struct_Input.Reliability = 0.99;

Nice work!

Grant Lohsen

Neal: obj is due to this class being object oriented. see this for more info:

as to the rest of the care and feeding of the function please see my comment to Stylianos

Neal Seidl

Hi Grant,

Can you please elaborate on how to setup and call point_to_point()? What is the parameter "obj"? Thanks!

Grant Lohsen

Stylianos, for Longley-Rice prop loss use the point_to_point function and feed as detailed in the file

%Point to Point Longley-Rice
function struct_Output = point_to_point(obj,struct_Input)
%Function Name:
% point_to_point
% struct_Input - Input containing the fields:
% .Frequency - Frequency to calculate loss at (Hz)
% .Elevation - terrain elevation profile, (list of points) (m)
% .Resolution - terrain input resolution (distance b/t points) (m)
% .TX_Height - Transmit antenna height above ground (m)
% .RX_Height - Recieve antenna height above ground (m)
% .eps - Soil dielectric
% .sgm - Surface conductivity
% .surfref - Surface refractivity
% .Climate - Climate, 1-Equitorial, 2-Continental Subtropical, 3-Maritime Tropical, 4-Desert
% 5-Continental Temperate, 6-Maritime Temperate Over Lane 7-Maritime Temperate Over Sea
% .Polarization - 1 is vertical, 0 is horizontal.
% .Confidence - confidence for statistical analysis (.01 to .99)
% .Reliability - Reliability to calculate statistics for (.01 to .99)
% struct_Output - Output containing the fields:
% .dbloss - Final Output loss (dB)
% .error_ID - Error ID, 0 = no error, 1 = may be out of range, 3 = out of range
% .error_msg - Detailed error info (string)
%Functions Called:
% fLongleyRicePropSetup
% fLongleyRicePointtoPoint
% fAttVariability
% Calculate path loss using the Longley-Rice Irregular terrain
% model.


I don't see how it works

MATLAB Release Compatibility
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!