Contents

Sionna Channel Models (channel/): From AWGN to 3GPP TR 38.901

Wireless Fundamentals
#Sionna#channel-modeling#3GPP#TR38901

channel/ is the part of a link simulation that sits closest to the physical world. Its interface design is very uniform: all channel models inherit from ChannelModel, and the call signature is

__call__(batch_size, num_time_steps, sampling_frequency)

which returns the path coefficients a and path delays tau (i.e., the channel impulse response, CIR); general utilities then convert it to the frequency or time domain.

1. Top-Level Files

FileFunctionMain public classes/functions
__init__.pyChannel module package entryExports AWGN, ChannelModel, CIRDataset, OFDMChannel, TimeChannel, RayleighBlockFading, the flat-fading and spatial-correlation classes, the discrete-channel classes, DEFAULT_L_MIN, etc., and imports the tr38901 submodule
channel_model.pyAbstract class defining the channel-model interfaceChannelModel(Object)
awgn.pyAWGN channel simulationAWGN(Block): adds complex white Gaussian noise of variance no to the input (no/2 per real dimension)
cir_dataset.pyBuilds a CIR sampler from a CIR generator (usable as a channel model)CIRDataset(ChannelModel); internal _CIRIterableDataset, _InfiniteCIRIterableDataset, _collate_fn
constants.pyChannel module constantsDEFAULT_L_MIN = -6 (default maximum negative delay for discrete complex-baseband channels)
discrete_channel.pyDiscrete channel modelsBinaryMemorylessChannel, BinarySymmetricChannel (BSC), BinaryZChannel, BinaryErasureChannel (BEC)
flat_fading_channel.pyFlat-fading channel simulationGenerateFlatFadingChannel, ApplyFlatFadingChannel, FlatFadingChannel
rayleigh_block_fading.pyRayleigh block-fading simulationRayleighBlockFading(ChannelModel): a single zero-delay path with Gaussian coefficients; all time steps of the same batch sample share the coefficients
spatial_correlation.pySpatially correlated flat-fading channelSpatialCorrelation (abstract), KroneckerModel, PerColumnModel
generate_ofdm_channel.pyGenerate the channel frequency responseGenerateOFDMChannel(Object): computes the per-symbol/per-subcarrier h_freq from the CIR
apply_ofdm_channel.pyApply the single-tap OFDM channel in the frequency domainApplyOFDMChannel(Block): y=h^x+wy = \hat{h}x + w, optionally adding AWGN
ofdm_channel.pyIdeal OFDM channel (single tap in the frequency domain)OFDMChannel(Block): generates the frequency response and applies it (no ICI/ISI), optionally returning h_freq
generate_time_channel.pyGenerate the channel response in the time domainGenerateTimeChannel(Object): computes the time-domain taps h_time assuming sinc pulse shaping/receive filtering
apply_time_channel.pyApply the channel response in the time domainApplyTimeChannel(Block): filters with the time-varying h_time, output length num_time_samples + l_tot - 1, optionally adding AWGN
time_channel.pyTime-domain channel implementationTimeChannel(Block): generates and applies the time-domain response; output length num_time_samples + l_max - l_min
utils.pyChannel utility functionssubcarrier_frequencies, time_frequency_vector, time_lag_discrete_time_channel, cir_to_ofdm_channel, cir_to_time_channel, time_to_ofdm_channel, deg_2_rad, rad_2_deg, wrap_angle_0_360, drop_uts_in_sector, set_3gpp_scenario_parameters, relocate_uts, generate_uts_topology, random_ut_properties, gen_single_sector_topology, gen_single_sector_topology_interferers, exp_corr_mat, one_ring_corr_mat

A few easily confused points, noted upfront:

  • OFDMChannel is the “ideal” frequency-domain channel. It assumes the cyclic prefix is long enough and treats each subcarrier as a single tap, so there is no ICI/ISI. To see the real time-domain filtering effects, use TimeChannel.
  • The spatial correlation of KroneckerModel is constructed as Rrx1/2HRtx1/2\mathbf{R}_{rx}^{1/2}\mathbf{H}\mathbf{R}_{tx}^{1/2}, a different correlation assumption from PerColumnModel.
  • DEFAULT_L_MIN = -6 is the default maximum negative delay for discrete complex-baseband channels, used together with time_lag_discrete_time_channel.

2. tr38901/: The Full 3GPP TR 38.901 Model

This is the largest piece of channel/, with files split by specification section:

