Communications Models API¶
Link budget calculations for communications systems.
Overview¶
from phased_array_systems.models.comms import CommsLinkModel, compute_fspl
# For direct link margin calculations
from phased_array_systems.models.comms.link_budget import compute_link_margin
Classes¶
CommsLinkModel
¶
Communications link budget calculator.
Computes EIRP, received power, noise power, SNR, and link margin for a point-to-point or satellite communications link.
Link Budget Equations
EIRP = P_tx_total + G_tx - L_tx P_rx = EIRP - L_path + G_rx N = 10log10(kT*B) + NF SNR = P_rx - N Margin = SNR - required_SNR
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
Model block name for identification
TYPE:
|
evaluate
¶
evaluate(arch: Architecture, scenario: CommsLinkScenario, context: dict[str, Any]) -> MetricsDict
Evaluate communications link budget.
| PARAMETER | DESCRIPTION |
|---|---|
arch
|
Architecture configuration
TYPE:
|
scenario
|
Communications link scenario
TYPE:
|
context
|
Additional context, may include antenna metrics: - g_peak_db: Antenna gain (uses this if provided) - scan_loss_db: Scan loss (uses this if provided)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
MetricsDict
|
Dictionary with link budget metrics: - tx_power_total_dbw: Total transmit power (dBW) - tx_power_per_elem_dbw: TX power per element (dBW) - g_tx_db: Transmit antenna gain (dB) - eirp_dbw: Effective Isotropic Radiated Power (dBW) - path_loss_db: Total path loss (dB) - g_rx_db: Receive antenna gain (dB) - rx_power_dbw: Received power (dBW) - noise_power_dbw: Noise power (dBW) - snr_rx_db: Received SNR (dB) - link_margin_db: Link margin (dB) |
Source code in src/phased_array_systems/models/comms/link_budget.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
Functions¶
compute_link_margin
¶
compute_link_margin(eirp_dbw: float, path_loss_db: float, g_rx_db: float, noise_temp_k: float, bandwidth_hz: float, noise_figure_db: float, required_snr_db: float) -> dict[str, float]
Standalone link margin calculation.
Convenience function for quick link budget calculations without full Architecture/Scenario objects.
| PARAMETER | DESCRIPTION |
|---|---|
eirp_dbw
|
Effective Isotropic Radiated Power (dBW)
TYPE:
|
path_loss_db
|
Total path loss (dB)
TYPE:
|
g_rx_db
|
Receive antenna gain (dB)
TYPE:
|
noise_temp_k
|
System noise temperature (K)
TYPE:
|
bandwidth_hz
|
Signal bandwidth (Hz)
TYPE:
|
noise_figure_db
|
Receiver noise figure (dB)
TYPE:
|
required_snr_db
|
Required SNR for demodulation (dB)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict[str, float]
|
Dictionary with rx_power_dbw, noise_power_dbw, snr_db, margin_db |
Source code in src/phased_array_systems/models/comms/link_budget.py
compute_fspl
¶
Compute Free Space Path Loss (FSPL).
FSPL = 20log10(4pidf/c) = 20log10(d) + 20log10(f) + 20log10(4pi/c) = 20log10(d) + 20log10(f) - 147.55 (with d in m, f in Hz)
| PARAMETER | DESCRIPTION |
|---|---|
freq_hz
|
Frequency in Hz
TYPE:
|
range_m
|
Range/distance in meters
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Free space path loss in dB (positive value) |
Source code in src/phased_array_systems/models/comms/propagation.py
Output Metrics¶
| Metric | Units | Description |
|---|---|---|
tx_power_total_dbw |
dBW | Total TX power |
tx_power_per_elem_dbw |
dBW | TX power per element |
g_tx_db |
dB | Transmit antenna gain |
eirp_dbw |
dBW | Effective isotropic radiated power |
path_loss_db |
dB | Total path loss |
fspl_db |
dB | Free space path loss only |
g_rx_db |
dB | Receive antenna gain |
rx_power_dbw |
dBW | Received signal power |
noise_power_dbw |
dBW | Receiver noise power |
snr_rx_db |
dB | Received SNR |
link_margin_db |
dB | Margin above required SNR |
required_snr_db |
dB | Required SNR |
Usage Examples¶
Using CommsLinkModel¶
from phased_array_systems.models.comms.link_budget import CommsLinkModel
model = CommsLinkModel()
# Without pre-computed antenna gain
metrics = model.evaluate(arch, scenario, context={})
# With pre-computed antenna gain
context = {
"g_peak_db": 28.0,
"scan_loss_db": 2.5,
}
metrics = model.evaluate(arch, scenario, context)
Quick Link Margin Calculation¶
from phased_array_systems.models.comms.link_budget import compute_link_margin
result = compute_link_margin(
eirp_dbw=50.0,
path_loss_db=160.0,
g_rx_db=30.0,
noise_temp_k=290.0,
bandwidth_hz=10e6,
noise_figure_db=3.0,
required_snr_db=10.0,
)
print(f"SNR: {result['snr_db']:.1f} dB")
print(f"Margin: {result['margin_db']:.1f} dB")
Free Space Path Loss¶
from phased_array_systems.models.comms.propagation import compute_fspl
# At 10 GHz, 100 km
loss = compute_fspl(freq_hz=10e9, range_m=100e3)
print(f"FSPL: {loss:.1f} dB") # ~152.4 dB