sdr.fspl(distance: ArrayLike, freq: ArrayLike) NDArray[float_]

Calculates the free-space path loss (FSPL) in dB.

\[\text{FSPL} = 10 \log_{10} \left( \frac{4 \pi d f}{c} \right)^2\]

Parameters:
distance: ArrayLike

The distance \(d\) in meters between the transmitter and receiver.

freq: ArrayLike

The frequency \(f\) in Hz of the signal.

Returns:

The free-space path loss (FSPL) in dB.

Note

The free-space path loss equation is only valid in the far field. For \(d < \lambda / 4 \pi\), the FSPL equation has a negative result, implying a path gain. This is not possible. So these path losses are set to 0 dB.

Examples

Compute the free-space path loss for a 1 km link at 1 GHz.

In [1]: sdr.fspl(1e3, 1e9)
Out[1]: 92.44778322188337

The free-space path loss is proportional to the square of the distance. So, doubling the distance results in a 6 dB increase in the free-space path loss.

In [2]: sdr.fspl(2e3, 1e9)
Out[2]: 98.468383135163

The free-space path loss is also proportional to the square of the frequency. So, doubling the frequency results in a 6 dB increase in the free-space path loss.

In [3]: sdr.fspl(1e3, 2e9)
Out[3]: 98.468383135163

Plot the free-space path loss at 1 GHz for distances up to 1 km.

In [4]: d = np.linspace(0, 1_000, 1000)  # m

In [5]: fspl = sdr.fspl(d, 1e9)  # dB

In [6]: plt.figure(figsize=(8, 4)); \
   ...: plt.plot(d, fspl); \
   ...: plt.xlabel('Distance (m)'); \
   ...: plt.ylabel('Free-space path loss (dB)'); \
   ...: plt.grid(True); \
   ...: plt.tight_layout()
   ...: 
../../_images/sdr_fspl_1.png