FileFunctionMain public classes
__init__.pyUnified export entryThe antenna classes, TDL, CDL, LSP/LSPGenerator, Rays/RaysGenerator, Topology/ChannelCoefficientsGenerator, SystemLevelScenario/SystemLevelChannel, RMa/UMa/UMi and their scenarios
antenna.pyAntenna modeling (§7.3, Eq. 7.3-4/5)AntennaElement, AntennaPanel, PanelArray, Antenna, AntennaArray
tdl.pyTapped Delay Line (TDL) modelTDL(ChannelModel): generates coefficients by the sum-of-sinusoids method, emulating mobility aging; supports 'A'~'E' plus A30/B100/C300; supports spatial correlation matrices
cdl.pyCluster Delay Line (CDL) model (§7.7.1/7.7.3)CDL(ChannelModel): optional "A"~"E", PDP normalized to 1, single-input single-output only (multi-antenna allowed)
lsp.pyLarge-scale parameter and path loss sampling (§7.5 steps 1-4, §7.4.1, §7.4.3)LSP (DS/ASD/ASA/SF/K/ZSA/ZSD), LSPGenerator(Object)
rays.pyRay sampling (§7.5 steps 6-9)Rays (delay/power/AoA/AoD/ZoA/ZoD/XPR), RaysGenerator(Object)
channel_coefficients.pyChannel impulse response sampling (§7.5 steps 10-11)Topology, ChannelCoefficientsGenerator(Object) (outputs h, delays)
system_level_scenario.pySystem-level simulation scenario base class (O2I in §7.4.3)SystemLevelScenario(Object)
system_level_channel.pySystem-level channel model base classSystemLevelChannel(ChannelModel): set_topology, show_topology, return_rays, etc.
umi.py / umi_scenario.pyUrban micro (UMi)UMi(SystemLevelChannel), UMiScenario(SystemLevelScenario)
uma.py / uma_scenario.pyUrban macro (UMa)UMa(SystemLevelChannel), UMaScenario(SystemLevelScenario)
rma.py / rma_scenario.pyRural macro (RMa)RMa(SystemLevelChannel), RMaScenario(SystemLevelScenario)
models/__init__.pyPackage holding the parameter JSONs (exports nothing itself)The same directory contains CDL-A~E.json, TDL-A/A30/B/B100/C/C300/D/E.json, and the LoS/NLoS/O2I.json files for RMa/UMa/UMi, 22 parameter files in total

The two model families must be told apart:

  • TDL / CDL are link-level models that directly specify a power delay profile (PDP), suited to fast single-link simulation;
  • UMi / UMa / RMa are system-level models: you first set_topology to place the base stations and terminals, then sample LSP → Rays → channel coefficients step by step following the 11 steps of §7.5.

The file split of the latter (lsp.py / rays.py / channel_coefficients.py) maps almost one-to-one onto the sampling steps in the specification, so reading the code against the spec goes smoothly.

3. optical/: Optical Communication Channels

FileFunctionMain public classes
__init__.pyOptical channel package entryExports EDFA, SSFM
edfa.pyErbium-doped fiber amplifier (EDFA) modelEDFA(Block): amplifies the optical signal by the gain and adds ASE noise, supports dual polarization
fiber.pySplit-step Fourier method (SSFM) solving the nonlinear Schrödinger equationSSFM(Block): numerically solves the NLSE (single polarization) / Manakov equation (dual polarization), optionally with Raman amplification noise

This part is essentially unrelated to wireless links; it is there for fiber-optic link simulation.

4. From CIR to the Frequency/Time Domain

The three most core functions in utils.py convert the path coefficients into usable domains. The frequency response sums over paths:

hfreq(f)=∑lal e−j2πfτlh_{\text{freq}}(f) = \sum_{l} a_l \, e^{-j 2\pi f \tau_l}

where τl\tau_l is shifted by the discrete delay index l_min so that negative delays can still be represented:

import torch
from sionna.phy.channel import (subcarrier_frequencies, cir_to_ofdm_channel,
                                cir_to_time_channel, time_lag_discrete_time_channel,
                                time_to_ofdm_channel)
from sionna.phy.channel.tr38901 import TDL
from sionna.phy.ofdm import ResourceGrid

rg = ResourceGrid(num_ofdm_symbols=1, fft_size=1024, subcarrier_spacing=15e3)
tdl = TDL("A", 100e-9, 3.5e9)
cir = tdl(batch_size=1, num_time_steps=1, sampling_frequency=rg.bandwidth)

