Skip to content

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:

  • value

    The value in dB.

Methods:

  • from_linear

    Creates a Decibel value from a linear power ratio.

  • to_linear

    Returns the linear power ratio.

from_linear staticmethod

from_linear(value: float) -> Decibel

Creates a Decibel value from a linear power ratio.

to_linear

to_linear() -> float

Returns the linear power ratio.


Modulation

Digital modulation scheme.

Parameters:

  • name

    One of "BPSK", "QPSK", "8PSK", "16QAM", "32QAM", "64QAM", "128QAM", "256QAM".

Methods:

bits_per_symbol

bits_per_symbol() -> int

Returns the number of bits per symbol.


ParabolicPattern

Parabolic antenna gain pattern.

Parameters:

  • diameter_m

    Antenna diameter in meters.

  • efficiency

    Aperture efficiency (0, 1].

Methods:

  • beamwidth

    Returns the half-power beamwidth in degrees, or None when 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

beamwidth(frequency_hz: float) -> float | None

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

Creates a parabolic pattern from a desired beamwidth.

Parameters:

  • beamwidth_deg

    (float) –

    Half-power beamwidth in degrees.

  • frequency_hz

    (float) –

    Frequency in Hz.

  • efficiency

    (float) –

    Aperture efficiency (0, 1].

gain

gain(frequency_hz: float, angle_deg: float) -> Decibel

Returns the gain in dBi at the given frequency and off-boresight angle.

peak_gain

peak_gain(frequency_hz: float) -> Decibel

Returns the peak gain in dBi.


GaussianPattern

Gaussian antenna gain pattern.

Parameters:

  • diameter_m

    Antenna diameter in meters.

  • efficiency

    Aperture 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

beamwidth(frequency_hz: float) -> float | None

Returns the half-power beamwidth in degrees.

gain

gain(frequency_hz: float, angle_deg: float) -> Decibel

Returns the gain in dBi at the given frequency and off-boresight angle.

peak_gain

peak_gain(frequency_hz: float) -> Decibel

Returns the peak gain in dBi.


DipolePattern

Dipole antenna gain pattern.

Parameters:

  • length_m

    Dipole length in meters.

Methods:

  • gain

    Returns the gain in dBi at the given frequency and off-boresight angle.

  • peak_gain

    Returns the peak gain in dBi.

gain

gain(frequency_hz: float, angle_deg: float) -> Decibel

Returns the gain in dBi at the given frequency and off-boresight angle.

peak_gain

peak_gain(frequency_hz: float) -> Decibel

Returns the peak gain in dBi.


SimpleAntenna

A simple antenna with constant gain and beamwidth.

Parameters:

  • gain_db

    Peak gain in dBi.

  • beamwidth_deg

    Half-power beamwidth in degrees.


ComplexAntenna

An antenna with a physics-based gain pattern and boresight vector.

Parameters:

  • pattern

    An antenna pattern (ParabolicPattern, GaussianPattern, or DipolePattern).

  • boresight

    Boresight direction as [x, y, z].

Methods:

  • beamwidth

    Returns the half-power beamwidth in degrees, or None when the

  • gain

    Returns the gain in dBi at the given frequency and off-boresight angle.

  • peak_gain

    Returns the peak gain in dBi.

beamwidth

beamwidth(frequency_hz: float) -> float | None

Returns the half-power beamwidth in degrees, or None when the underlying pattern does not define a beamwidth.

gain

gain(frequency_hz: float, angle_deg: float) -> Decibel

Returns the gain in dBi at the given frequency and off-boresight angle.

peak_gain

peak_gain(frequency_hz: float) -> Decibel

Returns the peak gain in dBi.


Transmitter

A radio transmitter.

Parameters:

  • frequency_hz

    Transmit frequency in Hz.

  • power_w

    Transmit power in watts.

  • line_loss_db

    Feed/line loss in dB.

  • output_back_off_db

    Output 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_hz

    Receive frequency in Hz.

  • system_noise_temperature_k

    System noise temperature in Kelvin.


ComplexReceiver

A complex receiver with detailed noise and gain parameters.

