Utils
Set of utility functions for Sionna SYS.
- sionna.sys.utils.get_pathloss(h_freq,rx_tx_association=None,precision=None)[source]
Computes the pathloss for each receiver-transmitter pair and, if thereceiver-transmitter association is provided, the pathloss between eachuser and the associated base station
- Input:
h_freq ([…, num_rx, num_rx_ant, num_tx, num_tx_ant, num_ofdm_symbols, num_subcarriers],tf.complex |None (default:None)) – OFDM channel matrix
rx_tx_association ([num_rx, num_tx],tf.int32,None (default)) – Its\((i,j)\) element is 1 if receiver\(i\) is attached totransmitter\(j\), 0 otherwise
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Output:
pathloss_all_pairs ([…, num_rx, num_tx, num_ofdm_symbols],tf.float) – Pathloss for each RX-TX pair and across OFDM symbols
pathloss_serving_tx ([…, num_ut, num_ofdm_symbols],tf.float) – Pathloss between each user and the associated base station. Only computedif
rx_tx_associationis provided as input.
- sionna.sys.utils.is_scheduled_in_slot(sinr=None,num_allocated_re=None)[source]
Determines whether a user is scheduled in a slot
- Input:
sinr ([…, num_ofdm_symbols, num_subcarriers, num_ut, num_streams_per_ut],tf.float |None (default)) – SINR for each OFDM symbol, subcarrier, user, and stream.IfNone, then
num_allocated_reis required.num_allocated_re ([…, num_ut],tf.float |None (default)) – Number of allocated resources (streams/REs/PRBs etc.) per user.IfNone, then
sinris required.
- Output:
is_scheduled ([…, num_ut] :tf.bool) – Whether a user is scheduled in a slot
- sionna.sys.utils.spread_across_subcarriers(tx_power_per_ut,is_scheduled,num_tx=None,precision=None)[source]
Distributes the power uniformly across all allocated subcarriersand streams for each user
- Input:
tx_power_per_ut ([…, num_ofdm_sym, num_ut],tf.float) – Transmit power [W] for each user
is_scheduled ([…, num_ofdm_sym, num_subcarriers, num_ut, num_streams_per_ut],tf.bool) – Whether a user is scheduled on a given subcarrier and stream
num_tx (int |None (default)) – Number of transmitters. IfNone, it is set tonum_ut, as in uplink.
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Output:
tx_power ([…, num_tx, num_streams_per_tx, num_ofdm_sym, num_subcarriers],tf.float) – Transmit power [W] for each user, across subcarriers, streams,and OFDM symbols