# gaspl

RF signal attenuation due to atmospheric gases

## Description

returns
the attenuation, `L`

= gaspl(`range`

,`freq`

,`T`

,`P`

,`den`

)`L`

, when signals propagate through
the atmosphere. `range`

represents the signal path
length, and `freq`

represents the signal carrier
frequency. `T`

represents the ambient temperature, `P`

represents
the atmospheric pressure, and `den`

represents
the atmospheric water vapor density.

The `gaspl`

function applies the International
Telecommunication Union (ITU) atmospheric gas attenuation model [1] to calculate path loss for signals
primarily due to oxygen and water vapor. The model computes attenuation
as a function of ambient temperature, pressure, water vapor density,
and signal frequency. The function requires that the signal path is
contained entirely in a uniform environment. Atmospheric parameters
do not vary along the signal path. The attenuation model applies only
for frequencies at 1–1000 GHz.

## Examples

**Atmospheric Gas Attenuation Spectrum**

Compute the attenuation spectrum from 1 to 1000 GHz for an atmospheric pressure of 101.300 kPa and a temperature of ${15}^{\circ}$C. Plot the spectrum for a water vapor density of 7.5 $\mathit{g}/{\mathit{m}}^{3}$ and then plot the spectrum for dry air (zero water vapor density).

Set the attenuation frequencies.

freq = [1:1000]*1e9;

Assume a 1 km path distance.

R = 1000.0;

Compute the attenuation for air containing water vapor.

T = 15; P = 101300.0; W = 7.5; L = gaspl(R,freq,T,P,W);

Compute the attenuation for dry air.

L0 = gaspl(R,freq,T,P,0.0);

Plot the attenuations.

semilogy(freq/1e9,L) hold on semilogy(freq/1e9,L0) grid xlabel('Frequency (GHz)') ylabel('Specific Attenuation (dB)') hold off

### Plot Attenuation Due to Atmospheric Gases and Free Space

First, plot the specific attenuation of atmospheric gases for frequencies from 1 GHz to 1000 GHz. Assume a sea-level dry air pressure of 101.325e5 kPa and a water vapor density of 7.5 $$g/{m}^{3}$$. The air temperature is ${20}^{\circ}$C. Specific attenuation is defined as dB loss per kilometer. Then, plot the actual attenuation at 10 GHz for a span of ranges.

**Plot Specific Atmospheric Gas Attenuation**

Set the atmosphere temperature, pressure, water vapor density.

T = 20.0; Patm = 101.325e3; rho_wv = 7.5;

Set the propagation distance, speed of light, and frequencies.

```
km = 1000.0;
c = physconst('LightSpeed');
freqs = [1:1000]*1e9;
```

Compute and plot the atmospheric gas loss.

loss = gaspl(km,freqs,T,Patm,rho_wv); semilogy(freqs/1e9,loss) grid on xlabel('Frequency (GHz)') ylabel('Specific Attenuation (dB/km)')

**Plot Actual Atmospheric and Free Space Attenuation**

Compute both free space loss and atmospheric gas loss at 10 GHz for ranges from 1 to 100 km. The frequency corresponds to an *X*-band radar. Then, plot the free space loss and the total (atmospheric + free space) loss.

