PHY Abstraction

The signal-to-interference-plus-noiseratio (SINR) that a single codeword experiences across multiple streams,computed via
PostEqualizationSINR, isaggregated into a singleeffective SINR value.The effective SINR is chosen so that, if all subcarriers and streams experiencedit uniformly, the resulting block error rate (BLER) would remainapproximately the same.The effective SINR is then mapped to a BLER value viaprecomputed tables, based on the code block size.
The transport BLER (TBLER) can be finally computed as the probability that atleast one of the code blocks in the transport block is not correctly received.
For a usage example of PHY abstraction in Sionna, referto thePhysical Layer Abstraction notebook.
Next, we formally describe the general principle of effective SINR mapping (ESM)and the exponential ESM (EESM) model.
\[I(\mathrm{SINR}_{\text{eff}}) = \frac{1}{N} \sum_{i=1}^N I(\mathrm{SINR}_{i})\]\[\Rightarrow \ \ \mathrm{SINR}_{\text{eff}} = I^{-1} \left( \frac{1}{N} \sum_{i=1}^N I(\mathrm{SINR}_{i}) \right)\]
Thus, the corresponding effective SINR can be expressed as:
Single-link channel. In the basic case with one link (\(N=1\)), each codewordsymbol experiences the same channel gain\(\rho\) and complex noise power\(N_0\), resulting in the receivedreal signal:
To obtain the pairwisecodeword error probability, we average expression(63) across all\((\ell_1, \ell_2)\) events:
where the inequality stems again from the Chernoff bound.
Multi-link channel. Expression(64) extends to a multi-link channel(\(N\ge 2\)) as follows:
EESM expression. By equating the multi-link pairwise error probability bound(65) withthe analogous single-link expression(62), we recognize that themulti-link channel is analogous to a single-link channel with SINR:
Note that the introduction of parameter\(\beta\) in(61) is usefulto adapt the EESM formula to different modulation and coding schemes (MCS),since the argument above holds for BPSK modulation only. Hence,\(\beta\) shalldepend on the used MCS, as shown in[5GLENA].
- classsionna.sys.EffectiveSINR(*args,precision=None,**kwargs)[source]
Class template for computing the effective SINR from input SINR valuesacross multiple subcarriers and streams
- Input:
sinr ([…, num_ofdm_symbols, num_subcarriers, num_ut, num_streams_per_ut],tf.float) – Post-equalization SINR in linear scale for different OFDM symbols,subcarriers, users and streams.If one entry is zero, the corresponding stream is considered as notutilized.
mcs_index ([…, num_ut],tf.int32 (default:None)) – Modulation and coding scheme (MCS) index for each user
mcs_table_index ([…, num_ut],tf.int32 (default:None)) – MCS table index for each user. For further details, refer to theNote.
mcs_category ([…, num_ut],tf.int32 (default:None)) – MCS table category for each user. For further details, refer to theNote.
per_stream (bool (default:False)) – IfTrue, the effective SINR is computed on a per-user andper-stream basis and is aggregated across different subcarriers.IfFalse, the effective SINR is computed on a per-user basis andis aggregated across streams and subcarriers.
kwargs (dict) – Additional input parameters
- Output:
sinr_eff (([…, num_ut, num_streams_per_ut] | […, num_ut]),tf.float) – Effective SINR in linear scale for each user and associated stream.If
per_streamisTrue, thensinr_effhas shape[…, num_ut,num_streams_per_rx], andsinr_eff[...,u,s]is the effective SINRfor streams of useru across all subcarriers.Ifper_streamisFalse, thensinr_effhas shape[…, num_ut],andsinr_eff[...,u]is the effective SINR for useru acrossall streams and subcarriers.
- classsionna.sys.EESM(load_beta_table_from='default',sinr_eff_min_db=-30,sinr_eff_max_db=30,precision=None)[source]
Computes the effective SINR from input SINR valuesacross multiple subcarriers and streams via the exponential effective SINRmapping (EESM) method
Let\(\mathrm{SINR}_{u,c,s}>0\) be the SINR experienced by user\(u\)on subcarrier\(c=1,\dots,C\), and stream\(s=1,\dots,S_c\).If
per_streamisFalse, it computes the effective SINR aggregatedacross all utilized streams and subcarriers for each user\(u\):\[\mathrm{SINR}^{\mathrm{eff}}_u = -\beta_u \log \left( \frac{1}{CS}\sum_{c=1}^{C} \sum_{s=1}^{S_c} e^{-\frac{\mathrm{SINR}_{u,c,s}}{\beta_u}} \right),\quad \forall\, u\]where\(\beta>0\) is a parameter depending on the Modulation and CodingScheme (MCS) of user\(u\).
If
per_streamisTrue, it computes the effective SINR aggregatedacross subcarriers, for each user\(u\) and associated stream\(s\):\[\mathrm{SINR}^{\mathrm{eff}}_{u,s} = -\beta_u \log \left( \frac{1}{C}\sum_{c=1}^{C} e^{-\frac{\mathrm{SINR}_{u,c,s}}{\beta_u}} \right),\quad \forall\, u,s.\]- Parameters:
load_beta_table_from (str) – File name from which the tables containing the values of\(\beta\)parameters are loaded
sinr_eff_min_db (float (default: -30)) – Minimum effective SINR value [dB]. Useful to avoid numerical errors
sinr_eff_max_db (float (default: 50)) – Maximum effective SINR value [dB]. Useful to avoid numerical errors
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Input:
sinr ([…, num_ofdm_symbols, num_subcarriers, num_ut, num_streams_per_ut],tf.float) – Post-equalization SINR in linear scale for different OFDM symbols,subcarriers, users and streams.If one entry is zero, the corresponding stream is considered as notutilized.
mcs_index ([…, num_ut],tf.int32) – Modulation and coding scheme (MCS) index for each user
mcs_table_index ([…, num_ut],tf.int32 (default: 1)) – MCS table index for each user. For further details, refer to theNote.
mcs_category ([…, num_ut],tf.int32 (default:None)) – MCS table category for each user. For further details, refer to theNote.
per_stream (bool (default:False)) – IfTrue, then the effective SINR is computed on a per-user andper-stream basis and is aggregated across different subcarriers.IfFalse, then the effective SINR is computed on a per-user basis andis aggregated across streams and subcarriers.
- Output:
sinr_eff (([…, num_ut, num_streams_per_ut] | […, num_ut]),tf.float) – Effective SINR in linear scale for each user and associated stream.If
per_streamisTrue, thensinr_effhas shape[…, num_ut,num_streams_per_rx], andsinr_eff[...,u,s]is the effective SINRfor streams of useru across all subcarriers.Ifper_streamisFalse, thensinr_effhas shape[…, num_ut],andsinr_eff[...,u]is the effective SINR for useru acrossall streams and subcarriers.
Note
If the input SINR is zero for a specific stream, the stream isconsidered unused and does not contribute to the effective SINR computation.
Example
fromsionna.phyimportconfigfromsionna.sysimportEESMfromsionna.phy.utilsimportdb_to_linbatch_size=10num_ofdm_symbols=12num_subcarriers=32num_ut=15num_streams_per_ut=2# Generate random MCS indicesmcs_index=config.tf_rng.uniform([batch_size,num_ut],minval=0,maxval=27,dtype=tf.int32)# Instantiate the EESM objecteesm=EESM()# Generate random SINR valuessinr_db=config.tf_rng.uniform([batch_size,num_ofdm_symbols,num_subcarriers,num_ut,num_streams_per_ut],minval=-5,maxval=30)sinr=db_to_lin(sinr_db)# Compute the effective SINR for each receiver# [batch_size, num_rx]sinr_eff=eesm(sinr,mcs_index,mcs_table_index=1,per_stream=False)print(sinr_eff.shape)# (10, 15)# Compute the per-stream effective SINR for each receiver# [batch_size, num_rx, num_streams_per_rx]sinr_eff_per_stream=eesm(sinr,mcs_index,mcs_table_index=2,per_stream=True)print(sinr_eff_per_stream.shape)# (10, 15, 2)
- propertybeta_table
Maps MCS indicesto the corresponding parameters, commonly called\(\beta\),calibrating the Exponential Effective SINR Map (EESM) method. It hasthe form
beta_table['index'][mcs_table_index][mcs]- Type:
dict (read-only)
- propertybeta_table_filenames
Get/set the absolute path name of the JSONfile containing the mapping between MCS and EESM beta parameters, storedin
beta- Type:
str | list ofstr
- propertybeta_tensor
Tensor corresponding to
self.beta_table- Type:
[n_tables, n_mcs],tf.float (read-only)
- classsionna.sys.PHYAbstraction(interp_fun=None,mcs_decoder_fun=None,transport_block_fun=None,sinr_effective_fun=None,load_bler_tables_from='default',snr_db_interp_min_max_delta=(-5,30.01,0.1),cbs_interp_min_max_delta=(24,8448,100),bler_interp_delta=0.01,precision=None,**kwargs)[source]
Class for physical layer abstraction
For a givensignal-to-interference-plus-noise-ratio (SINR) provided on a per-streambasis, and for a given modulation order, coderate,and number of coded bits specified for each user, it produces thecorresponding number of successfully decoded bits,HARQ feedback, effective SINR, block error rate (BLER), and transport BLER(TBLER).
At object instantiation, precomputed BLER tables are loaded and interpolatedon a fine (SINR, code block size) grid for each modulation and coding scheme(MCS) index.
When the object is called, the post-equalization SINR is first converted toan effective SINR. Then, theeffective SINR is used to retrieve the BLER from pre-computed andinterpolated tables. Finally, the BLER determines the TBLER, whichrepresents the probability that at least one code block is incorrectlyreceived.
- Parameters:
interp_fun (instance of
Interpolate|None (default)) – Function for interpolating data defined on rectangular or unstructuredgrids, used for BLER and SINR interpolation.IfNone, it is set to an instance ofSplineGriddataInterpolation.mcs_decoder_fun (instance of
MCSDecoder|None (default)) – Function mapping MCS indices to modulation order and coderate.IfNone, it is set to an instance ofMCSDecoderNR.transport_block_fun (instance of
TransportBlock|None (default)) – Function computing the number and size (measured in bits) of codeblocks within a transport block.IfNone, it is set to an instance ofTransportBlockNR.sinr_effective_fun (instance of
EffectiveSINR|None (default)) – Function computing the effective SINR.IfNone, it is set to an instance ofEESM.load_bler_tables_from (str | list ofstr (default: “default”)) – Name of file(s) containing pre-computed SINR-to-BLER tables for differentcategories, tables indices, MCS indices, SINR and code block sizes. If“default”, then the pre-computed tables stored in“phy/abstraction/bler_tables/” folder are loaded.
snr_db_interp_min_max_delta ([3],tuple (default: (-5, 30.01, .1))) – Tuple of (min,max,delta)values [dB] defining the list of SINR [dB] values at which the BLER isinterpolated, asmin, min+delta, min+2*delta,…, up untilmax
cbs_interp_min_max_delta ([3],tuple (default: (24, 8448, 100))) – Tuple of (min,max,delta)values defining the list of code block size values at which the BLER andSINR are interpolated, asmin, min+delta, min+2*delta,…,max
bler_interp_delta (float (default: 0.01)) – Spacing of the BLER grid at which SINR is interpolated
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.kwargs – Additional inputs for
bler_snr_interp_fun,mcs_decoder_fun,transport_block_fun
- Input:
mcs_index ([…, num_ut],tf.int32) – MCS index for each user
sinr ([…, num_ofdm_symbols, num_subcarriers, num_ut, num_streams_per_ut],tf.float |None (default)) – Post-equalization SINR in linear scale for each OFDM symbol, subcarrier,user and stream.IfNone, then
sinr_effandnum_allocated_reare both required.sinr_eff ([…, num_ut],tf.float |None (default)) – Effective SINR in linear scale for each user.IfNone, then
sinris required.num_allocated_re ([…, num_ut],tf.int32 |None (default)) – Number of allocated resources in a slot, computed across OFDM symbols,subcarriers and streams, for each user.IfNone, then
sinris required.mcs_table_index ([…, num_ut],tf.int32 |int (default: 1)ß) – MCS table index. For further details, refer to theNote.
mcs_category ([…, num_ut],tf.int32 |int (default: 0)) – MCS table category. For further details, refer to theNote.
check_mcs_index_validity (bool (default:True)) – IfTrue, an ValueError is thrown is the input MCS indices are notvalid for the given configuration
- Output:
num_decoded_bits ([…, num_ut],tf.int32) – Number of successfully decoded bits for each user
harq_feedback ([…, num_ut], -1 | 0 | 1) – If 0 (1, resp.), then a NACK (ACK, resp.) is received. If -1, feedbackis missing since the user is not scheduled for transmission.
sinr_eff ([…, num_ut],tf.float) – Effective SINR in linear scale for each user
tbler ([…, num_ut],tf.float) – Transport block error rate (BLER) for each user
bler ([…, num_ut],tf.float) – Block error rate (BLER) for each user
Note
In this class, the terms SNR (signal-to-noise ratio) and SINR(signal-to-interference-plus-noise ratio) can be used interchangeably.This is because the equivalent AWGN model used for BLER mapping does notexplicitly account for interference.
Example
importnumpyasnpfromsionna.sysimportPHYAbstraction,EESMfromsionna.phy.nr.utilsimportMCSDecoderNR,TransportBlockNRfromsionna.phy.utilsimportSplineGriddataInterpolation# Instantiate the class for BLER and SINR interpolationbler_snr_interp_fun=SplineGriddataInterpolation()# Instantiate the class for mapping MCS to modulation order and coderate# in 5G NRmcs_decoder_fun=MCSDecoderNR()# Instantiate the class for computing the number and size of code blocks# within a transport block in 5G NRtransport_block_fun=TransportBlockNR()# Instantiate the class for computing the effective SINRsinr_effective_fun=EESM()# By instantiating a PHYAbstraction object, precomputed BLER tables are# loaded and interpolated on a fine (SINR, code block size) grid for each MCSphy_abs=PHYAbstraction(bler_snr_interp_fun=bler_snr_interp_fun,mcs_decoder_fun=mcs_decoder_fun,transport_block_fun=transport_block_fun,sinr_effective_fun=sinr_effective_fun)# Plot a BLER tablephy_abs.plot(plot_subset={'category':{0:{'index':{1:{'MCS':14}}}}},show=True);

