raypl
Path loss and phase change for RF propagation ray
Description
[
returns the path loss and phase shift for the specified RF propagation ray. The function
calculates the path loss and phase shift using free space loss and reflection loss derived
from the propagation path, reflection materials, and antenna polarizations.pl,phase] = raypl(ray)
By default, the raypl function assumes the antennas are
unpolarized. You can polarize the antennas by specifying the
TransmitterPolarization and ReceiverPolarization
name-value arguments.
The raypl function overrides the materials that are stored in
ray. By default, the function uses concrete materials. To specify
other materials, use the ReflectionMaterials argument.
For more information about the path loss computations, see Path Loss Computation.
[
specifies options using name-value arguments. For example,
pl,phase] = raypl(ray,Name=Value)ReflectionMaterials="brick" specifies the reflection material as
brick.
Examples
Change the reflection materials and frequency for a ray, and then reevaluate the path loss and phase shift.
Launch Site Viewer with buildings in Hong Kong. For more information about the OpenStreetMap® file, see [1].
viewer = siteviewer(Buildings="hongkong.osm");Create transmitter and receiver sites.
tx = txsite(Latitude=22.2789,Longitude=114.1625, ... AntennaHeight=10,TransmitterPower=5, ... TransmitterFrequency=28e9); rx = rxsite(Latitude=22.2799,Longitude=114.1617, ... AntennaHeight=1);
Create a ray tracing propagation model, which MATLAB® represents using a RayTracing object. Configure the model to use the image method and to find paths with up to 2 surface reflections. Then, perform the ray tracing analysis.
pm = propagationModel("raytracing", ... Method="image", ... MaxNumReflections=2); rays = raytrace(tx,rx,pm);
Find the first ray with two path reflections. Then, display the properties of the ray object.
idx = find([rays{1}.NumInteractions] == 2,1);
ray = rays{1}(idx)ray =
Ray with properties:
PathSpecification: 'Locations'
CoordinateSystem: 'Geographic'
TransmitterLocation: [3×1 double]
ReceiverLocation: [3×1 double]
LineOfSight: 0
Interactions: [1×2 struct]
Frequency: 2.8000e+10
PathLossSource: 'Custom'
PathLoss: 121.8592
PhaseShift: 4.5605
Read-only properties:
PropagationDelay: 8.3060e-07
PropagationDistance: 249.0068
AngleOfDeparture: [2×1 double]
AngleOfArrival: [2×1 double]
NumInteractions: 2
Display the ray in Site Viewer.
plot(ray)

By default, the model uses concrete for the terrain material and uses building materials derived from the OpenStreetMap file. When the OpenStreetMap file does not specify materials, the model uses concrete. In this case, the ray encounters concrete as the material. You can find the interaction materials by querying the Interactions property of the ray object.
ray.Interactions.MaterialName
ans = "concrete"
ans = "concrete"
You can calculate the path loss for different materials by using the raypl function. For this example, use metal for the first reflection and glass for the second reflection.
[ray.PathLoss,ray.PhaseShift] = raypl(ray,ReflectionMaterials=["metal","glass"]); ray
ray =
Ray with properties:
PathSpecification: 'Locations'
CoordinateSystem: 'Geographic'
TransmitterLocation: [3×1 double]
ReceiverLocation: [3×1 double]
LineOfSight: 0
Interactions: [1×2 struct]
Frequency: 2.8000e+10
PathLossSource: 'Custom'
PathLoss: 114.9541
PhaseShift: 4.5605
Read-only properties:
PropagationDelay: 8.3060e-07
PropagationDistance: 249.0068
AngleOfDeparture: [2×1 double]
AngleOfArrival: [2×1 double]
NumInteractions: 2
Display the recalculated ray. The slight change in color indicates the change in path loss.
plot(ray)

Change the frequency of the ray. Then, recalculate the path loss and phase shift. Display the ray again and observe the color change.
ray.Frequency = 2e9; [ray.PathLoss,ray.PhaseShift] = raypl(ray,ReflectionMaterials=["metal","glass"]); plot(ray)

