Communications
RF link budget analysis for space communication systems.
Modulation Schemes
| Name | Bits per Symbol |
|---|---|
BPSK |
1 |
QPSK |
2 |
8PSK |
3 |
16QAM |
4 |
32QAM |
5 |
64QAM |
6 |
128QAM |
7 |
256QAM |
8 |
Antenna Patterns
| Pattern | Description |
|---|---|
ParabolicPattern |
Airy disk model for parabolic reflector antennas |
GaussianPattern |
Gaussian roll-off approximation |
DipolePattern |
Short and general dipole radiation patterns |
Quick Example
import lox_space as lox
# Define a Ka-band downlink
frequency = 29 * lox.GHz
# Transmitter: satellite with parabolic antenna
tx_pattern = lox.ParabolicPattern(diameter=0.98 * lox.m, efficiency=0.45)
tx_antenna = lox.ComplexAntenna(pattern=tx_pattern, boresight=[0.0, 0.0, 1.0])
tx = lox.Transmitter(frequency=frequency, power=10 * lox.W, line_loss=1.0 * lox.dB)
tx_system = lox.CommunicationSystem(antenna=tx_antenna, transmitter=tx)
# Receiver: ground station with known system noise temperature
rx_antenna = lox.SimpleAntenna(gain=40.0 * lox.dB, beamwidth=0.5 * lox.deg)
rx = lox.SimpleReceiver(frequency=frequency, system_noise_temperature=200 * lox.K)
rx_system = lox.CommunicationSystem(antenna=rx_antenna, receiver=rx)
# Define a QPSK channel at 5 Msps
channel = lox.Channel(
link_type="downlink",
symbol_rate=5 * lox.MHz,
required_eb_n0=10.0 * lox.dB,
margin=3.0 * lox.dB,
modulation=lox.Modulation("QPSK"),
roll_off=0.35,
fec=0.5,
)
# Compute a full link budget at 1000 km slant range
stats = lox.LinkStats.calculate(
tx_system=tx_system,
rx_system=rx_system,
channel=channel,
range=1000 * lox.km,
tx_angle=0.0 * lox.deg,
rx_angle=0.0 * lox.deg,
)
print(f"EIRP: {float(stats.eirp):.1f} dBW")
print(f"FSPL: {float(stats.fspl):.1f} dB")
print(f"C/N0: {float(stats.c_n0):.1f} dB·Hz")
print(f"Es/N0: {float(stats.es_n0):.1f} dB")
print(f"Eb/N0: {float(stats.eb_n0):.1f} dB")
print(f"Link margin: {float(stats.margin):.1f} dB")
Working with Decibels
import lox_space as lox
# Create from dB value or linear ratio
gain = 30.0 * lox.dB
gain_linear = lox.Decibel.from_linear(1000.0)
# Arithmetic
total = gain + 3.0 * lox.dB # 33.0 dB
diff = gain - 10.0 * lox.dB # 20.0 dB
# Convert back
print(f"{float(gain)} dB = {gain.to_linear():.0f} linear")
Free-Space Path Loss
import lox_space as lox
# FSPL at 1000 km range and 29 GHz
loss = lox.fspl(distance=1000 * lox.km, frequency=29 * lox.GHz)
print(f"FSPL: {float(loss):.1f} dB")
Environmental Losses
import lox_space as lox
losses = lox.EnvironmentalLosses(
rain=2.0 * lox.dB,
gaseous=0.3 * lox.dB,
atmospheric=0.5 * lox.dB,
)
print(f"Total: {float(losses.total()):.1f} dB")
# Pass to LinkStats.calculate via the losses parameter
stats = lox.LinkStats.calculate(
tx_system=tx_system,
rx_system=rx_system,
channel=channel,
range=1000 * lox.km,
tx_angle=0.0 * lox.deg,
rx_angle=0.0 * lox.deg,
losses=losses,
)
Decibel
A value in decibels.
Parameters:
-
–valueThe value in dB.
Methods:
-
from_linear–Creates a Decibel value from a linear power ratio.
-
to_linear–Returns the linear power ratio.
Modulation
Digital modulation scheme.
Parameters:
-
–nameOne of "BPSK", "QPSK", "8PSK", "16QAM", "32QAM", "64QAM", "128QAM", "256QAM".
Methods:
-
bits_per_symbol–Returns the number of bits per symbol.
ParabolicPattern
Parabolic antenna gain pattern.
Parameters:
-
–diameterAntenna diameter as Distance.
-
–efficiencyAperture efficiency (0, 1].
Methods:
-
beamwidth–Returns the half-power beamwidth, or
Nonewhen the -
from_beamwidth–Creates a parabolic pattern from a desired beamwidth.
-
gain–Returns the gain in dBi at the given frequency and off-boresight angle.
-
peak_gain–Returns the peak gain in dBi.
beamwidth
Returns the half-power beamwidth, or None when the
antenna diameter is smaller than ~1.22 wavelengths at this frequency.
from_beamwidth
staticmethod
from_beamwidth(
beamwidth: Angle, frequency: Frequency, efficiency: float
) -> ParabolicPattern
gain
Returns the gain in dBi at the given frequency and off-boresight angle.
GaussianPattern
Gaussian antenna gain pattern.
Parameters:
-
–diameterAntenna diameter as Distance.
-
–efficiencyAperture efficiency (0, 1].
Methods:
-
beamwidth–Returns the half-power beamwidth.
-
gain–Returns the gain in dBi at the given frequency and off-boresight angle.
-
peak_gain–Returns the peak gain in dBi.
gain
Returns the gain in dBi at the given frequency and off-boresight angle.
DipolePattern
Dipole antenna gain pattern.
Parameters:
-
–lengthDipole length as Distance.
Methods:
SimpleAntenna
A simple antenna with constant gain and beamwidth.
Parameters:
-
–gainPeak gain as Decibel.
-
–beamwidthHalf-power beamwidth as Angle.
ComplexAntenna
An antenna with a physics-based gain pattern and boresight vector.
Parameters:
-
–patternAn antenna pattern (ParabolicPattern, GaussianPattern, or DipolePattern).
-
–boresightBoresight direction as [x, y, z].
Methods:
-
beamwidth–Returns the half-power beamwidth, or
Nonewhen the -
gain–Returns the gain in dBi at the given frequency and off-boresight angle.
-
peak_gain–Returns the peak gain in dBi.
beamwidth
Returns the half-power beamwidth, or None when the
underlying pattern does not define a beamwidth.
gain
Returns the gain in dBi at the given frequency and off-boresight angle.
Transmitter
A radio transmitter.
Parameters:
-
–frequencyTransmit frequency.
-
–powerTransmit power.
-
–line_lossFeed/line loss as Decibel.
-
–output_back_offOutput back-off as Decibel (default Decibel(0)).
Methods:
-
eirp–Returns the EIRP in dBW for the given antenna and off-boresight angle.
eirp
eirp(antenna: SimpleAntenna | ComplexAntenna, angle: Angle) -> Decibel
Returns the EIRP in dBW for the given antenna and off-boresight angle.
SimpleReceiver
A simple receiver with a known system noise temperature.
Parameters:
-
–frequencyReceive frequency.
-
–system_noise_temperatureSystem noise temperature.
ComplexReceiver
An N-stage cascade receiver using the Friis noise formula.
Parameters:
-
–frequencyReceive frequency.
-
–antenna_noise_temperatureAntenna noise temperature.
-
–stagesList of NoiseStage (ordered: LNA first, then downstream).
-
–demodulator_lossDemodulator loss as Decibel (default Decibel(0)).
-
–implementation_lossOther implementation losses as Decibel (default Decibel(0)).
Methods:
-
chain_gain–Returns the total RF chain gain in dB.
-
from_feed_loss_and_noise_figure–Creates a two-stage model: lossy feed line at room temperature followed by a receiver.
-
from_lna_and_noise_figure–Creates a two-stage model: LNA followed by a receiver characterised by noise figure.
-
system_noise_temperature–Returns the system noise temperature via the Friis formula.
from_feed_loss_and_noise_figure
staticmethod
from_feed_loss_and_noise_figure(
frequency: Frequency,
antenna_noise_temperature: Temperature,
feed_loss: Decibel,
receiver_noise_figure: Decibel,
receiver_gain: Decibel,
demodulator_loss: Decibel | None = None,
implementation_loss: Decibel | None = None,
) -> ComplexReceiver
Creates a two-stage model: lossy feed line at room temperature followed by a receiver.
from_lna_and_noise_figure
staticmethod
from_lna_and_noise_figure(
frequency: Frequency,
antenna_noise_temperature: Temperature,
lna_gain: Decibel,
lna_noise_temperature: Temperature,
receiver_noise_figure: Decibel,
demodulator_loss: Decibel | None = None,
implementation_loss: Decibel | None = None,
) -> ComplexReceiver
Creates a two-stage model: LNA followed by a receiver characterised by noise figure.
system_noise_temperature
system_noise_temperature() -> Temperature
Returns the system noise temperature via the Friis formula.
NoiseStage
A single stage in an RF receiver chain.
Parameters:
-
–gainStage gain as Decibel.
-
–noise_temperatureStage equivalent noise temperature.
Channel
A communication channel.
Parameters:
-
–link_type"uplink", "downlink", or "crosslink".
-
–symbol_rateSymbol rate as Frequency.
-
–required_eb_n0Required Eb/N0 as Decibel.
-
–marginRequired link margin as Decibel.
-
–modulationModulation scheme.
-
–roll_offRoll-off factor (default 0.35).
-
–fecForward error correction code rate (default 0.5).
-
–chip_rateChip rate for DSSS as Frequency (optional).
Methods:
-
bandwidth–Returns the occupied channel bandwidth.
-
c_n–Computes C/N from a given C/N0.
-
data_rate–Returns the raw bit rate.
-
eb_n0–Computes Eb/N0 from a given C/N0.
-
es_n0–Computes Es/N0 from a given C/N0.
-
information_rate–Returns the information (post-FEC) bit rate.
-
link_margin–Computes the link margin from a given Eb/N0.
-
processing_gain–Returns the DSSS processing gain in dB, or None for narrowband.
-
spreading_factor–Returns the DSSS spreading factor, or None for narrowband.
EnvironmentalLosses
Atmospheric environmental losses computed from ITU-R models.
Computes rain, gaseous, cloud, scintillation, and depolarization attenuation for a slant path.
Parameters:
-
–latLatitude.
-
–lonLongitude.
-
–frequencyFrequency.
-
–elevationElevation angle (clamped to >= 5 deg).
-
–probabilityExceedance probability (% of average year).
-
–diameterPhysical antenna diameter.
-
–polarisation_tiltPolarisation tilt angle (default 45 deg for circular).
Methods:
-
total–Returns the total environmental loss in dB.
Attributes:
-
atmospheric(Decibel) –General atmospheric loss (combined total).
-
cloud(Decibel) –Cloud attenuation.
-
depolarization(Decibel) –Depolarization loss.
-
gaseous(Decibel) –Gaseous absorption.
-
rain(Decibel) –Rain attenuation.
-
scintillation(Decibel) –Scintillation loss.
CommunicationSystem
A communication system combining an antenna with optional transmitter and receiver.
Parameters:
-
–antennaA SimpleAntenna or ComplexAntenna.
-
–receiverA SimpleReceiver or ComplexReceiver (optional).
-
–transmitterA Transmitter (optional).
Methods:
-
carrier_power–Computes the received carrier power in dBW.
-
carrier_to_noise_density–Computes the carrier-to-noise density ratio (C/N0) in dB·Hz.
-
noise_power–Computes the noise power in dBW for a given bandwidth.
carrier_power
carrier_power(
rx_system: CommunicationSystem,
losses: Decibel,
range: Distance,
tx_angle: Angle,
rx_angle: Angle,
) -> Decibel
Computes the received carrier power in dBW.
carrier_to_noise_density
carrier_to_noise_density(
rx_system: CommunicationSystem,
losses: Decibel,
range: Distance,
tx_angle: Angle,
rx_angle: Angle,
) -> Decibel
Computes the carrier-to-noise density ratio (C/N0) in dB·Hz.
Parameters:
-
(rx_systemCommunicationSystem) –The receiving CommunicationSystem.
-
(lossesDecibel) –Additional losses as Decibel.
-
(rangeDistance) –Slant range as Distance.
-
(tx_angleAngle) –Off-boresight angle at transmitter as Angle.
-
(rx_angleAngle) –Off-boresight angle at receiver as Angle.
LinkStats
Complete link budget statistics.
Methods:
-
calculate–Computes a full link budget.
Attributes:
-
bandwidth(Frequency) –Channel bandwidth.
-
c_n(Decibel) –C/N in dB.
-
c_n0(Decibel) –Carrier-to-noise density ratio in dB·Hz.
-
carrier_rx_power(Decibel) –Received carrier power in dBW.
-
eb_n0(Decibel) –Eb/N0 in dB.
-
eirp(Decibel) –EIRP in dBW.
-
es_n0(Decibel) –Es/N0 in dB.
-
frequency(Frequency) –Link frequency.
-
fspl(Decibel) –Free-space path loss in dB.
-
gt(Decibel) –Receiver G/T in dB/K.
-
margin(Decibel) –Link margin in dB.
-
noise_power(Decibel) –Noise power in dBW.
-
slant_range(Distance) –Slant range.
-
symbol_rate(Frequency) –Symbol rate.
calculate
staticmethod
calculate(
tx_system: CommunicationSystem,
rx_system: CommunicationSystem,
channel: Channel,
range: Distance,
tx_angle: Angle,
rx_angle: Angle,
losses: EnvironmentalLosses | None = None,
) -> LinkStats
Computes a full link budget.
Parameters:
-
(tx_systemCommunicationSystem) –The transmitting CommunicationSystem.
-
(rx_systemCommunicationSystem) –The receiving CommunicationSystem.
-
(channelChannel) –The Channel.
-
(rangeDistance) –Slant range as Distance.
-
(tx_angleAngle) –Off-boresight angle at transmitter as Angle.
-
(rx_angleAngle) –Off-boresight angle at receiver as Angle.
-
(lossesEnvironmentalLosses | None, default:None) –EnvironmentalLosses (optional, defaults to none).
fspl
builtin
freq_overlap
builtin
Computes the frequency overlap factor between a receiver and an interferer.
Parameters:
-
(rx_freqFrequency) –Receiver center frequency.
-
(rx_bwFrequency) –Receiver bandwidth.
-
(tx_freqFrequency) –Interferer center frequency.
-
(tx_bwFrequency) –Interferer bandwidth.
Returns:
-
float–Overlap factor in [0, 1].
power_flux_density
builtin
power_flux_density(
eirp: Decibel, distance: Distance, occupied_bw: Frequency, reference_bw: Frequency
) -> Decibel