# One can also compute new BLER tables# SINR values and code block sizes @ new simulations are performedsnr_dbs=np.linspace(-5,25,5)cb_sizes=np.arange(24,8448,1000)# MCS values @ new simulations are performedsim_set={'category':{0:{'index':{1:{'MCS':[15]}}}}}# Compute new tablesnew_table=phy_abs.new_bler_table(snr_dbs,cb_sizes,sim_set,max_mc_iter=15,batch_size=10,verbose=True)
- propertybler_interp_delta
Get/set the spacing of the BLER grid at which SINR isinterpolated
- Type:
float
- propertybler_table
Collection of tables containing BLERvalues for different values of SNR, MCS table, MCS index and CB size.
bler_table['category'][cat]['index'][mcs_table_index]['MCS'][mcs]['CBS'][cb_size]contains the lists of BLER values.bler_table['category'][cat]['index'][mcs_table_index]['MCS'][mcs]['SNR_db']contains the list of SNR values.bler_table['category'][cat]['index'][mcs_table_index]['MCS'][mcs]['EbN0_db']contains the list of\(E_b/N_0\) values- Type:
dict (read-only)
- propertybler_table_filenames
Get/set the absolute path name of the filescontaining BLER tables
- Type:
str | list ofstr
- propertybler_table_interp
Tensorcontaining BLER valuesinterpolated across SINR and CBS values, for different categories andMCS table indices. The first axis accounts forthe category, e.g., ‘PDSCH’ or ‘PUSCH’ in 5G-NR, the second axis corresponds tothe 38.214 MCS table index while the third axis carries the MCS index.
- Type:
[n_categories,n_tables,n_mcs,n_cbs_index,n_snr],tf.float (read-only)
- propertycbs_interp_min_max_delta
Get/set the tuple of (min,max,delta)values defining the list of code block size values at which the BLER andSINR are interpolated, asmin, min+delta, min+2*delta,…, up untilmax.
- Type:
[3],tuple
- get_bler(mcs_index,mcs_table_index,mcs_category,cb_size,snr_eff)[source]
Retrieves from interpolated tables the BLER corresponding to a certaintable index, MCS, CB size, and SINR values provided as input.If the corresponding interpolated table is not available, it returnsInf.
- Input:
mcs_index ([…],tf.int32) – MCS index for each user
mcs_table_index ([…],tf.int.32 |int) – MCS table index for each user. For further details, refer to theNote.
mcs_category ([…],tf.int32) – MCS table category for each user. For further details, refer to theNote.
cb_size ([…],tf.int32) – Code block size for each user
snr_eff ([…],tf.float) – Effective SINR for each user
- Output:
bler ([…],tf.float) – BLER corresponding to the input channel type, table index, MCS, CBsize and SINR, retrieved from internal interpolation tables
- get_idx_from_grid(val,which)[source]
Retrieves the index of a SINR of CBS value in the interpolation grid.
- Input:
val ([…],tf.float) – Values to be quantized
which (“snr | “cbs”) – Whether the values are SNR (equivalent to SINR) or CBS
- Output:
idx ([…],tf.int32) – Index of the values in the interpolation grid
- staticload_table(filename)[source]
Loads a table stored in JSON file.
- Input:
filename (str) – Name of the JSON file containing the table
- Output:
dict – table loaded from file
- new_bler_table(snr_dbs,cb_sizes,sim_set,channel=None,filename=None,write_mode='w',batch_size=1000,max_mc_iter=100,target_bler=None,graph_mode='graph',early_stop=True,filename_log=None,verbose=True)[source]
Computes static tables mapping SNR values of an AWGN channel to thecorresponding block error rate (BLER) viaMonte-Carlo simulations for different MCS indices, code block sizes andchannel types.Note that the newly computed table is merged with the internal
self.bler_table.The simulation continues with the next SNR point after
max_mc_iterbatches of sizebatch_sizehave been simulated.Early stopping allows to stop the simulation after the first error-free SNRpoint or after reaching a certaintarget_berortarget_bler.For more details, please seesim_ber().- Input:
snr_dbs (list |float) – List of SNR [dB] value(s) at which the BLER is computed
cb_sizes (list |int) – List of code block (CB) size(s) at which the BLER is computed
sim_set (dict) – Dictionary contains the list of the MCS indices at which the BLER iscomputed via simulation. The dictionary structure is of the kind:
sim_set['category'][category]['index'][mcs_table_index]['MCS'][mcs_list].channel (instance of
SingleLinkChannel|None) – Object for simulating single-link i.e., single-carrier and single-stream,channels. IfNone, it is set to an instance ofCodedAWGNChannelNR.filename (str |None (default)) – Name of JSON file where the BLER tables are saved.IfNone, results are not saved.
write_mode (‘w’ (default) | ‘a’) – If ‘w’, then
bler_table_filenameis rewritten.If ‘a’, then the produced results are appended tobler_table_filename.batch_size (int (default: 2000)) – Batch size for Monte-Carlo BLER simulations
max_mc_iter (int (default: 100)) – Maximum number of Monte-Carlo iterations per SNR point
target_bler (None (default) |tf.float32) – The simulation stops after the first SNR pointwhich achieves a lower block error rate as specified by
target_bler.This requiresearly_stopto beTrue.graph_mode (None | “graph” (default) | “xla”) – Execution mode of
EquivalentChannelcall method.IfNone, thenEquivalentChannelis executed as is.num_iter_decoder (int (default: 20)) – Number of decoder iterations. See
LDPC5GDecoderfor more details.cn_update (“boxplus-phi” (default) | “boxplus” | “minsum” | “offset-minsum” | “identity” | callable) – Check node update rule. See
LDPC5GDecoderfor more details.filename_log (str |None (default)) – Name of logging file.IfNone, logs are not produced.
verbose (bool (default:True)) – IfTrue, the simulation progress is visualized, as well asthe names of files of results and figures
- Output:
new_table (dict) – Newly computed BLER table
- plot(plot_subset='all',show=True,save_path=None)[source]
Visualizes and/or saves to file the SINR-to-BLER tables
- Input:
plot_subset (dict | “all”) – Dictionary containing the list of MCS indices to consider, stored at
plot_subset['category'][category]['index'][mcs_table_index]['MCS'].If “all”, then plots are produced for all available BLER tables.show (bool (default:True)) – IfTrue, then plots are visualized
save_path (str |None (default)) – Folder path where BLER plots are saved. IfNone, then plots arenot saved
- Output:
fignames (list) – List of names of files containing BLER plots
- propertysnr_db_interp_min_max_delta
Get/set the tuple of (min,max,delta)values [dB] defining the list of SINR values at which the BLER isinterpolated, asmin, min+delta, min+2*delta,…, up untilmax
- Type:
[3],tuple
- propertysnr_table_interp
Tensorcontaining SINR values interpolated across BLER and CBS values, fordifferent categories and MCS table indices.The first axis accounts forthe category, e.g., ‘PDSCH’ or ‘PUSCH’ in 5G-NR, the second axis corresponds tothe 38.214 MCS table index and the third axis accounts for the MCSindex.
- Type:
[n_categories,n_tables,n_mcs,n_cbs_index,n_bler],tf.float (read-only)
- References:
- [5GLENA]
S. Lagen, K. Wanuga, H. Elkotby, S. Goyal, N. Patriciello, L.Giupponi.“New radio physical layer abstraction forsystem-level simulations of 5G networks”. IEEE InternationalConference on Communications (ICC), 2020