ranges = [1:100]*1000; freq_xband = 10e9; loss_gas = gaspl(ranges,freq_xband,T,Patm,rho_wv); lambda = c/freq_xband; loss_fsp = fspl(ranges,lambda); semilogx(ranges/1000,loss_gas + loss_fsp.',ranges/1000,loss_fsp) legend('Atmospheric + Free Space Loss','Free Space Loss','Location','SouthEast') xlabel('Range (km)') ylabel('Loss (dB)')

## Input Arguments

`range`

— Signal path length

nonnegative real-valued scalar | *M*-by-1 nonnegative real-valued column vector | 1-by-*M* nonnegative real-valued row vector

Signal path length used to compute attenuation, specified as a nonnegative real-valued scalar or vector. You can specify multiple path lengths simultaneously. Units are in meters.

**Example: **`[13000.0,14000.0]`

`freq`

— Signal frequency

positive real-valued scalar | *N*-by-1 nonnegative real-valued column vector | 1-by-*N* nonnegative real-valued row vector

Signal frequency, specified as a positive real-valued scalar,
or as an *N*-by-1 nonnegative real-valued vector
or 1-by-*N* nonnegative real-valued vector. You can
specify multiple frequencies simultaneously. Frequencies must lie
in the range 1–1000 GHz. Units are in hertz.

**Example: **`[1.4e9,2.0e9]`

`T`

— Ambient temperature

real-valued scalar

Ambient temperature, specified as a real-valued scalar. Units are in degrees Celsius.

**Example: **`-10.0`

`P`

— Dry air pressure

positive real-valued scalar

Dry air pressure, specified as a positive real-valued scalar. Units are in Pa. One standard atmosphere at sea level is 101325 Pa.

**Example: **`101300.0`

`den`

— Water vapor density

nonnegative real-valued scalar

Water vapor density or absolute humidity, specified as a nonnegative
real-valued scalar. Units are g/m^{3}. The
maximum water vapor density of air at 30° C is approximately
30.0 g/m^{3}. The maximum water vapor density
of air at 0°C is approximately 5.0 g/m^{3}.

**Example: **`4.0`

## Output Arguments

`L`

— Signal attenuation

real-valued *M*-by-*N* matrix

Signal attenuation, returned as a real-valued *M*-by-*N* matrix.
Each matrix row represents a different path where *M* is
the number of paths. Each column represents a different frequency
where *N* is the number of frequencies. Units are
in dB.

## More About

### Atmospheric Gas Attenuation Model

This model calculates the attenuation of signals that propagate through atmospheric gases.

Electromagnetic signals attenuate when they propagate through the atmosphere. This effect is
due primarily to the absorption resonance lines of oxygen and water vapor, with smaller
contributions coming from nitrogen gas. The model also includes a continuous absorption
spectrum below 10 GHz. The ITU model *Recommendation ITU-R P.676-10: Attenuation by
atmospheric gases* is used. The model computes the specific attenuation
(attenuation per kilometer) as a function of temperature, pressure, water vapor density, and
signal frequency. The atmospheric gas model is valid for frequencies from 1–1000 GHz and
applies to polarized and nonpolarized fields.

The formula for specific attenuation at each frequency is

$$\gamma ={\gamma}_{o}(f)+{\gamma}_{w}(f)=0.1820f{N}^{\u2033}(f).$$

The quantity *N"()* is the imaginary part of the complex
atmospheric refractivity and consists of a spectral line component and a continuous component:

$${N}^{\u2033}(f)={\displaystyle \sum _{i}{S}_{i}{F}_{i}+{{N}^{\u2033}}_{D}^{}(f)}$$

The spectral component consists of a sum of discrete spectrum terms
composed of a localized frequency bandwidth function,
*F(f)*_{i}, multiplied by a spectral line strength,
*S*_{i}. For atmospheric oxygen, each spectral line
strength is

$${S}_{i}={a}_{1}\times {10}^{-7}{\left(\frac{300}{T}\right)}^{3}\mathrm{exp}\left[{a}_{2}(1-\left(\frac{300}{T}\right)\right]P.$$

For atmospheric water vapor, each spectral line strength is

$${S}_{i}={b}_{1}\times {10}^{-1}{\left(\frac{300}{T}\right)}^{3.5}\mathrm{exp}\left[{b}_{2}(1-\left(\frac{300}{T}\right)\right]W.$$

*P* is the dry air pressure, *W* is the
water vapor partial pressure, and *T* is the ambient temperature. Pressure
units are in hectoPascals (hPa) and temperature is in degrees Kelvin. The water vapor
partial pressure, *W*, is related to the water vapor density, ρ, by

$$W=\frac{\rho T}{216.7}.$$

The total atmospheric pressure is *P* +
*W*.

For each oxygen line, *S _{i}* depends on two parameters,

*a*and

_{1}*a*. Similarly, each water vapor line depends on two parameters,

_{2}*b*and

_{1}*b*. The ITU documentation cited at the end of this section contains tabulations of these parameters as functions of frequency.

_{2}The localized frequency bandwidth functions *F _{i}(f)* are
complicated functions of frequency described in the ITU references
cited below. The functions depend on empirical model parameters that
are also tabulated in the reference.

To compute the total attenuation for narrowband signals along
a path, the function multiplies the specific attenuation by the path
length, *R*. Then, the total attenuation is *L _{g}=
R(γ_{o} + γ_{w})*.

You can apply the attenuation model to wideband signals. First, divide the wideband signal into frequency subbands, and apply attenuation to each subband. Then, sum all attenuated subband signals into the total attenuated signal.

## References

[1] Radiocommunication Sector of International
Telecommunication Union. *Recommendation ITU-R P.676-10:
Attenuation by atmospheric gases* 2013.

## Extended Capabilities

### C/C++ Code Generation

Generate C and C++ code using MATLAB® Coder™.

Usage notes and limitations:

Does not support variable-size inputs.

## Open Example

You have a modified version of this example. Do you want to open this example with your edits?

## 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.

# Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

## How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

### Americas

- América Latina (Español)
- Canada (English)
- United States (English)

### Europe

- 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)