frequencies = subcarrier_frequencies(rg.fft_size, rg.subcarrier_spacing)
h_freq = cir_to_ofdm_channel(frequencies, *cir, normalize=True).squeeze()

l_min, l_max = time_lag_discrete_time_channel(rg.bandwidth)
h_time = cir_to_time_channel(rg.bandwidth, *cir, l_min=l_min, l_max=l_max,
                             normalize=True)

h_freq_hat = time_to_ofdm_channel(h_time, rg, l_min).squeeze()

normalize=True normalizes by average power to keep the received power from drifting across different delay spreads. time_to_ofdm_channel transforms the time-domain taps back into the frequency domain.

5. Usage Examples

AWGN channel:

import torch
from sionna.phy.channel import AWGN

awgn_channel = AWGN()
x = torch.randn(64, 16, dtype=torch.complex64)
y = awgn_channel(x, no=0.1)      # no is the noise power per complex dimension

TDL model + OFDM channel:

from sionna.phy.channel.tr38901 import TDL
from sionna.phy.channel import OFDMChannel
from sionna.phy.ofdm import ResourceGrid

rg = ResourceGrid(num_ofdm_symbols=14, fft_size=64, subcarrier_spacing=15e3)
tdl = TDL(model="A", delay_spread=300e-9, carrier_frequency=3.5e9,
          min_speed=0.0, max_speed=3.0)
channel = OFDMChannel(channel_model=tdl, resource_grid=rg)

CDL model (with antenna arrays):

from sionna.phy.channel.tr38901 import Antenna, AntennaArray, CDL

bs_array = AntennaArray(antenna=Antenna(pattern="38.901", polarization="dual"),
                        num_rows=4, num_cols=4)
ut_array = AntennaArray(antenna=Antenna(pattern="omni", polarization="single"),
                        num_rows=1, num_cols=1)
cdl = CDL(model="A", delay_spread=300e-9, carrier_frequency=3.5e9,
          ut_array=ut_array, bs_array=bs_array, direction="uplink")

# Generate the channel impulse response: path coefficients a and path delays tau
a, tau = cdl(batch_size=64, num_time_steps=100, sampling_frequency=1e6)

Time-domain channel:

import torch
from sionna.phy.channel import RayleighBlockFading, TimeChannel

channel_model = RayleighBlockFading(num_rx=1, num_rx_ant=2, num_tx=1, num_tx_ant=4)
channel = TimeChannel(channel_model, bandwidth=1e6, num_time_samples=100,
                      l_min=-6, l_max=20, return_channel=True)

x = torch.randn(32, 1, 4, 100, dtype=torch.complex64)
y, h_time = channel(x)

System-level scenario (UMi) with a single-sector topology:

from sionna.phy.channel.tr38901 import PanelArray, UMi
from sionna.phy.channel import gen_single_sector_topology

bs_array = PanelArray(num_rows_per_panel=4, num_cols_per_panel=4,
                      polarization='dual', polarization_type='cross',
                      antenna_pattern='38.901', carrier_frequency=3.5e9)
ut_array = PanelArray(num_rows_per_panel=1, num_cols_per_panel=1,
                      polarization='single', polarization_type='V',
                      antenna_pattern='omni', carrier_frequency=3.5e9)

channel_model = UMi(carrier_frequency=3.5e9, o2i_model='low',
                    ut_array=ut_array, bs_array=bs_array, direction='uplink')

topology = gen_single_sector_topology(batch_size=100, num_ut=4, scenario='umi')
channel_model.set_topology(*topology)
channel_model.show_topology()

The call order of system-level models cannot be reversed: first construct the antenna arrays and the scenario object, then set_topology to place the nodes, and only then call the channel to generate the CIR. The UT positions, distances and angles in the topology determine the sampling results of the LSPs and the rays.

6. Summary

After all this, the reading route through channel/ is:

  1. channel_model.py defines the interface; awgn.py / rayleigh_block_fading.py are the two simplest implementations and a good place to start;
  2. ofdm_channel.py and time_channel.py are the frequency-domain/time-domain application paths, understood together with the cir_to_* functions in utils.py;
  3. read tr38901/ section by section against the specification — lsp.py / rays.py / channel_coefficients.py form a three-step pipeline;
  4. optical/ is independent; look at it as needed.

Comments

Loading comments…

    ← Back to home