pub struct LinkBudget {
pub transmit_power_dbm: Decibels,
pub transmit_antenna_gain_dbi: Decibels,
pub transmit_cable_loss_db: Decibels,
pub receive_antenna_gain_dbi: Decibels,
pub receive_cable_loss_db: Decibels,
pub noise_figure_db: Decibels,
}Expand description
The gains and losses of a link, from the transmitting radio to the receiving one.
The fields are the parts of a deployment a maker chooses: how hard the radio drives,
which antenna goes on each end, and how much cable sits between each antenna and its
radio. The methods add them up against a path and a receiver. The default is 0 dBm
between two isotropic antennas with no cable, heard with RADIO_NOISE_FIGURE_DB.
§Examples
use pamoja_lora::budget::{Decibels, LinkBudget};
// 14 dBm into a 2.15 dBi antenna through half a decibel of pigtail.
let budget = LinkBudget {
transmit_power_dbm: Decibels::from_db(14),
transmit_antenna_gain_dbi: Decibels::from_hundredths(215),
transmit_cable_loss_db: Decibels::from_tenths(5),
..LinkBudget::default()
};
assert_eq!(budget.eirp_dbm().to_string(), "15.65");
// Under a 16 dBm EIRP ceiling, that antenna and cable leave 14.35 dBm for the radio.
let most = budget.max_transmit_power_dbm(Decibels::from_db(16));
assert_eq!(most.to_string(), "14.35");Fields§
§transmit_power_dbm: DecibelsThe power the transmitting radio delivers at its antenna port, in dBm.
transmit_antenna_gain_dbi: DecibelsThe gain of the transmitting antenna over an isotropic antenna, in dBi.
transmit_cable_loss_db: DecibelsThe loss in the cable and connectors between the transmitting radio and its antenna, in dB.
receive_antenna_gain_dbi: DecibelsThe gain of the receiving antenna over an isotropic antenna, in dBi.
receive_cable_loss_db: DecibelsThe loss in the cable and connectors between the receiving antenna and its radio, in dB.
noise_figure_db: DecibelsThe noise figure of the receiver, in dB, such as RADIO_NOISE_FIGURE_DB for a
node or GATEWAY_NOISE_FIGURE_DB for a gateway.
Implementations§
Source§impl LinkBudget
impl LinkBudget
Sourcepub fn eirp_dbm(&self) -> Decibels
pub fn eirp_dbm(&self) -> Decibels
Returns the equivalent isotropically radiated power, in dBm.
§Returns
The transmit power plus the transmitting antenna gain, less the transmitting cable loss. This is the figure regional power ceilings limit.
Sourcepub fn received_dbm(&self, path_loss_db: Decibels) -> Decibels
pub fn received_dbm(&self, path_loss_db: Decibels) -> Decibels
Returns the power that reaches the receiving radio across a path, in dBm.
§Arguments
path_loss_db- the loss between the two antennas, such asfree_space_loss_db.
§Returns
The EIRP less the path loss, plus the receiving antenna gain, less the receiving cable loss.
Sourcepub fn sensitivity_dbm(&self, link: LinkSettings) -> Decibels
pub fn sensitivity_dbm(&self, link: LinkSettings) -> Decibels
Returns the weakest signal the receiver can demodulate on a link, in dBm.
§Arguments
link- the link settings, whose spreading factor and bandwidth set the floor.
§Returns
The sensitivity at this budget’s noise figure.
Sourcepub fn max_path_loss_db(&self, link: LinkSettings) -> Decibels
pub fn max_path_loss_db(&self, link: LinkSettings) -> Decibels
Sourcepub fn margin_db(&self, link: LinkSettings, path_loss_db: Decibels) -> Decibels
pub fn margin_db(&self, link: LinkSettings, path_loss_db: Decibels) -> Decibels
Returns how far above the sensitivity a signal arrives across a path, in dB.
§Arguments
link- the link settings, whose spreading factor and bandwidth set the sensitivity.path_loss_db- the loss between the two antennas.
§Returns
The link margin, which is negative where the path loses more than the link survives.
Sourcepub fn max_transmit_power_dbm(&self, eirp_ceiling_dbm: Decibels) -> Decibels
pub fn max_transmit_power_dbm(&self, eirp_ceiling_dbm: Decibels) -> Decibels
Returns the most transmit power that keeps the EIRP at or under a ceiling, in dBm.
§Arguments
eirp_ceiling_dbm- the EIRP limit, such as themax_eirp_dbma channel plan publishes for a frequency.
§Returns
The ceiling less the transmitting antenna gain, plus the transmitting cable loss. A higher-gain antenna leaves less power for the radio.
Trait Implementations§
Source§impl Clone for LinkBudget
impl Clone for LinkBudget
Source§fn clone(&self) -> LinkBudget
fn clone(&self) -> LinkBudget
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more