Appendix
[1] The OpenStreetMap file is downloaded from https://www.openstreetmap.org, which provides access to crowd-sourced map data all over the world. The data is licensed under the Open Data Commons Open Database License (ODbL), https://opendatacommons.org/licenses/odbl/.
Calculate the path losses and phase shifts between co-polarized antennas and polarization-mismatched antennas, including cross-polarized antennas. For some polarization types, the phase shift calculated by the raypl function depends on the convention you use to specify the polarization.
Create a line-of-sight ray in an empty scene with Cartesian coordinates. Place the transmitter and receiver at locations along the x-axis.
ray = comm.Ray(TransmitterLocation=[0; 0; 0],ReceiverLocation=[10; 0; 0]);
Co-Polarized Antennas
Calculate the path losses and phase shifts for co-polarized antennas. When two antennas are co-polarized, the path loss includes zero loss that results from polarization mismatch.
Circular Polarization
When two antennas are both left-hand circular polarized (LHCP) or both right-hand circular polarized (RHCP), the antennas are co-polarized.
Calculate the path losses and phase shifts for co-polarized antennas with these polarization combinations:
Both antennas are left-hand circular polarized.
Both antennas are right-hand circular polarized.
[pl1,phase1] = raypl(ray,TransmitterPolarization="LHCP",ReceiverPolarization="LHCP")
pl1 = 58.0229
phase1 = 2.3699
[pl2,phase2] = raypl(ray,TransmitterPolarization="RHCP",ReceiverPolarization="RHCP")
pl2 = 58.0229
phase2 = 2.3699
Note that the path losses and phase shifts are equal.
Linear Polarization
When two linearly polarized antennas are aligned so that their polarization axes are parallel, the antennas are co-polarized. While the path loss includes zero loss that results from polarization mismatch, the phase shift depends on the convention you use to specify the polarization.
Calculate the path loss and phase shift for co-polarized antennas with these polarization combinations.
Both antennas are vertically polarized. The polarization type
"V" corresponds to the Jones vector[0; 1].Both antennas are horizontally polarized. The polarization type
"H" corresponds to the Jones vector[1; 0].
[pl3,phase3] = raypl(ray,TransmitterPolarization="V",ReceiverPolarization="V")
pl3 = 58.0229
phase3 = 2.3699
[pl4,phase4] = raypl(ray,TransmitterPolarization="H",ReceiverPolarization="H")
pl4 = 58.0229
phase4 = 5.5115
Note that the path losses are equal, but that the phase shifts differ by radians. The phase shifts are different because the raypl function expects you to define the polarization of the receive antenna as if it were transmitting. To follow this convention, rotate the horizontal component of the receiver polarization by radians. This combination is analogous to two parallel horizontal dipoles, which have a phase shift of radians unless you rotate the receiving horizontal dipole by radians.
Calculate the path loss and phase shift for the horizontally polarized antennas again, this time using the convention expected by raypl.
txPol5 = "H"; % corresponds to [1; 0] rxPol5 = [-1; 0]; [pl5,phase5] = raypl(ray,TransmitterPolarization=txPol5,ReceiverPolarization=rxPol5)
pl5 = 58.0229
phase5 = 2.3699
Note that the phase shift now matches the phase shifts for the vertically polarized, LHCP, and RHCP antennas.
Slanted Dipoles
Calculate the path loss and phase shift for co-polarized slanted dipoles, where both the transmit antenna and the receive antenna are rotated by 45 degrees around the perpendicular axis through both antennas. Following the same polarization convention as for the horizontally polarized antennas, specify the horizontal component of the receiver polarization as radians relative to the transmitting polarization.
txPol6 = [1; 1]/sqrt(2); rxPol6 = [-1; 1]/sqrt(2); [pl6,phase6] = raypl(ray,TransmitterPolarization=txPol6,ReceiverPolarization=rxPol6)
pl6 = 58.0229
phase6 = 2.3699
Note that the phase shift matches the phase shifts for the vertically polarized, LHCP, and RHCP antennas.
Polarization-Mismatched Antennas
When two antennas have mismatched polarization, the path loss includes non-zero loss as a result of polarization mismatch.
Calculate the path loss for antennas with mismatched polarization, where the transmit antenna is horizontally polarized and the receive antenna is rotated by 45 degrees around the perpendicular axis through both antennas. The combination corresponds to a horizontal dipole and a slanted 45-degree dipole.
txPol7 = "H"; % corresponds to [1; 0] rxPol7 = [1; 1]/sqrt(2); pl7 = raypl(ray,TransmitterPolarization=txPol7,ReceiverPolarization=rxPol7)
pl7 = 61.0332
Note that the path loss is approximately 3 decibels more than the path loss for the co-polarized antennas. This difference is due to only half the power being received.
Cross-Polarized Antennas
When two polarized antennas are aligned so that their polarization axes are orthogonal, they are cross-polarized. When two antennas are cross-polarized, the path loss is theoretically infinite.
Calculate the path losses for cross-polarized antennas with these polarization combinations.
The transmit antenna is horizontally polarized. The receive antenna is vertically polarized.
The transmit antenna is right-hand circular polarized. The receive antenna is left-hand circular polarized.
The transmit antenna is left-hand circular polarized. The receive antenna is right-hand circular polarized.
The antennas are cross-polarized slanted dipoles. Note that, per the polarization convention, antennas are cross-polarized when both the transmitter and receiver are slanted dipoles with the same polarization in a direction toward each other.
pl8 = raypl(ray,TransmitterPolarization="H",ReceiverPolarization="V")
pl8 = Inf
pl9 = raypl(ray,TransmitterPolarization="RHCP",ReceiverPolarization="LHCP")
pl9 = Inf
pl10 = raypl(ray,TransmitterPolarization="LHCP",ReceiverPolarization="RHCP")
pl10 = Inf
txPol11 = [1; 1]/sqrt(2); rxPol11 = [1; 1]/sqrt(2); pl11 = raypl(ray,TransmitterPolarization=txPol11,ReceiverPolarization=rxPol11)
pl11 = Inf
Input Arguments
RF propagation ray, specified as a comm.Ray object. The
PathSpecification property of the object must be
"Locations". All interactions in the
Interactions property of the ray must be of type
"Reflection".
Data Types: comm.Ray
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN, where Name is
the argument name and Value is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: raypl(ray,TransmitterPolarization="H",ReceiverPolarization="H"),
specifies the horizontal polarizations for the transmit and receive antennas for
ray.
Before R2021a, use commas to separate each name and value, and enclose
Name in quotes.
Example: raypl(ray,"TransmitterPolarization","H","ReceiverPolarization","H"),
specifies the horizontal polarizations for the transmit and receive antennas for
ray.
Reflection materials for a non-line-of-sight (NLOS) ray, specified as a string
scalar, a 1-by-NR string vector, a character vector, a
1-by-NR cell array of character vectors, a 2-by-1 numeric vector,
or a 2-by-NR numeric matrix. NR is the number of
reflections stored in ray.
When you specify one reflection material, the reflection material applies to all
the reflections. When you specify multiple reflection materials, each material applies
to the associated reflection point in ray.
To use predefined reflection materials, specify
ReflectionMaterialsas a string scalar, a character vector, a string vector, or a cell array of character vectors. Specify each reflection material as one of these options:"concrete"— Concrete"plasterboard"— Plasterboard"ceiling-board"— Ceiling board"chipboard"— Chipboard"floorboard"— Floorboard"brick"— Brick"wood"— Wood"glass"— Glass"metal"— Metal"marble"— Marble (since R2024a)"plywood"— Plywood (since R2024a)"water"— Water"vegetation"— Vegetation"loam"— Loam"PEC"— Perfect electrical conductor
To use custom reflection materials, specify a 2-by-1 numeric vector or a 2-by-NR numeric matrix. Each column is of the form
[rp; cv], whererpis the relative permittivity andcvis the conductivity.
For more information, see Permittivity and Conductivity Values for Common Materials.
Example: ReflectionMaterials=["concrete","water"], specifies
that a ray with two reflections uses the electrical characteristics of concrete at the
first reflection point and water at the second reflection point.
Data Types: string | char | double
Transmit antenna polarization type, specified as one of these values:
"none"— Unpolarized"V"— Linearly polarized in the vertical (θ) direction"H"— Linearly polarized in the horizontal (φ) direction"LHCP"— Left-hand circular polarized"RHCP"— Right-hand circular polarizedA normalized 2-by-1 Jones vector (also called a polarization matrix) of the form
[H;V], whereHis the horizontal component andVis the vertical component.
For more information about polarization types and Jones vectors, see Jones Vector Notation.
Example: TransmitterPolarization="RHCP" specifies right-hand
circular polarization for the transmit antenna.
Data Types: double | char | string
Receive antenna polarization type, specified as one of these values:
"none"— Unpolarized"V"— Linearly polarized in the vertical (θ) direction"H"— Linearly polarized in the horizontal (φ) direction"LHCP"— Left-hand circular polarized"RHCP"— Right-hand circular polarizedA normalized 2-by-1 Jones vector (also called a polarization matrix) of the form
[H;V], whereHis the horizontal component andVis the vertical component.
Starting in R2026a, specify the polarization type as if the antenna were transmitting, regardless of whether the antenna is a transmitter or a receiver. This convention is consistent with [5].
For more information about polarization types and Jones vectors, see Jones Vector Notation.
Example: ReceiverPolarization=[1;0] specifies horizontal
polarization for the receive antenna by using Jones vector notation.
Data Types: double | char | string
Orientation of the transmit antenna axes, specified as a 3-by-3 unitary matrix
indicating the rotation from the transmitter local coordinate system (LCS) into the
global coordinate system (GCS). When the CoordinateSystem property
of the comm.Ray is set to
"Geographic", the GCS orientation is the local East-North-Up
(ENU) coordinate system at transmitter. For more information, see Coordinate System Orientation.
Example: TransmitterAxes=eye(3), specifies that the local
coordinate system for the transmitter axes is aligned with the global coordinate
system. This is the default orientation.
Data Types: double
Orientation of the receive antenna axes, specified as a 3-by-3 unitary matrix
indicating the rotation from the receiver local coordinate system (LCS) into the
global coordinate system (GCS). The GCS orientation is the local East-North-Up (ENU)
coordinate system at receiver when the CoordinateSystem property of
the comm.Ray is set to
"Geographic". For more information, see Coordinate System Orientation.
Example: ReceiverAxes=[0 -1 0; 1 0 0; 0 0 1], specifies a 90°
rotation around the z-axis of the local receiver coordinate system
with respect to the global coordinate system.
Data Types: double
Output Arguments
Path loss in dB, returned as a nonnegative scalar.
Data Types: double
Phase shift in radians, returned as a scalar. The raypl
function uses the e-iωt time convention.
Data Types: double
More About
The raypl function uses the methods and equations
in International Telecommunications Union Recommendations (ITU-R) P.2040-3 [2] and ITU-R P.527-5 through ITU-R
P.527-6 [3] to calculate the relative
permittivity and conductivity for common materials.
For information about the values computed for building materials specified in ITU-R P.2040, see
buildingMaterialPermittivity.For information about the values computed for terrain materials specified in ITU-R P.527, see
earthSurfacePermittivity.
The function uses the constant values that are recommended by the 2022 Committee on Data of the International Science Council (CODATA) adjustment of fundamental constants [4].
This image shows the orientation of the electromagnetic fields in the global coordinate system (GCS) and the local coordinate systems of the transmitter and receiver.