Parameters:

  • frequency_hz

    Receive frequency in Hz.

  • antenna_noise_temperature_k

    Antenna noise temperature in Kelvin.

  • lna_gain_db

    LNA gain in dB.

  • lna_noise_figure_db

    LNA noise figure in dB.

  • noise_figure_db

    Receiver noise figure in dB.

  • loss_db

    Receiver chain loss in dB.

  • demodulator_loss_db

    Demodulator loss in dB (default 0).

  • implementation_loss_db

    Other implementation losses in dB (default 0).

Methods:

noise_temperature

noise_temperature() -> float

Returns the receiver noise temperature in Kelvin.

system_noise_temperature

system_noise_temperature() -> float

Returns the system noise temperature in Kelvin.


Channel

A communication channel.

Parameters:

  • "uplink" or "downlink".

  • data_rate

    Data rate in bits per second.

  • required_eb_n0_db

    Required Eb/N0 in dB.

  • margin_db

    Required link margin in dB.

  • modulation

    Modulation scheme.

  • roll_off

    Roll-off factor (default 1.5).

  • fec

    Forward 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.

bandwidth

bandwidth() -> float

Returns the channel bandwidth in Hz.

eb_n0

eb_n0(c_n0: Decibel) -> Decibel

Computes Eb/N0 from a given C/N0.

link_margin(eb_n0: Decibel) -> Decibel

Computes the link margin from a given Eb/N0.


EnvironmentalLosses

Environmental losses for a link.

Parameters:

  • rain_db

    Rain attenuation in dB (default 0).

  • gaseous_db

    Gaseous absorption in dB (default 0).

  • scintillation_db

    Scintillation loss in dB (default 0).

  • atmospheric_db

    Atmospheric loss in dB (default 0).

  • cloud_db

    Cloud attenuation in dB (default 0).

  • depolarization_db

    Depolarization loss in dB (default 0).

Methods:

  • total

    Returns the total environmental loss in dB.

total

total() -> Decibel

Returns the total environmental loss in dB.


CommunicationSystem

A communication system combining an antenna with optional transmitter and receiver.

Parameters:

  • antenna

    A SimpleAntenna or ComplexAntenna.

  • receiver

    A SimpleReceiver or ComplexReceiver (optional).

  • transmitter

    A Transmitter (optional).

Methods:

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

Computes the carrier-to-noise density ratio (C/N0) in dB·Hz.

Parameters:

  • rx_system

    (CommunicationSystem) –

    The receiving CommunicationSystem.

  • losses_db

    (float) –

    Additional losses in dB.

  • range_km

    (float) –

    Slant range in kilometers.

  • tx_angle_deg

    (float) –

    Off-boresight angle at transmitter in degrees.

  • rx_angle_deg

    (float) –

    Off-boresight angle at receiver in degrees.

noise_power

noise_power(bandwidth_hz: float) -> Decibel

Computes the noise power in dBW for a given bandwidth.


LinkStats

Complete link budget statistics.

Methods:

Attributes:

bandwidth_hz property

bandwidth_hz: float

Channel bandwidth in Hz.

c_n0 property

c_n0: Decibel

Carrier-to-noise density ratio in dB·Hz.

carrier_rx_power property

carrier_rx_power: Decibel

Received carrier power in dBW.

data_rate property

data_rate: float

Data rate in bits per second.

eb_n0 property

eb_n0: Decibel

Eb/N0 in dB.

eirp property

eirp: Decibel

EIRP in dBW.

frequency_hz property

frequency_hz: float

Link frequency in Hz.

fspl property

fspl: Decibel

Free-space path loss in dB.

gt property

gt: Decibel

Receiver G/T in dB/K.

margin property

margin: Decibel

Link margin in dB.

noise_power property

noise_power: Decibel

Noise power in dBW.

slant_range_km property

slant_range_km: float

Slant range in kilometers.

calculate staticmethod

Computes a full link budget.

Parameters:

  • tx_system

    (CommunicationSystem) –

    The transmitting CommunicationSystem.

  • rx_system

    (CommunicationSystem) –

    The receiving CommunicationSystem.

  • channel

    (Channel) –

    The Channel.

  • range_km

    (float) –

    Slant range in kilometers.

  • tx_angle_deg

    (float) –

    Off-boresight angle at transmitter in degrees.

  • rx_angle_deg

    (float) –

    Off-boresight angle at receiver in degrees.

  • losses

    (EnvironmentalLosses | None, default: None ) –

    EnvironmentalLosses (optional, defaults to none).