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 = 29e9 # Hz
# Transmitter: satellite with parabolic antenna
tx_pattern = lox.ParabolicPattern(diameter_m=0.98, efficiency=0.45)
tx_antenna = lox.ComplexAntenna(pattern=tx_pattern, boresight=[0.0, 0.0, 1.0])
tx = lox.Transmitter(frequency_hz=frequency, power_w=10.0, line_loss_db=1.0)
tx_system = lox.CommunicationSystem(antenna=tx_antenna, transmitter=tx)
# Receiver: ground station with known system noise temperature
rx_antenna = lox.SimpleAntenna(gain_db=40.0, beamwidth_deg=0.5)
rx = lox.SimpleReceiver(frequency_hz=frequency, system_noise_temperature_k=200.0)
rx_system = lox.CommunicationSystem(antenna=rx_antenna, receiver=rx)
# Define a QPSK channel at 10 Mbit/s
channel = lox.Channel(
link_type="downlink",
data_rate=10e6, # bps
required_eb_n0_db=10.0, # dB
margin_db=3.0, # 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_km=1000.0,
tx_angle_deg=0.0,
rx_angle_deg=0.0,
)
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"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 = lox.Decibel(30.0)
gain_linear = lox.Decibel.from_linear(1000.0)
# Arithmetic
total = gain + lox.Decibel(3.0) # 33.0 dB
diff = gain - lox.Decibel(10.0) # 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_km=1000.0, frequency_hz=29e9)
print(f"FSPL: {float(loss):.1f} dB")
Environmental Losses
import lox_space as lox
losses = lox.EnvironmentalLosses(
rain_db=2.0,
gaseous_db=0.3,
atmospheric_db=0.5,
)
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_km=1000.0,
tx_angle_deg=0.0,
rx_angle_deg=0.0,
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:
-
–diameter_mAntenna diameter in meters.
-
–efficiencyAperture efficiency (0, 1].
Methods:
-
beamwidth–Returns the half-power beamwidth in degrees, 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 in degrees, or None when the
antenna diameter is smaller than ~1.22 wavelengths at this frequency.
from_beamwidth
staticmethod
from_beamwidth(
beamwidth_deg: float, frequency_hz: float, efficiency: float
) -> ParabolicPattern
gain
Returns the gain in dBi at the given frequency and off-boresight angle.
GaussianPattern
Gaussian antenna gain pattern.
Parameters:
-
–diameter_mAntenna diameter in meters.
-
–efficiencyAperture efficiency (0, 1].
Methods:
-
beamwidth–Returns the half-power beamwidth in degrees.
-
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 in degrees.
gain
Returns the gain in dBi at the given frequency and off-boresight angle.
DipolePattern
Dipole antenna gain pattern.
Parameters:
-
–length_mDipole length in meters.
Methods:
SimpleAntenna
A simple antenna with constant gain and beamwidth.
Parameters:
-
–gain_dbPeak gain in dBi.
-
–beamwidth_degHalf-power beamwidth in degrees.
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 in degrees, 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 in degrees, 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:
-
–frequency_hzTransmit frequency in Hz.
-
–power_wTransmit power in watts.
-
–line_loss_dbFeed/line loss in dB.
-
–output_back_off_dbOutput back-off in dB (default 0).
Methods:
-
eirp–Returns the EIRP in dBW for the given antenna and off-boresight angle.
eirp
eirp(antenna: SimpleAntenna | ComplexAntenna, angle_deg: float) -> 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:
-
–frequency_hzReceive frequency in Hz.
-
–system_noise_temperature_kSystem noise temperature in Kelvin.
ComplexReceiver
A complex receiver with detailed noise and gain parameters.
Parameters:
-
–frequency_hzReceive frequency in Hz.
-
–antenna_noise_temperature_kAntenna noise temperature in Kelvin.
-
–lna_gain_dbLNA gain in dB.
-
–lna_noise_figure_dbLNA noise figure in dB.
-
–noise_figure_dbReceiver noise figure in dB.
-
–loss_dbReceiver chain loss in dB.
-
–demodulator_loss_dbDemodulator loss in dB (default 0).
-
–implementation_loss_dbOther implementation losses in dB (default 0).
Methods:
-
noise_temperature–Returns the receiver noise temperature in Kelvin.
-
system_noise_temperature–Returns the system noise temperature in Kelvin.
Channel
A communication channel.
Parameters:
-
–link_type"uplink" or "downlink".
-
–data_rateData rate in bits per second.
-
–required_eb_n0_dbRequired Eb/N0 in dB.
-
–margin_dbRequired link margin in dB.
-
–modulationModulation scheme.
-
–roll_offRoll-off factor (default 1.5).
-
–fecForward error correction code rate (default 0.5).
Methods:
-
bandwidth–Returns the channel bandwidth in Hz.
-
eb_n0–Computes Eb/N0 from a given C/N0.
-
link_margin–Computes the link margin from a given Eb/N0.
EnvironmentalLosses
Environmental losses for a link.
Parameters:
-
–rain_dbRain attenuation in dB (default 0).
-
–gaseous_dbGaseous absorption in dB (default 0).
-
–scintillation_dbScintillation loss in dB (default 0).
-
–atmospheric_dbAtmospheric loss in dB (default 0).
-
–cloud_dbCloud attenuation in dB (default 0).
-
–depolarization_dbDepolarization loss in dB (default 0).
Methods:
-
total–Returns the total environmental loss in dB.
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_db: float,
range_km: float,
tx_angle_deg: float,
rx_angle_deg: float,
) -> Decibel
Computes the received carrier power in dBW.
carrier_to_noise_density
carrier_to_noise_density(
rx_system: CommunicationSystem,
losses_db: float,
range_km: float,
tx_angle_deg: float,
rx_angle_deg: float,
) -> Decibel
Computes the carrier-to-noise density ratio (C/N0) in dB·Hz.
Parameters:
-
(rx_systemCommunicationSystem) –The receiving CommunicationSystem.
-
(losses_dbfloat) –Additional losses in dB.
-
(range_kmfloat) –Slant range in kilometers.
-
(tx_angle_degfloat) –Off-boresight angle at transmitter in degrees.
-
(rx_angle_degfloat) –Off-boresight angle at receiver in degrees.
LinkStats
Complete link budget statistics.
Methods:
-
calculate–Computes a full link budget.
Attributes:
-
bandwidth_hz(float) –Channel bandwidth in Hz.
-
c_n0(Decibel) –Carrier-to-noise density ratio in dB·Hz.
-
carrier_rx_power(Decibel) –Received carrier power in dBW.
-
data_rate(float) –Data rate in bits per second.
-
eb_n0(Decibel) –Eb/N0 in dB.
-
eirp(Decibel) –EIRP in dBW.
-
frequency_hz(float) –Link frequency in Hz.
-
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_km(float) –Slant range in kilometers.
calculate
staticmethod
calculate(
tx_system: CommunicationSystem,
rx_system: CommunicationSystem,
channel: Channel,
range_km: float,
tx_angle_deg: float,
rx_angle_deg: float,
losses: EnvironmentalLosses | None = None,
) -> LinkStats
Computes a full link budget.
Parameters:
-
(tx_systemCommunicationSystem) –The transmitting CommunicationSystem.
-
(rx_systemCommunicationSystem) –The receiving CommunicationSystem.
-
(channelChannel) –The Channel.
-
(range_kmfloat) –Slant range in kilometers.
-
(tx_angle_degfloat) –Off-boresight angle at transmitter in degrees.
-
(rx_angle_degfloat) –Off-boresight angle at receiver in degrees.
-
(lossesEnvironmentalLosses | None, default:None) –EnvironmentalLosses (optional, defaults to none).