When the CoordinateSystem property of the comm.Ray is set to
"Geographic", the GCS orientation is the local East-North-Up (ENU)
coordinate system at observer. The path loss computation accounts for the round-earth
differences between ENU coordinates at the transmitter and receiver.
The ray tracing model used by the raypl function calculates
reflection losses by tracking the horizontal and vertical polarizations of signals through
the propagation path. Total power loss is the sum of free space loss and reflection
loss.
This image shows a reflection path from a transmitter site tx to a receiver site rx.

The model determines polarization and reflection loss using these steps.
Track the propagation of the ray in 3-D space by calculating the propagation matrix P. The matrix is a repeating product, where i is the number of reflection points.
For each reflection, calculate Pi by transforming the global coordinates of the incident electromagnetic field into the local coordinates of the reflection plane, multiplying the result by a reflection coefficient matrix, and transforming the coordinates back into the original global coordinate system [1]. The equations for Pi and P0 are:
where:
s, p, and k form a basis for the plane of incidence (the plane created by the incident ray and the surface normal of the reflection plane). s and p are perpendicular and parallel, respectively, to the plane of incidence.
kin and kout are the directions (in global coordinates) of the incident and exiting rays, respectively.
sin and sout are the directions (in global coordinates) of the horizontal polarizations for the incident and exiting rays, respectively.
pin and pout are the directions (in global coordinates) of the vertical polarizations for the incident and exiting rays, respectively.
RH and RV are the Fresnel reflection coefficients for the horizontal and vertical polarizations, respectively. α is the incident angle of the ray and εr is the complex relative permittivity of the material.
Project the propagation matrix P into a 2-by-2 polarization matrix R. The model rotates the coordinate systems for the transmitter and receiver so that they are in global coordinates.
where:
Hrx and Vrx are the directions (in global coordinates) of the horizontal (Eθ) and vertical (Eϕ) polarizations, respectively, for the receiver.
Hin and Vin are the directions (in global coordinates) of the propagated horizontal and vertical polarizations, respectively.
Vtx is the direction (in global coordinates) of the nominal vertical polarization for the ray departing the transmitter.
ktx is the direction (in global coordinates) of the ray departing the transmitter.
Specify the normalized horizontal and vertical polarizations of the electric field at the transmitter and receiver by using the 2-by-1 Jones polarization vectors Jtx and Jrx, respectively. If either the transmitter or receiver are unpolarized, then the model assumes and sets .
Rotate Jrx into the frame of the transmitter.
Calculate the polarization and reflection loss IL by combining R, Jtx, and Jrx.
For Jones vector notation, the raypl function describes signal polarization using Jones calculus.
The orthogonal components of Jones vectors are defined for Eθ and Eφ. This table shows the Jones vector corresponding to various antenna polarizations.
For both the transmit antenna and the receive antenna, specify the polarization type as if the antenna were transmitting. This convention is consistent with IEEE® Standard 145-2013 [5].
This table lists the Jones vectors that correspond to different antenna
polarization types. The raypl function uses the e-iωt time convention.
| Antenna Polarization Type | Corresponding Jones Vector |
|---|---|
Linear polarized in the θ direction |
|
Linear polarized in the φ direction |
|
Left-hand circular polarized (LHCP) |
|
Right-hand circular polarized (RHCP) |
|
References
[1] Chipman, Russell A., Garam Young, and Wai Sze Tiffany Lam. "Fresnel Equations." In Polarized Light and Optical Systems. Optical Sciences and Applications of Light. Boca Raton: Taylor & Francis, CRC Press, 2019.
[2] International Telecommunications Union Radiocommunication Sector. Effects of Building Materials and Structures on Radiowave Propagation Above About 100MHz. Recommendation P.2040. ITU-R, approved August 23, 2023. https://www.itu.int/rec/R-REC-P.2040/en.
[3] International Telecommunications Union Radiocommunication Sector. Electrical Characteristics of the Surface of the Earth. Recommendation P.527. ITU-R, approved September 27, 2021. https://www.itu.int/rec/R-REC-P.527/en.
[4] Mohr, Peter J., Eite Tiesinga, David B. Newell, and Barry N. Taylor. “Codata Internationally Recommended 2022 Values of the Fundamental Physical Constants.” NIST, May 8, 2024. https://www.nist.gov/publications/codata-internationally-recommended-2022-values-fundamental-physical-constants.
[5] "IEEE Standard Definitions of Terms for Antennas." IEEE Std 145-2013 (Revision of IEEE Std 145-1993), March 2014, 1–50. https://doi.org/10.1109/IEEESTD.2014.6758443.
Extended Capabilities
Usage notes and limitations:
When you specify multiple reflective materials, you must define each value as a
character vector (char data type) in a cell array.
Refer to the usage notes and limitations in the C/C++ Code Generation section. The same usage notes and limitations apply to GPU code generation.
Version History
Introduced in R2020aRay tracing functions calculate path loss and phase shift using the polarization convention described by IEEE Standard 145-2013 [5], such that MATLAB® expects the polarization of the receive antenna to be defined as if it were transmitting.
As a result of this change, when you specify the
ReceiverPolarization argument as "H" or a Jones
vector, the raypl function can return different values in R2026a
compared to previous releases.
To update your code, rotate receiver polarizations with a horizontal component by
π radians. This table shows some typical uses of the
ReceiverPolarization argument and how to update your
code.
ReceiverPolarization Before R2026a | ReceiverPolarization in R2026a |
|---|---|
"H" | [-1;0] |
A Jones vector specified by [H;V], where
H is the horizontal component and V is the
vertical component. | [-H;V] |
This change does not affect circular polarization combinations, such as when both
TransmitterPolarization and ReceiverPolarization
are specified as "RHCP".
The ReflectionMaterials argument will not support
"perfect-reflector" in a future release. Use "PEC"
instead. The behavior of "perfect-reflector" and "PEC"
is the same.
The raypl function models materials using the constant values
that are recommended by the 2022 Committee on Data of the International Science Council
(CODATA) adjustment of fundamental constants [4].
In previous releases, the function used constant values from ITU-R P.2040 and P.527. As
a result of this change, the raypl function can return different
values in R2025a compared to previous releases.
The raypl function models materials using the methods and equations
in ITU-R P.2040-3 and ITU-R P.527-5 through ITU-R P.527-6.
In previous releases, the function used ITU-R P.2040-1. As a result of these changes,
the raypl function can return different values in R2024a compared to
previous releases.
Specify the reflection materials as marble or plywood by using the
ReflectionMaterials name-value argument and specifying
"marble" or "plywood" as input.
When you find propagation paths using the raytrace function and a
ray tracing model that uses the shooting and bouncing rays (SBR) method, MATLAB corrects the results so that the geometric accuracy of each path is exact,
using single-precision floating-point computations. In previous releases, the paths have
approximate geometric accuracy.
As a result, when you use rays returned by the raytrace function as
input to the raypl function, the raypl function
can return different results than in previous releases.
See Also
Functions
Objects
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)