Wireless Channel Models
This module provides blocks and functions that implement wireless channel models.Models currently available includeAWGN,flat-fading with (optional)SpatialCorrelation,RayleighBlockFading, as well as models from the 3rd Generation Partnership Project (3GPP)[TR38901]:TDL,CDL,UMi,UMa, andRMa. It is also possible touse externally generated CIRs.
Apart fromflat-fading, all of these models generate channel impulse responses (CIRs) that can then be used toimplement a channel transfer function in thetime domain orassuming an OFDM waveform.
This is achieved using the different functions, classes, and Keras layers whichoperate as shown in the figures below.

Fig. 12Channel module architecture for time domain simulations.

Fig. 13Channel module architecture for simulations assuming OFDM waveform.
A channel model generate CIRs from which channel responses in the time domainor in the frequency domain are computed using thecir_to_time_channel() orcir_to_ofdm_channel() functions, respectively.If one does not need access to the raw CIRs, theGenerateTimeChannel andGenerateOFDMChannel classes can be used to convenientlysample CIRs and generate channel responses in the desired domain.
Once the channel responses in the time or frequency domain are computed, theycan be applied to the channel input using theApplyTimeChannel orApplyOFDMChannel Keras layers.
The following code snippets show how to setup and run a Rayleigh block fadingmodel assuming an OFDM waveform, and without accessing the CIRs orchannel responses.This is the easiest way to setup a channel model.Setting-up other models is done in a similar way, except forAWGN (see theAWGNclass documentation).
rayleigh=RayleighBlockFading(num_rx=1,num_rx_ant=32,num_tx=4,num_tx_ant=2)channel=OFDMChannel(channel_model=rayleigh,resource_grid=rg)
whererg is an instance ofResourceGrid.
Running the channel model is done as follows:
# x is the channel input# no is the noise variancey=channel([x,no])
To use the time domain representation of the channel, one can useTimeChannel instead ofOFDMChannel.
If access to the channel responses is needed, one can separate theirgeneration from their application to the channel input by setting up the channelmodel as follows:
rayleigh=RayleighBlockFading(num_rx=1,num_rx_ant=32,num_tx=4,num_tx_ant=2)generate_channel=GenerateOFDMChannel(channel_model=rayleigh,resource_grid=rg)apply_channel=ApplyOFDMChannel()
whererg is an instance ofResourceGrid.Running the channel model is done as follows:
# Generate a batch of channel responsesh=generate_channel(batch_size)# Apply the channel# x is the channel input# no is the noise variancey=apply_channel([x,h,no])
Generating and applying the channel in the time domain can be achieved by usingGenerateTimeChannel andApplyTimeChannel instead ofGenerateOFDMChannel andApplyOFDMChannel, respectively.
To access the CIRs, setting up the channel can be done as follows:
rayleigh=RayleighBlockFading(num_rx=1,num_rx_ant=32,num_tx=4,num_tx_ant=2)apply_channel=ApplyOFDMChannel()
and running the channel model as follows:
cir=rayleigh(batch_size)h=cir_to_ofdm_channel(frequencies,*cir)y=apply_channel([x,h,no])
wherefrequencies are the subcarrier frequencies in the baseband, which canbe computed using thesubcarrier_frequencies() utilityfunction.
Applying the channel in the time domain can be done by usingcir_to_time_channel() andApplyTimeChannel instead ofcir_to_ofdm_channel() andApplyOFDMChannel, respectively.
For the purpose of the present document, the following symbols apply:
\(N_T (u)\) | Number of transmitters (transmitter index) |
\(N_R (v)\) | Number of receivers (receiver index) |
\(N_{TA} (k)\) | Number of antennas per transmitter (transmit antenna index) |
\(N_{RA} (l)\) | Number of antennas per receiver (receive antenna index) |
\(N_S (s)\) | Number of OFDM symbols (OFDM symbol index) |
\(N_F (n)\) | Number of subcarriers (subcarrier index) |
\(N_B (b)\) | Number of time samples forming the channel input (baseband symbol index) |
\(L_{\text{min}}\) | Smallest time-lag for the discrete complex baseband channel |
\(L_{\text{max}}\) | Largest time-lag for the discrete complex baseband channel |
\(M (m)\) | Number of paths (clusters) forming a power delay profile (path index) |
\(\tau_m(t)\) | \(m^{th}\) path (cluster) delay at time step\(t\) |
\(a_m(t)\) | \(m^{th}\) path (cluster) complex coefficient at time step\(t\) |
\(\Delta_f\) | Subcarrier spacing |
\(W\) | Bandwidth |
\(N_0\) | Noise variance |
All transmitters are equipped with\(N_{TA}\) antennas and all receiverswith\(N_{RA}\) antennas.
A channel model, such asRayleighBlockFading orUMi, is used to generate for each link betweenantenna\(k\) of transmitter\(u\) and antenna\(l\) of receiver\(v\) a power delay profile\((a_{u, k, v, l, m}(t), \tau_{u, v, m}), 0 \leq m \leq M-1\).The delays are assumed not to depend on time\(t\), and transmit and receiveantennas\(k\) and\(l\).Such a power delay profile corresponds to the channel impulse response
where\(\delta(\cdot)\) is the Dirac delta measure.For example, in the case of Rayleigh block fading, the power delay profiles aretime-invariant and such that for every link\((u, k, v, l)\)
3GPP channel models use the procedure depicted in[TR38901] to generate powerdelay profiles. With these models, the power delay profiles are time-variantin the event of mobility.
- classsionna.phy.channel.AWGN(*,precision=None,**kwargs)[source]
Add complex AWGN to the inputs with a certain variance
This layer blocks complex AWGN noise with variance
noto the input.The noise has varianceno/2per real dimension.It can be either a scalar or a tensor which can be broadcast to the shapeof the input.Example
Setting-up:
>>>awgn_channel=AWGN()
Running:
>>># x is the channel input>>># no is the noise variance>>>y=awgn_channel(x,no)
- Parameters:
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.- Input:
x (Tensor, tf.complex) – Channel input
no (Scalar or Tensor,tf.float) – Scalar or tensor whose shape can be broadcast to the shape of
x.The noise powernois per complex dimension. Ifnois ascalar, noise of the same variance will be added to the input.Ifnois a tensor, it must have a shape that can be broadcast tothe shape ofx. This allows, e.g., adding noise of differentvariance to each example in a batch. Ifnohas a lower rank thanx, thennowill be broadcast to the shape ofxby addingdummy dimensions after the last axis.
- Output:
y (Tensor with same shape as
x,tf.complex) – Channel output
Flat-fading channel
- classsionna.phy.channel.FlatFadingChannel(num_tx_ant,num_rx_ant,spatial_corr=None,return_channel=False,precision=None,**kwargs)[source]
Applies random channel matrices to a vector input and adds AWGN
This class combines
GenerateFlatFadingChannelandApplyFlatFadingChanneland computes the output ofa flat-fading channel with AWGN.For a given batch of input vectors\(\mathbf{x}\in\mathbb{C}^{K}\),the output is
\[\mathbf{y} = \mathbf{H}\mathbf{x} + \mathbf{n}\]where\(\mathbf{H}\in\mathbb{C}^{M\times K}\) are randomly generatedflat-fading channel matrices and\(\mathbf{n}\in\mathbb{C}^{M}\sim\mathcal{CN}(0, N_o\mathbf{I})\)is an AWGN vector that is optionally added.
A
SpatialCorrelationcan be configured and thechannel realizations optionally returned. This is useful to simulatereceiver algorithms with perfect channel knowledge.- Parameters:
num_tx_ant (int) – Number of transmit antennas
num_rx_ant (int) – Number of receive antennas
spatial_corr (None (default) |
SpatialCorrelation) – Spatial correlation to be appliedreturn_channel (bool, (defaultFalse)) – Indicates if the channel realizations should be returned
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Input:
x ([batch_size, num_tx_ant],tf.complex) – Tensor of transmit vectors
no (None (default) | Tensor,tf.float) – (Optional) noise power
noper complex dimension.Will be broadcast to the shape ofy.For more details, seeAWGN.
- Output:
y ([batch_size, num_rx_ant],tf.complex) – Channel output
h ([batch_size, num_rx_ant, num_tx_ant],tf.complex) – Channel realizations. Will only be returned if
return_channel==True.
- propertyapply
Calls the internal
ApplyFlatFadingChannel
- propertygenerate
Calls the internal
GenerateFlatFadingChannel
- propertyspatial_corr
Get/set spatialcorrelation to be applied
- Type:
- classsionna.phy.channel.GenerateFlatFadingChannel(num_tx_ant,num_rx_ant,spatial_corr=None,precision=None,**kwargs)[source]
Generates tensors of flat-fading channel realizations
This class generates batches of random flat-fading channel matrices.A spatial correlation can be applied.
- Parameters:
num_tx_ant (int) – Number of transmit antennas
num_rx_ant (int) – Number of receive antennas
spatial_corr (None (default) |
SpatialCorrelation) – Spatial correlation to be appliedprecision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Input:
batch_size (int) – Number of channel matrices to generate
- Output:
h ([batch_size, num_rx_ant, num_tx_ant],tf.complex) – Batch of random flat fading channel matrices
- propertyspatial_corr
Get/set spatialcorrelation to be applied
- Type:
- classsionna.phy.channel.ApplyFlatFadingChannel(precision=None,**kwargs)[source]
Applies given channel matrices to a vector input and adds AWGN
This class applies a given tensor of flat-fading channel matricesto an input tensor. AWGN noise can be optionally added.Mathematically, for channel matrices\(\mathbf{H}\in\mathbb{C}^{M\times K}\)and input\(\mathbf{x}\in\mathbb{C}^{K}\), the output is
\[\mathbf{y} = \mathbf{H}\mathbf{x} + \mathbf{n}\]where\(\mathbf{n}\in\mathbb{C}^{M}\sim\mathcal{CN}(0, N_o\mathbf{I})\)is an AWGN vector that is optionally added.
- Parameters:
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.- Input:
x ([batch_size, num_tx_ant],tf.complex) – Transmit vectors
h ([batch_size, num_rx_ant, num_tx_ant],tf.complex) – Channel realizations. Will be broadcast to thedimensions of
xif needed.no (None (default) | Tensor,tf.float) – (Optional) noise power
noper complex dimension.Will be broadcast to the shape ofy.For more details, seeAWGN.
- Output:
y ([batch_size, num_rx_ant],tf.complex) – Channel output
- classsionna.phy.channel.SpatialCorrelation(*args,precision=None,**kwargs)[source]
Abstract class that defines an interface for spatial correlation functions
The
FlatFadingChannelmodel can be configured with aspatial correlation model.- Parameters:
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.- Input:
h (tf.complex) – Tensor of arbitrary shape containing spatially uncorrelatedchannel coefficients
- Output:
h_corr (tf.complex) – Tensor of the same shape as
hcontaining the spatiallycorrelated channel coefficients
- classsionna.phy.channel.KroneckerModel(r_tx=None,r_rx=None,precision=None)[source]
Kronecker model for spatial correlation
Given a batch of matrices\(\mathbf{H}\in\mathbb{C}^{M\times K}\),\(\mathbf{R}_\text{tx}\in\mathbb{C}^{K\times K}\), and\(\mathbf{R}_\text{rx}\in\mathbb{C}^{M\times M}\), this functionwill generate the following output:
\[\mathbf{H}_\text{corr} = \mathbf{R}^{\frac12}_\text{rx} \mathbf{H} \mathbf{R}^{\frac12}_\text{tx}\]Note that\(\mathbf{R}_\text{tx}\in\mathbb{C}^{K\times K}\) and\(\mathbf{R}_\text{rx}\in\mathbb{C}^{M\times M}\)must be positive semi-definite, such as the ones generated by
exp_corr_mat().- Parameters:
r_tx ([…, K, K],tf.complex) – Transmit correlation matrices. Ifthe rank of
r_txis smaller than that of the inputh,it will be broadcast.r_rx ([…, M, M],tf.complex) – Receive correlation matrices. Ifthe rank of
r_rxis smaller than that of the inputh,it will be broadcast.precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Input:
h ([…, M, K],tf.complex) – Spatially uncorrelated channel coeffficients
- Output:
h_corr ([…, M, K],tf.complex) – Spatially correlated channel coefficients
- propertyr_rx
Get/set receive correlation matrices
- Type:
[…, M, M],tf.complex
- propertyr_tx
Get/set transmit correlation matrices
- Type:
[…, K, K],tf.complex
- classsionna.phy.channel.PerColumnModel(r_rx,precision=None)[source]
Per-column model for spatial correlation
Given a batch of matrices\(\mathbf{H}\in\mathbb{C}^{M\times K}\)and correlation matrices\(\mathbf{R}_k\in\mathbb{C}^{M\times M}, k=1,\dots,K\),this function will generate the output\(\mathbf{H}_\text{corr}\in\mathbb{C}^{M\times K}\),with columns
\[\mathbf{h}^\text{corr}_k = \mathbf{R}^{\frac12}_k \mathbf{h}_k,\quad k=1, \dots, K\]where\(\mathbf{h}_k\) is the kth column of\(\mathbf{H}\).Note that all\(\mathbf{R}_k\in\mathbb{C}^{M\times M}\) mustbe positive semi-definite, such as the ones generatedby
one_ring_corr_mat().This model is typically used to simulate a MIMO channel between multiplesingle-antenna users and a base station with multiple antennas.The resulting SIMO channel for each user has a different spatial correlation.
- Parameters:
r_rx ([…, M, M],tf.complex) – Receive correlation matrices. Ifthe rank of
r_rxis smaller than that of the inputh,it will be broadcast. For a typically use of this model,r_rxhas shape […, K, M, M], i.e., a different correlation matrix for eachcolumn ofh.precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Input:
h ([…, M, K],tf.complex) – Spatially uncorrelated channel coeffficients
- Output:
h_corr ([…, M, K], tf.complex) – Spatially correlated channel coefficients
- propertyr_rx
Get/set receive correlation matrices
- Type:
[…, M, M],tf.complex
Channel model interface
- classsionna.phy.channel.ChannelModel(precision=None,**kwargs)[source]
Abstract class that defines an interface for channel models
Any channel model which generates channel impulse responsesmust implement this interface.All the channel models available in Sionna,such as
RayleighBlockFadingorTDL, implement this interface.Remark: Some channel models only require a subset of the input parameters.
- Parameters:
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.- Input:
batch_size (int) – Batch size
num_time_steps (int) – Number of time steps
sampling_frequency (float) – Sampling frequency [Hz]
- Output:
a ([batch size, num_rx, num_rx_ant, num_tx, num_tx_ant, num_paths, num_time_steps],tf.complex) – Path coefficients
tau ([batch size, num_rx, num_tx, num_paths],tf.float) – Path delays [s]
Time domain channel
The model of the channel in the time domain assumes pulse shaping and receivefiltering are performed using a conventional sinc filter (see, e.g.,[Tse]).Using sinc for transmit and receive filtering, the discrete-time domain receivedsignal at time step\(b\) is
where\(x_{u, k, b}\) is the baseband symbol transmitted by transmitter\(u\) on antenna\(k\) and at time step\(b\),\(w_{v, l, b} \sim \mathcal{CN}\left(0,N_0\right)\) the additive whiteGaussian noise, and\(\bar{h}_{u, k, v, l, b, \ell}\) the channel filter tapat time step\(b\) and for time-lag\(\ell\), which is given by
Note
The two parameters\(L_{\text{min}}\) and\(L_{\text{max}}\) control the smallestand largest time-lag for the discrete-time channel model, respectively.They are set when instantiatingTimeChannel,GenerateTimeChannel, and when calling the utilityfunctioncir_to_time_channel().Because the sinc filter is neither time-limited nor causal, the discrete-timechannel model is not causal. Therefore, ideally, one would set\(L_{\text{min}} = -\infty\) and\(L_{\text{max}} = +\infty\).In practice, however, these two parameters need to be set to reasonablefinite values. Values for these two parameters can be computed using thetime_lag_discrete_time_channel() utility function froma given bandwidth and maximum delay spread.This function returns\(-6\) for\(L_{\text{min}}\).\(L_{\text{max}}\) is computedfrom the specified bandwidth and maximum delay spread, which default value is\(3 \mu s\). These values for\(L_{\text{min}}\) and the maximum delay spreadwere found to be valid for all the models available in Sionna when an RMS delayspread of 100ns is assumed.
- classsionna.phy.channel.TimeChannel(channel_model,bandwidth,num_time_samples,maximum_delay_spread=3e-06,l_min=None,l_max=None,normalize_channel=False,return_channel=False,precision=None,**kwargs)[source]
Generates channel responses and applies them to channel inputs in the time domain
The channel output consists of
num_time_samples+l_max-l_mintime samples, as it is the result of filtering the channel input of lengthnum_time_sampleswith the time-variant channel filter of lengthl_max-l_min+ 1. In the case of a single-input single-output link and given a sequence of channelinputs\(x_0,\cdots,x_{N_B}\), where\(N_B\) isnum_time_samples, thislayer outputs\[y_b = \sum_{\ell = L_{\text{min}}}^{L_{\text{max}}} x_{b-\ell} \bar{h}_{b,\ell} + w_b\]where\(L_{\text{min}}\) corresponds
l_min,\(L_{\text{max}}\) tol_max,\(w_b\) tothe additive noise, and\(\bar{h}_{b,\ell}\) to the\(\ell^{th}\) tap of the\(b^{th}\) channel sample.This layer outputs\(y_b\) for\(b\) ranging from\(L_{\text{min}}\) to\(N_B + L_{\text{max}} - 1\), and\(x_{b}\) is set to 0 for\(b < 0\) or\(b \geq N_B\).The channel taps\(\bar{h}_{b,\ell}\) are computed assuming a sinc filteris used for pulse shaping and receive filtering. Therefore, given a channel impulse response\((a_{m}(t), \tau_{m}), 0 \leq m \leq M-1\), generated by thechannel_model,the channel taps are computed as follows:\[\bar{h}_{b, \ell}= \sum_{m=0}^{M-1} a_{m}\left(\frac{b}{W}\right) \text{sinc}\left( \ell - W\tau_{m} \right)\]for\(\ell\) ranging from
l_mintol_max, and where\(W\) isthebandwidth.For multiple-input multiple-output (MIMO) links, the channel output is computed for each antenna of each receiver and by summing over all the antennas of all transmitters.
- Parameters:
channel_model (
ChannelModel) – Used channel modelbandwidth (float) – Bandwidth (\(W\)) [Hz]
num_time_samples (int) – Number of time samples forming the channel input (\(N_B\))
maximum_delay_spread (float, (default 3e-6)) – Maximum delay spread [s].Used to compute the default value of
l_maxifl_maxis set toNone. If a value is given forl_max, this parameter is not used.It defaults to 3us, which was foundto be large enough to include most significant paths with all channelmodels included in Sionna assuming a nominal delay spread of 100ns.l_min (None (default) |int) – Smallest time-lag for the discrete complex baseband channel (\(L_{\text{min}}\)).If set toNone, defaults to the value given by
time_lag_discrete_time_channel().l_max (None (default) |int) – Largest time-lag for the discrete complex baseband channel (\(L_{\text{max}}\)).If set toNone, it is computed from
bandwidthandmaximum_delay_spreadusingtime_lag_discrete_time_channel(). If it is not set toNone,then the parametermaximum_delay_spreadis not used.normalize_channel (bool, (defaultFalse)) – If set toTrue, the channel is normalized over the block sizeto ensure unit average energy per time step.
return_channel (bool, (defaultFalse)) – If set toTrue, the channel response is returned in addition to thechannel output.
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Input:
x ([batch size, num_tx, num_tx_ant, num_time_samples],tf.complex) – Channel inputs
no (None (default) | Tensor,tf.float) – Tensor whose shape can be broadcast to the shape of thechannel outputs: [batch size, num_rx, num_rx_ant, num_time_samples].The (optional) noise power
nois per complex dimension. Ifnois a scalar,noise of the same variance will be added to the outputs.Ifnois a tensor, it must have a shape that can be broadcast tothe shape of the channel outputs. This allows, e.g., adding noise ofdifferent variance to each example in a batch. Ifnohas a lowerrank than the channel outputs, thennowill be broadcast to theshape of the channel outputs by adding dummy dimensions after the lastaxis.
- Output:
y ([batch size, num_rx, num_rx_ant, num_time_samples + l_max - l_min],tf.complex) – Channel outputsThe channel output consists of
num_time_samples+l_max-l_mintime samples, as it is the result of filtering the channel input of lengthnum_time_sampleswith the time-variant channel filter of lengthl_max-l_min+ 1.h_time ([batch size, num_rx, num_rx_ant, num_tx, num_tx_ant, num_time_samples + l_max - l_min, l_max - l_min + 1],tf.complex) – (Optional) Channel responses. Returned only if
return_channelis set toTrue.For each batch example,num_time_samples+l_max-l_mintimesteps of the channel realizations are generated to filter the channel input.
- classsionna.phy.channel.GenerateTimeChannel(channel_model,bandwidth,num_time_samples,l_min,l_max,normalize_channel=False,precision=None,**kwargs)[source]
Generate channel responses in the time domain
For each batch example,
num_time_samples+l_max-l_mintime steps of achannel realization are generated by this layer.These can be used to filter a channel input of lengthnum_time_samplesusing theApplyTimeChannellayer.The channel taps\(\bar{h}_{b,\ell}\) (
h_time) returned by this layerare computed assuming a sinc filter is used for pulse shaping and receive filtering.Therefore, given a channel impulse response\((a_{m}(t), \tau_{m}), 0 \leq m \leq M-1\), generated by thechannel_model,the channel taps are computed as follows:\[\bar{h}_{b, \ell}= \sum_{m=0}^{M-1} a_{m}\left(\frac{b}{W}\right) \text{sinc}\left( \ell - W\tau_{m} \right)\]for\(\ell\) ranging from
l_mintol_max, and where\(W\) isthebandwidth.- Parameters:
channel_model (
ChannelModel) – Channel model to be usedbandwidth (float) – Bandwidth (\(W\)) [Hz]
num_time_samples (int) – Number of time samples forming the channel input (\(N_B\))
l_min (int) – Smallest time-lag for the discrete complex baseband channel (\(L_{\text{min}}\))
l_max (int) – Largest time-lag for the discrete complex baseband channel (\(L_{\text{max}}\))
normalize_channel (bool, (defaultFalse)) – If set toTrue, the channel is normalized over the block sizeto ensure unit average energy per time step.
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Input:
batch_size (None (default) |int) – Batch size. Defaults toNone for channel models that do not require this parameter.
- Output:
h_time ([batch size, num_rx, num_rx_ant, num_tx, num_tx_ant, num_time_samples + l_max - l_min, l_max - l_min + 1],tf.complex) – Channel responses.For each batch example,
num_time_samples+l_max-l_mintime steps of achannel realization are generated by this layer.These can be used to filter a channel input of lengthnum_time_samplesusing theApplyTimeChannellayer.
- classsionna.phy.channel.ApplyTimeChannel(num_time_samples,l_tot,precision=None,**kwargs)[source]
Apply time domain channel responses
h_timeto channel inputsx,by filtering the channel inputs with time-variant channel responses.For each batch example,
num_time_samples+l_tot- 1 time steps of achannel realization are required to filter the channel inputs.The channel output consists of
num_time_samples+l_tot- 1time samples, as it is the result of filtering the channel input of lengthnum_time_sampleswith the time-variant channel filter of lengthl_tot. In the case of a single-input single-output link and given a sequence of channelinputs\(x_0,\cdots,x_{N_B}\), where\(N_B\) isnum_time_samples, thislayer outputs\[y_b = \sum_{\ell = 0}^{L_{\text{tot}}} x_{b-\ell} \bar{h}_{b,\ell} + w_b\]where\(L_{\text{tot}}\) corresponds
l_tot,\(w_b\) to the additive noise, and\(\bar{h}_{b,\ell}\) to the\(\ell^{th}\) tap of the\(b^{th}\) channel sample.This layer outputs\(y_b\) for\(b\) ranging from 0 to\(N_B + L_{\text{tot}} - 1\), and\(x_{b}\) is set to 0 for\(b \geq N_B\).For multiple-input multiple-output (MIMO) links, the channel output is computed for each antennaof each receiver and by summing over all the antennas of all transmitters.
- Parameters:
num_time_samples (int) – Number of time samples forming the channel input (\(N_B\))
l_tot (int) – Length of the channel filter (\(L_{\text{tot}} = L_{\text{max}} - L_{\text{min}} + 1\))
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Input:
x ([batch size, num_tx, num_tx_ant, num_time_samples],tf.complex) – Channel inputs
h_time ([batch size, num_rx, num_rx_ant, num_tx, num_tx_ant, num_time_samples + l_tot - 1, l_tot],tf.complex) – Channel responses.For each batch example,
num_time_samples+l_tot- 1 time steps of achannel realization are required to filter the channel inputs.no (None (default) | tensor,tf.float) – Scalar or tensor whose shape can be broadcast to the shape of the channel outputs: [batch size, num_rx, num_rx_ant, num_time_samples + l_tot - 1].The (optional) noise power
nois per complex dimension. Ifnois ascalar, noise of the same variance will be added to the outputs.Ifnois a tensor, it must have a shape that can be broadcast tothe shape of the channel outputs. This allows, e.g., adding noise ofdifferent variance to each example in a batch. Ifnohas a lowerrank than the channel outputs, thennowill be broadcast to theshape of the channel outputs by adding dummy dimensions after thelast axis.
- Output:
y ([batch size, num_rx, num_rx_ant, num_time_samples + l_tot - 1], tf.complex) – Channel outputs.The channel output consists of
num_time_samples+l_tot- 1time samples, as it is the result of filtering the channel input of lengthnum_time_sampleswith the time-variant channel filter of lengthl_tot.
- sionna.phy.channel.cir_to_time_channel(bandwidth,a,tau,l_min,l_max,normalize=False)[source]
Compute the channel taps forming the discrete complex-basebandrepresentation of the channel from the channel impulse response(
a,tau)This function assumes that a sinc filter is used for pulse shaping and receivefiltering. Therefore, given a channel impulse response\((a_{m}(t), \tau_{m}), 0 \leq m \leq M-1\), the channel tapsare computed as follows:
\[\bar{h}_{b, \ell}= \sum_{m=0}^{M-1} a_{m}\left(\frac{b}{W}\right) \text{sinc}\left( \ell - W\tau_{m} \right)\]for\(\ell\) ranging from
l_mintol_max, and where\(W\) isthebandwidth.- Input:
bandwidth (float) – Bandwidth [Hz]
a ([batch size, num_rx, num_rx_ant, num_tx, num_tx_ant, num_paths, num_time_steps],tf.complex) – Path coefficients
tau ([batch size, num_rx, num_tx, num_paths] or [batch size, num_rx, num_rx_ant, num_tx, num_tx_ant, num_paths],tf.float) – Path delays [s]
l_min (int) – Smallest time-lag for the discrete complex baseband channel (\(L_{\text{min}}\))
l_max (int) – Largest time-lag for the discrete complex baseband channel (\(L_{\text{max}}\))
normalize (bool, (defaultFalse)) – If set toTrue, the channel is normalized over the block sizeto ensure unit average energy per time step.
- Output:
hm ([batch size, num_rx, num_rx_ant, num_tx, num_tx_ant, num_time_steps, l_max - l_min + 1],tf.complex) – Channel taps coefficients
- sionna.phy.channel.time_to_ofdm_channel(h_t,rg,l_min)[source]
Compute the channel frequency response from the discrete complex-basebandchannel impulse response
Given a discrete complex-baseband channel impulse response\(\bar{h}_{b,\ell}\), for\(\ell\) ranging from\(L_\text{min}\le 0\)to\(L_\text{max}\), the discrete channel frequency response is computed as
\[\hat{h}_{b,n} = \sum_{k=0}^{L_\text{max}} \bar{h}_{b,k} e^{-j \frac{2\pi kn}{N}} + \sum_{k=L_\text{min}}^{-1} \bar{h}_{b,k} e^{-j \frac{2\pi n(N+k)}{N}}, \quad n=0,\dots,N-1\]where\(N\) is the FFT size and\(b\) is the time step.
This function only produces one channel frequency response per OFDM symbol, i.e.,only values of\(b\) corresponding to the start of an OFDM symbol (aftercyclic prefix removal) are considered.
- Input:
h_t ([…num_time_steps,l_max-l_min+1],tf.complex) – Tensor of discrete complex-baseband channel impulse responses
resource_grid (
ResourceGrid) – Resource gridl_min (int) – Smallest time-lag for the discrete complex basebandchannel impulse response (\(L_{\text{min}}\))
- Output:
h_f ([…,num_ofdm_symbols,fft_size],tf.complex) – Tensor of discrete complex-baseband channel frequency responses
Note
Note that the result of this function is generally different from theoutput of
cir_to_ofdm_channel()becausethe discrete complex-baseband channel impulse response is truncated(seecir_to_time_channel()). This effectcan be observed in the example below.Examples
# Setup resource grid and channel modelsm=StreamManagement(np.array([[1]]),1)rg=ResourceGrid(num_ofdm_symbols=1,fft_size=1024,subcarrier_spacing=15e3)tdl=TDL("A",100e-9,3.5e9)# Generate CIRcir=tdl(batch_size=1,num_time_steps=1,sampling_frequency=rg.bandwidth)# Generate OFDM channel from CIRfrequencies=subcarrier_frequencies(rg.fft_size,rg.subcarrier_spacing)h_freq=tf.squeeze(cir_to_ofdm_channel(frequencies,*cir,normalize=True))# Generate time channel from CIRl_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)# Generate OFDM channel from time channelh_freq_hat=tf.squeeze(time_to_ofdm_channel(h_time,rg,l_min))# Visualize resultsplt.figure()plt.plot(np.real(h_freq),"-")plt.plot(np.real(h_freq_hat),"--")plt.plot(np.imag(h_freq),"-")plt.plot(np.imag(h_freq_hat),"--")plt.xlabel("Subcarrier index")plt.ylabel(r"Channel frequency response")plt.legend(["OFDM Channel (real)","OFDM Channel from time (real)","OFDM Channel (imag)","OFDM Channel from time (imag)"])

Channel with OFDM waveform
To implement the channel response assuming an OFDM waveform, it is assumed thatthe power delay profiles are invariant over the duration of an OFDM symbol.Moreover, it is assumed that the duration of the cyclic prefix (CP) equals atleast the maximum delay spread. These assumptions are common in the literature, as theyenable modeling of the channel transfer function in the frequency domain as asingle-tap channel.
For every link\((u, k, v, l)\) and resource element\((s,n)\),the frequency channel response is obtained by computing the Fourier transform ofthe channel response at the subcarrier frequencies, i.e.,
where\(s\) is used as time step to indicate that the channel response canchange from one OFDM symbol to the next in the event of mobility, even if it isassumed static over the duration of an OFDM symbol.
For every receive antenna\(l\) of every receiver\(v\), thereceived signal\(y_{v, l, s, n}`\) for resource element\((s, n)\) is computed by
where\(x_{u, k, s, n}\) is the baseband symbol transmitted by transmitter\(u`\) on antenna\(k\) and resource element\((s, n)\), and\(w_{v, l, s, n} \sim \mathcal{CN}\left(0,N_0\right)\) the additive whiteGaussian noise.
Note
This model does not account for intersymbol interference (ISI) norintercarrier interference (ICI). To model the ICI due to channel aging overthe duration of an OFDM symbol or the ISI due to a delay spread exceeding theCP duration, one would need to simulate the channel in the time domain.This can be achieved by using theOFDMModulator andOFDMDemodulator layers, and thetime domain channel model.By doing so, one performs inverse discrete Fourier transform (IDFT) onthe transmitter side and discrete Fourier transform (DFT) on the receiver sideon top of a single-carrier sinc-shaped waveform.This is equivalent tosimulating the channel in the frequency domain if noISI nor ICI is assumed, but allows the simulation of these effects in theevent of a non-stationary channel or long delay spreads.Note that simulating the channel in the time domain is typically significantlymore computationally demanding that simulating the channel in the frequencydomain.
- classsionna.phy.channel.OFDMChannel(channel_model,resource_grid,normalize_channel=False,return_channel=False,precision=None,**kwargs)[source]
Generate channel frequency responses and apply them to channel inputsassuming an OFDM waveform with no ICI nor ISI
For each OFDM symbol\(s\) and subcarrier\(n\), the channel output is computed as follows:
\[y_{s,n} = \widehat{h}_{s, n} x_{s,n} + w_{s,n}\]where\(y_{s,n}\) is the channel output computed by this layer,\(\widehat{h}_{s, n}\) the frequency channel response,\(x_{s,n}\) the channel input
x, and\(w_{s,n}\) the additive noise.For multiple-input multiple-output (MIMO) links, the channel output is computed for each antennaof each receiver and by summing over all the antennas of all transmitters.
The channel frequency response for the\(s^{th}\) OFDM symbol and\(n^{th}\) subcarrier is computed from a given channel impulse response\((a_{m}(t), \tau_{m}), 0 \leq m \leq M-1\) generated by the
channel_modelas follows:\[\widehat{h}_{s, n} = \sum_{m=0}^{M-1} a_{m}(s) e^{-j2\pi n \Delta_f \tau_{m}}\]where\(\Delta_f\) is the subcarrier spacing, and\(s\) is used as timestep to indicate that the channel impulse response can change from one OFDM symbol to thenext in the event of mobility, even if it is assumed static over the durationof an OFDM symbol.
- Parameters:
channel_model (
ChannelModel) – Used channel modelresource_grid (
ResourceGrid) – Resource gridnormalize_channel (bool, (defaultFalse)) – If set toTrue, the channel is normalized over the resource gridto ensure unit average energy per resource element.
return_channel (bool, (defaultFalse)) – If set toTrue, the channel response is returned in addition to thechannel output.
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Input:
x ([batch size, num_tx, num_tx_ant, num_ofdm_symbols, fft_size],tf.complex) – Channel inputs
no (None (default) | tensor,tf.float) – Tensor whose shape can be broadcast to the shape of thechannel outputs:[batch size, num_rx, num_rx_ant, num_ofdm_symbols, fft_size].The (optional) noise power
nois per complex dimension. Ifnoisa scalar, noise of the same variance will be added to the outputs.Ifnois a tensor, it must have a shape that can be broadcast tothe shape of the channel outputs. This allows, e.g., adding noise ofdifferent variance to each example in a batch. Ifnohas a lowerrank than the channel outputs, thennowill be broadcast to theshape of the channel outputs by adding dummy dimensions after the lastaxis.
- Output:
y ([batch size, num_rx, num_rx_ant, num_ofdm_symbols, fft_size],tf.complex) – Channel outputs
h_freq ([batch size, num_rx, num_rx_ant, num_tx, num_tx_ant, num_ofdm_symbols, fft_size],tf.complex) – (Optional) Channel frequency responses. Returned only if
return_channelis set toTrue.
- classsionna.phy.channel.GenerateOFDMChannel(channel_model,resource_grid,normalize_channel=False,precision=None,**kwargs)[source]
Generates channel frequency responses
The channel impulse response is constant over the duration of an OFDM symbol.
Given a channel impulse response\((a_{m}(t), \tau_{m}), 0 \leq m \leq M-1\), generated by the
channel_model,the channel frequency response for the\(s^{th}\) OFDM symbol and\(n^{th}\) subcarrier is computed as follows:\[\widehat{h}_{s, n} = \sum_{m=0}^{M-1} a_{m}(s) e^{-j2\pi n \Delta_f \tau_{m}}\]where\(\Delta_f\) is the subcarrier spacing, and\(s\) is used as timestep to indicate that the channel impulse response can change from one OFDM symbol to thenext in the event of mobility, even if it is assumed static over the durationof an OFDM symbol.
- Parameters:
channel_model (
ChannelModel) – Channel model to be used.resource_grid (
ResourceGrid) – Resource gridnormalize_channel (bool, (defaultFalse)) – If set toTrue, the channel is normalized over the resource gridto ensure unit average energy per resource element.
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Input:
batch_size (None (default) |int) – Batch size. Defaults toNone for channel models that do not require this parameter.
- Output:
h_freq ([batch size, num_rx, num_rx_ant, num_tx, num_tx_ant, num_ofdm_symbols, num_subcarriers],tf.complex) – Channel frequency responses
- classsionna.phy.channel.ApplyOFDMChannel(precision=None,**kwargs)[source]
Apply single-tap channel frequency responses to channel inputs
For each OFDM symbol\(s\) and subcarrier\(n\), the single-tap channelis applied as follows:
\[y_{s,n} = \widehat{h}_{s, n} x_{s,n} + w_{s,n}\]where\(y_{s,n}\) is the channel output computed by this layer,\(\widehat{h}_{s, n}\) the frequency channel response (
h_freq),\(x_{s,n}\) the channel inputx, and\(w_{s,n}\) the additive noise.For multiple-input multiple-output (MIMO) links, the channel output is computed for each antennaof each receiver and by summing over all the antennas of all transmitters.
- Parameters:
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.- Input:
x ([batch size, num_tx, num_tx_ant, num_ofdm_symbols, fft_size],tf.complex) – Channel inputs
h_freq ([batch size, num_rx, num_rx_ant, num_tx, num_tx_ant, num_ofdm_symbols, fft_size],tf.complex) – Channel frequency responses
no (None (default) | tensor,tf.float) – Tensor whose shape can be broadcast to the shape of thechannel outputs:[batch size, num_rx, num_rx_ant, num_ofdm_symbols, fft_size].The (optional) noise power
nois per complex dimension. Ifnois ascalar, noise of the same variance will be added to the outputs.Ifnois a tensor, it must have a shape that can be broadcast tothe shape of the channel outputs. This allows, e.g., adding noise ofdifferent variance to each example in a batch. Ifnohas a lowerrank than the channel outputs, thennowill be broadcast to theshape of the channel outputs by adding dummy dimensions after thelast axis.
- Output:
y ([batch size, num_rx, num_rx_ant, num_ofdm_symbols, fft_size],tf.complex) – Channel outputs
- sionna.phy.channel.cir_to_ofdm_channel(frequencies,a,tau,normalize=False)[source]
Compute the frequency response of the channel at
frequenciesGiven a channel impulse response\((a_{m}, \tau_{m}), 0 \leq m \leq M-1\) (inputs
aandtau),the channel frequency response for the frequency\(f\)is computed as follows:\[\widehat{h}(f) = \sum_{m=0}^{M-1} a_{m} e^{-j2\pi f \tau_{m}}\]- Input:
frequencies ([fft_size],tf.float) – Frequencies at which to compute the channel response
a ([batch size, num_rx, num_rx_ant, num_tx, num_tx_ant, num_paths, num_time_steps],tf.complex) – Path coefficients
tau ([batch size, num_rx, num_tx, num_paths] or [batch size, num_rx, num_rx_ant, num_tx, num_tx_ant, num_paths],tf.float) – Path delays
normalize (bool, (defaultFalse)) – If set toTrue, the channel is normalized over the resource grid
- Output:
h_f ([batch size, num_rx, num_rx_ant, num_tx, num_tx_ant, num_time_steps, fft_size],tf.complex) – Channel frequency responses at
frequencies
Rayleigh block fading
- classsionna.phy.channel.RayleighBlockFading(num_rx,num_rx_ant,num_tx,num_tx_ant,precision=None,**kwargs)[source]
Generates channel impulse responses corresponding to a Rayleigh blockfading channel model
The channel impulse responses generated are formed of a single path withzero delay and a normally distributed fading coefficient.All time steps of a batch example share the same channel coefficient(block fading).
This class can be used in conjunction with the classes that simulate thechannel response in time or frequency domain, i.e.,
OFDMChannel,TimeChannel,GenerateOFDMChannel,ApplyOFDMChannel,GenerateTimeChannel,ApplyTimeChannel.- Parameters:
num_rx (int) – Number of receivers (\(N_R\))
num_rx_ant (int) – Number of antennas per receiver (\(N_{RA}\))
num_tx (int) – Number of transmitters (\(N_T\))
num_tx_ant (int) – Number of antennas per transmitter (\(N_{TA}\))
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Input:
batch_size (int) – Batch size
num_time_steps (int) – Number of time steps
- Output:
a ([batch size, num_rx, num_rx_ant, num_tx, num_tx_ant, num_paths = 1, num_time_steps],tf.complex) – Path coefficients
tau ([batch size, num_rx, num_tx, num_paths = 1],tf.float) – Path delays [s]
3GPP 38.901 channel models
The submoduletr38901 implements 3GPP channel models from[TR38901].
TheCDL,UMi,UMa, andRMamodels require setting-up antenna models for the transmitters andreceivers. This is achieved using thePanelArray class.
TheUMi,UMa, andRMa models requiresetting-up a network topology, specifying, e.g., the user terminals (UTs) andbase stations (BSs) locations, the UTs velocities, etc.Utility functions are available to help laying outcomplex topologies or to quickly setup simple but widely used topologies.
- classsionna.phy.channel.tr38901.PanelArray(num_rows_per_panel,num_cols_per_panel,polarization,polarization_type,antenna_pattern,carrier_frequency,num_rows=1,num_cols=1,panel_vertical_spacing=None,panel_horizontal_spacing=None,element_vertical_spacing=None,element_horizontal_spacing=None,precision=None)[source]
Antenna panel array following the[TR38901] specification
This class is used to create models of the panel arrays used by thetransmitters and receivers and that need to be specified when using theCDL,UMi,UMa, andRMamodels.
Example
>>>array=PanelArray(num_rows_per_panel=4,...num_cols_per_panel=4,...polarization='dual',...polarization_type='VH',...antenna_pattern='38.901',...carrier_frequency=3.5e9,...num_cols=2,...panel_horizontal_spacing=3.)>>>array.show()

- Parameters:
num_rows_per_panel (int) – Number of rows of elements per panel
num_cols_per_panel (int) – Number of columns of elements per panel
polarization ("single" |"dual") – Polarization
polarization_type ("V" |"H" |"VH" |"cross") – Type of polarization. For single polarization, must be “V” or “H”.For dual polarization, must be “VH” or “cross”.
antenna_pattern ("omni" |"38.901") – Element radiation pattern
carrier_frequency (float) – Carrier frequency [Hz]
num_rows (int,(default 1)) – Number of rows of panels
num_cols (int,(default 1)) – Number of columns of panels
panel_vertical_spacing (None (default) |float) – Vertical spacing of panels [multiples of wavelength].Must be greater than the panel width.If set toNone, it is set to the panel width + 0.5.
panel_horizontal_spacing (None (default) |float) – Horizontal spacing of panels [in multiples of wavelength].Must be greater than the panel height.If set toNone, it is set to the panel height + 0.5.
element_vertical_spacing (None (default) |float) – Element vertical spacing [multiple of wavelength].Defaults to 0.5 if set toNone.
element_horizontal_spacing (None (default) |float) – Element horizontal spacing [multiple of wavelength].Defaults to 0.5 if set toNone.
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- propertyant_ind_pol1
Indices of antenna elements with the first polarization direction
- propertyant_ind_pol2
Indices of antenna elements with the second polarization direction.Only defined with dual polarization.
- propertyant_pol1
Field of an antenna element with the first polarization direction
- propertyant_pol2
Field of an antenna element with the second polarization direction.Only defined with dual polarization.
- propertyant_pos
Positions of the antennas
- propertyant_pos_pol1
Positions of the antenna elements with the first polarizationdirection
- propertyant_pos_pol2
Positions of antenna elements with the second polarization direction.Only defined with dual polarization.
- propertyelement_horizontal_spacing
Horizontal spacing between the antenna elements within a panel[multiple of wavelength]
- propertyelement_vertical_spacing
Vertical spacing between the antenna elements within a panel[multiple of wavelength]
- propertynum_ant
Total number of antenna elements
- propertynum_cols
Number of columns of panels
- propertynum_cols_per_panel
Number of columns of elements per panel
- propertynum_panels
Number of panels
- propertynum_panels_ant
Number of antenna elements per panel
- propertynum_rows
Number of rows of panels
- propertynum_rows_per_panel
Number of rows of elements per panel
- propertypanel_horizontal_spacing
Horizontal spacing between the panels [multiple of wavelength]
- propertypanel_vertical_spacing
Vertical spacing between the panels [multiple of wavelength]
- propertypolarization
Polarization (“single” or “dual”)
- propertypolarization_type
Polarization type. “V” or “H” for single polarization.“VH” or “cross” for dual polarization.
- classsionna.phy.channel.tr38901.Antenna(polarization,polarization_type,antenna_pattern,carrier_frequency,precision=None)[source]
Single antenna following the[TR38901] specification
This class is a special case of
PanelArray,and can be used in lieu of it.- Parameters:
polarization ("single" |"dual") – Polarization
polarization_type ("V" |"H" |"VH" |"cross") – Type of polarization. For single polarization, must be “V” or “H”.For dual polarization, must be “VH” or “cross”.
antenna_pattern ("omni" |"38.901") – Element radiation pattern
carrier_frequency (float) – Carrier frequency [Hz]
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- classsionna.phy.channel.tr38901.AntennaArray(num_rows,num_cols,polarization,polarization_type,antenna_pattern,carrier_frequency,vertical_spacing=None,horizontal_spacing=None,precision=None)[source]
Antenna array following the[TR38901] specification
This class is a special case of
PanelArray,and can used in lieu of it.- Parameters:
num_rows (int) – Number of rows of elements
num_cols (int) – Number of columns of elements
polarization ("single" |"dual") – Polarization
polarization_type ("V" |"H" |"VH" |"cross") – Type of polarization. For single polarization, must be “V” or “H”.For dual polarization, must be “VH” or “cross”.
antenna_pattern ("omni" |"38.901") – Element radiation pattern
carrier_frequency (float) – Carrier frequency [Hz]
vertical_spacing (None (default) |float) – Element vertical spacing [multiple of wavelength].Defaults to 0.5 if set toNone.
horizontal_spacing (None (default) |float) – Element horizontal spacing [multiple of wavelength].Defaults to 0.5 if set toNone.
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- classsionna.phy.channel.tr38901.TDL(model,delay_spread,carrier_frequency,num_sinusoids=20,los_angle_of_arrival=0.7853981633974483,min_speed=0.0,max_speed=None,num_rx_ant=1,num_tx_ant=1,spatial_corr_mat=None,rx_corr_mat=None,tx_corr_mat=None,precision=None)[source]
Tapped delay line (TDL) channel model from the 3GPP[TR38901] specification
The power delay profiles (PDPs) are normalized to have a total energy of one.
Channel coefficients are generated using a sum-of-sinusoids model[SoS].Channel aging is simulated in the event of mobility.
If a minimum speed and a maximum speed are specified such that themaximum speed is greater than the minimum speed, then speeds are randomlyand uniformly sampled from the specified interval for each link and eachbatch example.
The TDL model only works for systems with a single transmitter and a singlereceiver. The transmitter and receiver can be equipped with multipleantennas. Spatial correlation is simulated through filtering by specifiedcorrelation matrices.
The
spatial_corr_matparameter can be used to specify an arbitraryspatial correlation matrix. In particular, it can be used to modelcorrelated cross-polarized transmit and receive antennas as follows(see, e.g., Annex G.2.3.2.1[TS38141-1]):\[\mathbf{R} = \mathbf{R}_{\text{rx}} \otimes \mathbf{\Gamma} \otimes \mathbf{R}_{\text{tx}}\]where\(\mathbf{R}\) is the spatial correlation matrix
spatial_corr_mat,\(\mathbf{R}_{\text{rx}}\) the spatial correlation matrix at the receiverwith same polarization,\(\mathbf{R}_{\text{tx}}\) the spatial correlationmatrix at the transmitter with same polarization, and\(\mathbf{\Gamma}\)the polarization correlation matrix.\(\mathbf{\Gamma}\) is 1x1 for single-polarizedantennas, 2x2 when only the transmit or receive antennas are cross-polarized, and 4x4 whentransmit and receive antennas are cross-polarized.It is also possible not to specify
spatial_corr_mat, but instead the correlation matricesat the receiver and transmitter, using therx_corr_matandtx_corr_matparameters, respectively.This can be useful when single polarized antennas are simulated, and it is alsomore computationally efficient.This is equivalent to settingspatial_corr_matto :\[\mathbf{R} = \mathbf{R}_{\text{rx}} \otimes \mathbf{R}_{\text{tx}}\]where\(\mathbf{R}_{\text{rx}}\) is the correlation matrix at the receiver
rx_corr_matand\(\mathbf{R}_{\text{tx}}\) the correlation matrix atthe transmittertx_corr_mat.Example
The following code snippet shows how to setup a TDL channel model assumingan OFDM waveform:
>>>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)
where
rgis an instance ofResourceGrid.Notes
The following tables from[TR38901] provide typical values for the delayspread.
Model
Delay spread [ns]
Very short delay spread
\(10\)
Short short delay spread
\(10\)
Nominal delay spread
\(100\)
Long delay spread
\(300\)
Very long delay spread
\(1000\)
Delay spread [ns]
Frequency [GHz]
2
6
15
28
39
60
70
Indoor office
Short delay profile
20
16
16
16
16
16
16
Normal delay profile
39
30
24
20
18
16
16
Long delay profile
59
53
47
43
41
38
37
UMi Street-canyon
Short delay profile
65
45
37
32
30
27
26
Normal delay profile
129
93
76
66
61
55
53
Long delay profile
634
316
307
301
297
293
291
UMa
Short delay profile
93
93
85
80
78
75
74
Normal delay profile
363
363
302
266
249
228
221
Long delay profile
1148
1148
955
841
786
720
698
RMa / RMa O2I
Short delay profile
32
32
N/A
N/A
N/A
N/A
N/A
Normal delay profile
37
37
N/A
N/A
N/A
N/A
N/A
Long delay profile
153
153
N/A
N/A
N/A
N/A
N/A
UMi / UMa O2I
Normal delay profile
242
Long delay profile
616
- Parameters:
model ("A" |"B" |"C" |"D" |"E" |"A30" |"B100" |"C300") – TDL model to use
delay_spread (float) – RMS delay spread [s].For the “A30”, “B100”, and “C300” models, the delay spread must be setto 30ns, 100ns, and 300ns, respectively.
carrier_frequency (float) – Carrier frequency [Hz]
num_sinusoids (int, (default 20)) – Number of sinusoids for the sum-of-sinusoids model. Defaults to 20.
los_angle_of_arrival (float, (default pi/4)) – Angle-of-arrival for LoS path [radian]. Only used with LoS models
min_speed (float, (default 0.0)) – Minimum speed [m/s]
max_speed (None (default) | float) – Maximum speed [m/s]. If set toNone,then
max_speedtakes the same value asmin_speed.num_rx_ant (int, (default 1)) – Number of receive antennas
num_tx_ant (int, (default 1)) – Number of transmit antennas
spatial_corr_mat (None (default) | [num_rx_ant*num_tx_ant,num_rx_ant*num_tx_ant],tf.complex) – Spatial correlation matrix.If not set toNone, then
rx_corr_matandtx_corr_matare ignored andthis matrix is used for spatial correlation.If set toNone andrx_corr_matandtx_corr_matare also set toNone,then no correlation is applied.rx_corr_mat (None (default) | [num_rx_ant,num_rx_ant],tf.complex) – Spatial correlation matrix for the receiver.If set toNone and
spatial_corr_matis also set toNone, then no receivecorrelation is applied.tx_corr_mat (None (default) | [num_tx_ant,num_tx_ant],tf.complex) – Spatial correlation matrix for the transmitter.If set toNone and
spatial_corr_matis also set toNone, then no transmitcorrelation is applied.precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Input:
batch_size (int) – Batch size
num_time_steps (int) – Number of time steps
sampling_frequency (float) – Sampling frequency [Hz]
- Output:
a ([batch size, num_rx = 1, num_rx_ant = 1, num_tx = 1, num_tx_ant = 1, num_paths, num_time_steps],tf.complex) – Path coefficients
tau ([batch size, num_rx = 1, num_tx = 1, num_paths],tf.float) – Path delays [s]
- propertydelay_spread
RMS delay spread [s]
- propertydelays
Path delays [s]
- propertyk_factor
K-factor in linear scale. Only available with LoS models.
- propertylos
True if this is a LoS model.False otherwise.
- propertymean_power_los
LoS component power in linear scale.Only available with LoS models.
- propertymean_powers
Path powers in linear scale
- propertynum_clusters
Number of paths (\(M\))
- classsionna.phy.channel.tr38901.CDL(model,delay_spread,carrier_frequency,ut_array,bs_array,direction,ut_orientation=None,bs_orientation=None,min_speed=0.0,max_speed=None,precision=None)[source]
Clustered delay line (CDL) channel model from the 3GPP[TR38901] specification
The power delay profiles (PDPs) are normalized to have a total energy of one.
If a minimum speed and a maximum speed are specified such that themaximum speed is greater than the minimum speed, then UTs speeds arerandomly and uniformly sampled from the specified interval for each linkand each batch example.
The CDL model only works for systems with a single transmitter and a singlereceiver. The transmitter and receiver can be equipped with multipleantennas.
Example
The following code snippet shows how to setup a CDL channel model assumingan OFDM waveform:
>>># Panel array configuration for the transmitter and receiver>>>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)>>># CDL channel model>>>cdl=CDL(model="A",>>>delay_spread=300e-9,...carrier_frequency=3.5e9,...ut_array=ut_array,...bs_array=bs_array,...direction='uplink')>>>channel=OFDMChannel(channel_model=cdl,...resource_grid=rg)
where
rgis an instance ofResourceGrid.Notes
The following tables from[TR38901] provide typical values for the delayspread.
Model
Delay spread [ns]
Very short delay spread
\(10\)
Short short delay spread
\(10\)
Nominal delay spread
\(100\)
Long delay spread
\(300\)
Very long delay spread
\(1000\)
Delay spread [ns]
Frequency [GHz]
2
6
15
28
39
60
70
Indoor office
Short delay profile
20
16
16
16
16
16
16
Normal delay profile
39
30
24
20
18
16
16
Long delay profile
59
53
47
43
41
38
37
UMi Street-canyon
Short delay profile
65
45
37
32
30
27
26
Normal delay profile
129
93
76
66
61
55
53
Long delay profile
634
316
307
301
297
293
291
UMa
Short delay profile
93
93
85
80
78
75
74
Normal delay profile
363
363
302
266
249
228
221
Long delay profile
1148
1148
955
841
786
720
698
RMa / RMa O2I
Short delay profile
32
32
N/A
N/A
N/A
N/A
N/A
Normal delay profile
37
37
N/A
N/A
N/A
N/A
N/A
Long delay profile
153
153
N/A
N/A
N/A
N/A
N/A
UMi / UMa O2I
Normal delay profile
242
Long delay profile
616
- Parameters:
model ("A" |"B" |"C" |"D" |"E") – CDL model to use
delay_spread (float) – RMS delay spread [s]
carrier_frequency (float) – Carrier frequency [Hz]
ut_array (
PanelArray) – Panel array used by the UTs. All UTs share the same antenna arrayconfiguration.bs_array (
PanelArray) – Panel array used by the Bs. All BSs share the same antenna arrayconfiguration.direction ("uplink" |"downlink") – Link direction
ut_orientation (None (default) | [3],tf.float) – Orientation of the UT. If set toNone, [\(\pi\), 0, 0] is used.
bs_orientation (None (default) | [3],tf.float) – Orientation of the BS. If set toNone, [0, 0, 0] is used.
min_speed (float,(default 0.0)) – Minimum speed [m/s]
max_speed (None (default) |float) – Maximum speed [m/s]. If set toNone,then
max_speedtakes the same value asmin_speed.precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Input:
batch_size (int) – Batch size
num_time_steps (int) – Number of time steps
sampling_frequency (float) – Sampling frequency [Hz]
- Output:
a ([batch size, num_rx = 1, num_rx_ant, num_tx = 1, num_tx_ant, num_paths, num_time_steps], tf.complex) – Path coefficients
tau ([batch size, num_rx = 1, num_tx = 1, num_paths], tf.float) – Path delays [s]
- propertydelay_spread
RMS delay spread [s]
- propertydelays
Path delays [s]
- propertyk_factor
K-factor in linear scale. Only available with LoS models.
- propertylos
True is this is a LoS model.False otherwise.
- propertynum_clusters
Number of paths (\(M\))
- propertypowers
Path powers in linear scale
- classsionna.phy.channel.tr38901.UMi(carrier_frequency,o2i_model,ut_array,bs_array,direction,enable_pathloss=True,enable_shadow_fading=True,always_generate_lsp=False,precision=None)[source]
Urban microcell (UMi) channel model from 3GPP[TR38901] specification
Setting up a UMi model requires configuring the network topology, i.e., theUTs and BSs locations, UTs velocities, etc. This is achieved using the
set_topology()method. Setting a differenttopology for each batch example is possible. The batch size used when setting up the network topologyis used for the link simulations.The following code snippet shows how to setup a UMi channel model operatingin the frequency domain:
>>># UT and BS panel arrays>>>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)>>># Instantiating UMi channel model>>>channel_model=UMi(carrier_frequency=3.5e9,...o2i_model='low',...ut_array=ut_array,...bs_array=bs_array,...direction='uplink')>>># Setting up network topology>>># ut_loc: UTs locations>>># bs_loc: BSs locations>>># ut_orientations: UTs array orientations>>># bs_orientations: BSs array orientations>>># in_state: Indoor/outdoor states of UTs>>>channel_model.set_topology(ut_loc,...bs_loc,...ut_orientations,...bs_orientations,...ut_velocities,...in_state)>>># Instanting the frequency domain channel>>>channel=OFDMChannel(channel_model=channel_model,...resource_grid=rg)
where
rgis an instance ofResourceGrid.- Parameters:
carrier_frequency (float) – Carrier frequency in Hertz
o2i_model ("low" |"high") – Outdoor-to-indoor loss model for UTs located indoor.Set this parameter to “low” to use the low-loss model, or to “high”to use the high-loss model.See section 7.4.3 of[TR38901] for details.
rx_array (
PanelArray) – Panel array used by the receivers. All receivers share the sameantenna array configuration.tx_array (
PanelArray) – Panel array used by the transmitters. All transmitters share thesame antenna array configuration.direction ("uplink" |"downlink") – Link direction
enable_pathloss (bool, (defaultTrue)) – IfTrue, apply pathloss. Otherwise don’t.
enable_shadow_fading (bool, (defaultTrue)) – IfTrue, apply shadow fading. Otherwise don’t.
always_generate_lsp (bool, (defaultFalse)) – IfTrue, new large scale parameters (LSPs) are generated for everynew generation of channel impulse responses. Otherwise, always reusethe same LSPs, except if the topology is changed.
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Input:
num_time_steps (int) – Number of time steps
sampling_frequency (float) – Sampling frequency [Hz]
- Output:
a ([batch size, num_rx, num_rx_ant, num_tx, num_tx_ant, num_paths, num_time_steps],tf.complex) – Path coefficients
tau ([batch size, num_rx, num_tx, num_paths],tf.float) – Path delays [s]
- propertycdtype
Type for complex floating point numbers
- Type:
tf.complex
- propertyprecision
Precision used for all compuations
- Type:
str, “single” | “double”
- propertyrdtype
Type for real floating point numbers
- Type:
tf.float
- propertyreturn_rays
Indicates whether the call method returns the generated rays
- Type:
bool
- set_topology(ut_loc=None,bs_loc=None,ut_orientations=None,bs_orientations=None,ut_velocities=None,in_state=None,los=None,bs_virtual_loc=None)
Set the network topology
It is possible to set up a different network topology for each batchexample. The batch size used when setting up the network topologyis used for the link simulations.
When calling this function, not specifying a parameter leads to thereuse of the previously given value. Not specifying a value that was notset at a former call rises an error.
- Input:
ut_loc (None (default) | [batch size,num_ut, 3],tf.float) – Locations of the UTs
bs_loc (None (default) | [batch size,num_bs, 3],tf.float) – Locations of BSs
ut_orientations (None (default) | [batch size,num_ut, 3],tf.float) – Orientations of the UTs arrays [radian]
bs_orientations (None (default) | [batch size,num_bs, 3],tf.float) – Orientations of the BSs arrays [radian]
ut_velocities (None (default) | [batch size,num_ut, 3],tf.float) – Velocity vectors of UTs
in_state (None (default) | [batch size,num_ut],tf.bool) – Indoor/outdoor state of UTs.True means indoor andFalsemeans outdoor.
los (None (default) |tf.bool) – If notNone, all UTs located outdoor areforced to be in LoS if
losis set toTrue, or in NLoSif it is set toFalse. If set toNone, the LoS/NLoS statesof UTs is set following 3GPP specification[TR38901].bs_virtual_loc (None (default) | [batch size, number of BSs, number of UTs, 3],tf.float) – Virtual locations of BSs for each UT [m].Used to compute BS-UT relative distance and angles.IfNone while
bs_locis specified, then it is set tobs_locupon reshaping.
- show_topology(bs_index=0,batch_index=0)
Shows the network topology of the batch example with index
batch_index.The
bs_indexparameter specifies with respect to which BS theLoS/NLoS state of UTs is indicated.- Input:
bs_index (int, (default 0)) – BS index with respect to which the LoS/NLoS state of UTs isindicated
batch_index (int, (default 0)) – Batch example for which the topology is shown
- classsionna.phy.channel.tr38901.UMa(carrier_frequency,o2i_model,ut_array,bs_array,direction,enable_pathloss=True,enable_shadow_fading=True,always_generate_lsp=False,precision=None)[source]
Urban macrocell (UMa) channel model from 3GPP[TR38901] specification.
Setting up a UMa model requires configuring the network topology, i.e., theUTs and BSs locations, UTs velocities, etc. This is achieved using the
set_topology()method. Setting a differenttopology for each batch example is possible. The batch size used when setting up the network topologyis used for the link simulations.The following code snippet shows how to setup an UMa channel model assumingan OFDM waveform:
>>># UT and BS panel arrays>>>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)>>># Instantiating UMa channel model>>>channel_model=UMa(carrier_frequency=3.5e9,...o2i_model='low',...ut_array=ut_array,...bs_array=bs_array,...direction='uplink')>>># Setting up network topology>>># ut_loc: UTs locations>>># bs_loc: BSs locations>>># ut_orientations: UTs array orientations>>># bs_orientations: BSs array orientations>>># in_state: Indoor/outdoor states of UTs>>>channel_model.set_topology(ut_loc,...bs_loc,...ut_orientations,...bs_orientations,...ut_velocities,...in_state)>>># Instanting the OFDM channel>>>channel=OFDMChannel(channel_model=channel_model,...resource_grid=rg)
where
rgis an instance ofResourceGrid.- Parameters:
carrier_frequency (float) – Carrier frequency in Hertz
o2i_model ("low" |"high") – Outdoor-to-indoor loss model for UTs located indoor.Set this parameter to “low” to use the low-loss model, or to “high”to use the high-loss model.See section 7.4.3 of[TR38901] for details.
rx_array (
PanelArray) – Panel array used by the receivers. All receivers share the sameantenna array configuration.tx_array (
PanelArray) – Panel array used by the transmitters. All transmitters share thesame antenna array configuration.direction ("uplink" |"downlink") – Link direction
enable_pathloss (bool, (defaultTrue)) – IfTrue, apply pathloss. Otherwise don’t.
enable_shadow_fading (bool, (defaultTrue)) – IfTrue, apply shadow fading. Otherwise don’t.
always_generate_lsp (bool, (defaultFalse)) – IfTrue, new large scale parameters (LSPs) are generated for everynew generation of channel impulse responses. Otherwise, always reusethe same LSPs, except if the topology is changed.
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Input:
num_time_steps (int) – Number of time steps
sampling_frequency (float) – Sampling frequency [Hz]
- Output:
a ([batch size, num_rx, num_rx_ant, num_tx, num_tx_ant, num_paths, num_time_steps],tf.complex) – Path coefficients
tau ([batch size, num_rx, num_tx, num_paths],tf.float) – Path delays [s]
- propertycdtype
Type for complex floating point numbers
- Type:
tf.complex
- propertyprecision
Precision used for all compuations
- Type:
str, “single” | “double”
- propertyrdtype
Type for real floating point numbers
- Type:
tf.float
- propertyreturn_rays
Indicates whether the call method returns the generated rays
- Type:
bool
- set_topology(ut_loc=None,bs_loc=None,ut_orientations=None,bs_orientations=None,ut_velocities=None,in_state=None,los=None,bs_virtual_loc=None)
Set the network topology
It is possible to set up a different network topology for each batchexample. The batch size used when setting up the network topologyis used for the link simulations.
When calling this function, not specifying a parameter leads to thereuse of the previously given value. Not specifying a value that was notset at a former call rises an error.
- Input:
ut_loc (None (default) | [batch size,num_ut, 3],tf.float) – Locations of the UTs
bs_loc (None (default) | [batch size,num_bs, 3],tf.float) – Locations of BSs
ut_orientations (None (default) | [batch size,num_ut, 3],tf.float) – Orientations of the UTs arrays [radian]
bs_orientations (None (default) | [batch size,num_bs, 3],tf.float) – Orientations of the BSs arrays [radian]
ut_velocities (None (default) | [batch size,num_ut, 3],tf.float) – Velocity vectors of UTs
in_state (None (default) | [batch size,num_ut],tf.bool) – Indoor/outdoor state of UTs.True means indoor andFalsemeans outdoor.
los (None (default) |tf.bool) – If notNone, all UTs located outdoor areforced to be in LoS if
losis set toTrue, or in NLoSif it is set toFalse. If set toNone, the LoS/NLoS statesof UTs is set following 3GPP specification[TR38901].bs_virtual_loc (None (default) | [batch size, number of BSs, number of UTs, 3],tf.float) – Virtual locations of BSs for each UT [m].Used to compute BS-UT relative distance and angles.IfNone while
bs_locis specified, then it is set tobs_locupon reshaping.
- show_topology(bs_index=0,batch_index=0)
Shows the network topology of the batch example with index
batch_index.The
bs_indexparameter specifies with respect to which BS theLoS/NLoS state of UTs is indicated.- Input:
bs_index (int, (default 0)) – BS index with respect to which the LoS/NLoS state of UTs isindicated
batch_index (int, (default 0)) – Batch example for which the topology is shown
- classsionna.phy.channel.tr38901.RMa(carrier_frequency,ut_array,bs_array,direction,enable_pathloss=True,enable_shadow_fading=True,average_street_width=20.0,average_building_height=5.0,always_generate_lsp=False,precision=None)[source]
Rural macrocell (RMa) channel model from 3GPP[TR38901] specification
Setting up a RMa model requires configuring the network topology, i.e., theUTs and BSs locations, UTs velocities, etc. This is achieved using the
set_topology()method. Setting a differenttopology for each batch example is possible. The batch size used when setting up the network topologyis used for the link simulations.The following code snippet shows how to setup an RMa channel model assumingan OFDM waveform:
>>># UT and BS panel arrays>>>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)>>># Instantiating RMa channel model>>>channel_model=RMa(carrier_frequency=3.5e9,...ut_array=ut_array,...bs_array=bs_array,...direction='uplink')>>># Setting up network topology>>># ut_loc: UTs locations>>># bs_loc: BSs locations>>># ut_orientations: UTs array orientations>>># bs_orientations: BSs array orientations>>># in_state: Indoor/outdoor states of UTs>>>channel_model.set_topology(ut_loc,...bs_loc,...ut_orientations,...bs_orientations,...ut_velocities,...in_state)>>># Instanting the OFDM channel>>>channel=OFDMChannel(channel_model=channel_model,...resource_grid=rg)
where
rgis an instance ofResourceGrid.- Parameters:
carrier_frequency (float) – Carrier frequency [Hz]
rx_array (
PanelArray) – Panel array used by the receivers. All receivers share the sameantenna array configuration.tx_array (
PanelArray) – Panel array used by the transmitters. All transmitters share thesame antenna array configuration.direction ("uplink" |"downlink") – Link direction
enable_pathloss (bool, (defaultTrue)) – IfTrue, apply pathloss. Otherwise don’t.
enable_shadow_fading (bool, (defaultTrue)) – IfTrue, apply shadow fading. Otherwise don’t.
average_street_width (float, (default 20.0)) – Average street width [m]
average_building_height (float, (default 5.0)) – Average building height [m]
always_generate_lsp (bool, (defaultFalse)) – IfTrue, new large scale parameters (LSPs) are generated for everynew generation of channel impulse responses. Otherwise, always reusethe same LSPs, except if the topology is changed.
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Input:
num_time_steps (int) – Number of time steps
sampling_frequency (float) – Sampling frequency [Hz]
- Output:
a ([batch size, num_rx, num_rx_ant, num_tx, num_tx_ant, num_paths, num_time_steps],tf.complex) – Path coefficients
tau ([batch size, num_rx, num_tx, num_paths],tf.float) – Path delays [s]
- propertycdtype
Type for complex floating point numbers
- Type:
tf.complex
- propertyprecision
Precision used for all compuations
- Type:
str, “single” | “double”
- propertyrdtype
Type for real floating point numbers
- Type:
tf.float
- propertyreturn_rays
Indicates whether the call method returns the generated rays
- Type:
bool
- set_topology(ut_loc=None,bs_loc=None,ut_orientations=None,bs_orientations=None,ut_velocities=None,in_state=None,los=None,bs_virtual_loc=None)
Set the network topology
It is possible to set up a different network topology for each batchexample. The batch size used when setting up the network topologyis used for the link simulations.
When calling this function, not specifying a parameter leads to thereuse of the previously given value. Not specifying a value that was notset at a former call rises an error.
- Input:
ut_loc (None (default) | [batch size,num_ut, 3],tf.float) – Locations of the UTs
bs_loc (None (default) | [batch size,num_bs, 3],tf.float) – Locations of BSs
ut_orientations (None (default) | [batch size,num_ut, 3],tf.float) – Orientations of the UTs arrays [radian]
bs_orientations (None (default) | [batch size,num_bs, 3],tf.float) – Orientations of the BSs arrays [radian]
ut_velocities (None (default) | [batch size,num_ut, 3],tf.float) – Velocity vectors of UTs
in_state (None (default) | [batch size,num_ut],tf.bool) – Indoor/outdoor state of UTs.True means indoor andFalsemeans outdoor.
los (None (default) |tf.bool) – If notNone, all UTs located outdoor areforced to be in LoS if
losis set toTrue, or in NLoSif it is set toFalse. If set toNone, the LoS/NLoS statesof UTs is set following 3GPP specification[TR38901].bs_virtual_loc (None (default) | [batch size, number of BSs, number of UTs, 3],tf.float) – Virtual locations of BSs for each UT [m].Used to compute BS-UT relative distance and angles.IfNone while
bs_locis specified, then it is set tobs_locupon reshaping.
- show_topology(bs_index=0,batch_index=0)
Shows the network topology of the batch example with index
batch_index.The
bs_indexparameter specifies with respect to which BS theLoS/NLoS state of UTs is indicated.- Input:
bs_index (int, (default 0)) – BS index with respect to which the LoS/NLoS state of UTs isindicated
batch_index (int, (default 0)) – Batch example for which the topology is shown
External datasets
- classsionna.phy.channel.CIRDataset(cir_generator,batch_size,num_rx,num_rx_ant,num_tx,num_tx_ant,num_paths,num_time_steps,precision=None,**kwargs)[source]
Creates a channel model from a dataset that can be used with classes such as
TimeChannelandOFDMChannel.The dataset is defined by agenerator.The batch size is configured when instantiating the dataset or through the
batch_sizeproperty.The number of time steps (num_time_steps) and sampling frequency (sampling_frequency) can only be set when instantiating the dataset.The specified values must be in accordance with the data.Example
The following code snippet shows how to use this class as a channel model.
>>>my_generator=MyGenerator(...)>>>channel_model=sionna.phy.channel.CIRDataset(my_generator,...batch_size,...num_rx,...num_rx_ant,...num_tx,...num_tx_ant,...num_paths,...num_time_steps+l_tot-1)>>>channel=sionna.phy.channel.TimeChannel(channel_model,bandwidth,num_time_steps)
where
MyGeneratoris a generator>>>classMyGenerator:......def__call__(self):.........yielda,tau
that returns complex-valued path coefficients
awith shape[num_rx, num_rx_ant, num_tx, num_tx_ant, num_paths, num_time_steps]and real-valued path delaystau(in second)[num_rx, num_tx, num_paths].- Parameters:
cir_generator – Generator that returns channel impulse responses
(a,tau)whereais the tensor of channel coefficients of shape[num_rx, num_rx_ant, num_tx, num_tx_ant, num_paths, num_time_steps]and dtypetf.complex, andtauthe tensor of path delaysof shape[num_rx, num_tx, num_paths] and dtypedtype.real_dtype.batch_size (int) – Batch size
num_rx (int) – Number of receivers (\(N_R\))
num_rx_ant (int) – Number of antennas per receiver (\(N_{RA}\))
num_tx (int) – Number of transmitters (\(N_T\))
num_tx_ant (int) – Number of antennas per transmitter (\(N_{TA}\))
num_paths (int) – Number of paths (\(M\))
num_time_steps (int) – Number of time steps
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Output:
a ([batch size, num_rx, num_rx_ant, num_tx, num_tx_ant, num_paths, num_time_steps],tf.complex) – Path coefficients
tau ([batch size, num_rx, num_tx, num_paths],tf.float) – Path delays [s]
- propertybatch_size
Get/set batch size
- Type:
int
- propertycdtype
Type for complex floating point numbers
- Type:
tf.complex
- propertyprecision
Precision used for all compuations
- Type:
str, “single” | “double”
- propertyrdtype
Type for real floating point numbers
- Type:
tf.float
Utility functions
- sionna.phy.channel.subcarrier_frequencies(num_subcarriers,subcarrier_spacing,precision=None)[source]
Compute the baseband frequencies of
num_subcarriersubcarriers spaced bysubcarrier_spacing, i.e.,>>># If num_subcarrier is even:>>>frequencies=[-num_subcarrier/2,...,0,...,num_subcarrier/2-1]*subcarrier_spacing>>>>>># If num_subcarrier is odd:>>>frequencies=[-(num_subcarrier-1)/2,...,0,...,(num_subcarrier-1)/2]*subcarrier_spacing
- Input:
num_subcarriers (int) – Number of subcarriers
subcarrier_spacing (float) – Subcarrier spacing [Hz]
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Output:
frequencies ([
num_subcarrier],tf.float) – Baseband frequencies of subcarriers
- sionna.phy.channel.time_lag_discrete_time_channel(bandwidth,maximum_delay_spread=3e-06)[source]
Compute the smallest and largest time-lag for the descrete complex basebandchannel, i.e.,\(L_{\text{min}}\) and\(L_{\text{max}}\).
The smallest time-lag (\(L_{\text{min}}\)) returned is always -6, as this valuewas found small enough for all models included in Sionna.
The largest time-lag (\(L_{\text{max}}\)) is computed from the
bandwidthandmaximum_delay_spreadas follows:\[L_{\text{max}} = \lceil W \tau_{\text{max}} \rceil + 6\]where\(L_{\text{max}}\) is the largest time-lag,\(W\) the
bandwidth,and\(\tau_{\text{max}}\) themaximum_delay_spread.The default value for the
maximum_delay_spreadis 3us, which was foundto be large enough to include most significant paths with all channel modelsincluded in Sionna assuming a nominal delay spread of 100ns.Note
The values of\(L_{\text{min}}\) and\(L_{\text{max}}\) computedby this function are only recommended values.\(L_{\text{min}}\) and\(L_{\text{max}}\) should be set according tothe considered channel model. For OFDM systems, one also needs to be carefulthat the effective length of the complex baseband channel is not larger thanthe cyclic prefix length.
- Input:
bandwidth (float) – Bandwith (\(W\)) [Hz]
maximum_delay_spread (float, (default 3e-6)) – Maximum delay spread [s]
- Output:
l_min (int) – Smallest time-lag (\(L_{\text{min}}\)) for the descrete complex basebandchannel. Set to -6, , as this value was found small enough for all modelsincluded in Sionna.
l_max (int) – Largest time-lag (\(L_{\text{max}}\)) for the descrete complex basebandchannel
- sionna.phy.channel.deg_2_rad(x)[source]
Convert degree to radian
- Input:
x (Tensor,tf.float) – Angles in degree
- Output:
y (Tensor,tf.float) – Angles
xconverted to radian
- sionna.phy.channel.rad_2_deg(x)[source]
Convert radian to degree
- Input:
x (Tensor,tf.float) – Angles in radian
- Output:
y (Tensor,tf.float) – Angles
xconverted to degree
- sionna.phy.channel.wrap_angle_0_360(angle)[source]
Wrap
angleto (0,360)- Input:
angle (Tensor,tf.float) – Input to wrap
- Output:
y (Tensor,tf.float) –
anglewrapped to (0,360)
- sionna.phy.channel.drop_uts_in_sector(batch_size,num_ut,min_bs_ut_dist,isd,bs_height=0.0,ut_height=0.0,precision=None)[source]
Sample UT locations uniformly at random within a sector
The sector from which UTs are sampled is shown in the following figure.The BS is assumed to be located at the origin (0,0) of the coordinatesystem.

- Input:
batch_size (int) – Batch size
num_ut (int) – Number of UTs to sample per batch example
min_bs_ut_dist (tf.float) – Minimum BS-UT distance [m]
isd (tf.float) – Inter-site distance, i.e., the distance between two adjacent BSs [m]
bs_height (tf.float, (default 0)) – BS height, i.e., distance between the BS and the X-Y plane [m]
ut_height (tf.float) – UT height, i.e., distance between the UT and the X-Y plane [m]
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Output:
ut_loc ([batch_size, num_ut, 2],tf.float) – UT locations in the X-Y plane
- sionna.phy.channel.relocate_uts(ut_loc,sector_id,cell_loc)[source]
Relocate the UTs by rotating them into the sector with index
sector_idand transposing them to the cell centered oncell_locsector_idgives the index of the sector to which the UTs arerotated to. The picture below shows how the three sectors of a cell areindexed.
Fig. 14Indexing of sectors
If
sector_idis a scalar, then all UTs are relocated to the samesector indexed bysector_id.Ifsector_idis a tensor, it should be broadcastable with[batch_size,num_ut], and give the sector in which each UT orbatch example is relocated to.When calling the function,
ut_locgives the locations of the UTs torelocate, which are all assumed to be in sector with index 0, and in thecell centered on the origin (0,0).- Input:
ut_loc ([batch_size, num_ut, 2],tf.float) – UTs locations in the X-Y plan
sector_id (Tensor broadcastable with [batch_size, num_ut],int) – Indexes of the sector to which to relocate the UTs
cell_loc (Tensor broadcastable with [batch_size, num_ut],tf.float) – Center of the cell to which to transpose the UTs
- Output:
ut_loc ([batch_size, num_ut, 2],tf.float) – Relocated UTs locations in the X-Y plan
- sionna.phy.channel.set_3gpp_scenario_parameters(scenario,min_bs_ut_dist=None,isd=None,bs_height=None,min_ut_height=None,max_ut_height=None,indoor_probability=None,min_ut_velocity=None,max_ut_velocity=None,precision=None)[source]
Set valid parameters for a specified 3GPP system level
scenario(RMa, UMi, or UMa)If a parameter is given, then it is returned. If it is set toNone,then a parameter valid according to the chosen scenario is returned(see[TR38901]).
- Input:
scenario (“uma” | “umi” | “rma” | “uma-calibration” | “umi-calibration”) – System level model scenario
min_bs_ut_dist (None (default) |tf.float) – Minimum BS-UT distance [m]
isd (None (default) |tf.float) – Inter-site distance [m]
bs_height (None (default) |tf.float) – BS elevation [m]
min_ut_height (None (default) |tf.float) – Minimum UT elevation [m]
max_ut_height (None (default) |tf.float) – Maximum UT elevation [m]
indoor_probability (None (default) |tf.float) – Probability of a UT to be indoor
min_ut_velocity (None (default) |tf.float) – Minimum UT velocity [m/s]
max_ut_velocity (None (default) |tf.float) – Maximim UT velocity [m/s]
precision (str,None (default) | ‘single’ | ‘double’) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Output:
min_bs_ut_dist (tf.float) – Minimum BS-UT distance [m]
isd (tf.float) – Inter-site distance [m]
bs_height (tf.float) – BS elevation [m]
min_ut_height (tf.float) – Minimum UT elevation [m]
max_ut_height (tf.float) – Maximum UT elevation [m]
indoor_probability (tf.float) – Probability of a UT to be indoor
min_ut_velocity (tf.float) – Minimum UT velocity [m/s]
max_ut_velocity (tf.float) – Maximim UT velocity [m/s]
- sionna.phy.channel.gen_single_sector_topology(batch_size,num_ut,scenario,min_bs_ut_dist=None,isd=None,bs_height=None,min_ut_height=None,max_ut_height=None,indoor_probability=None,min_ut_velocity=None,max_ut_velocity=None,precision=None)[source]
Generate a batch of topologies consisting of a single BS located at theorigin and
num_utUTs randomly and uniformly dropped in a cell sectorThe following picture shows the sector from which UTs are sampled.

UT velocity and orientation are drawn uniformly at random, whereas the BS pointstowards the center of the sector it serves.
The drop configuration can be controlled through the optional parameters.Parameters set toNone are set to valid values according to the chosen
scenario(see[TR38901]).The returned batch of topologies can be used as-is with the
set_topology()method of the system level models, i.e.UMi,UMa,andRMa.Example
>>># Create antenna arrays>>>bs_array=PanelArray(num_rows_per_panel=4,...num_cols_per_panel=4,...polarization='dual',...polarization_type='VH',...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)>>># Create channel model>>>channel_model=UMi(carrier_frequency=3.5e9,...o2i_model='low',...ut_array=ut_array,...bs_array=bs_array,...direction='uplink')>>># Generate the topology>>>topology=gen_single_sector_topology(batch_size=100,...num_ut=4,...scenario='umi')>>># Set the topology>>>ut_loc,bs_loc,ut_orientations,bs_orientations,ut_velocities,in_state=topology>>>channel_model.set_topology(ut_loc,...bs_loc,...ut_orientations,...bs_orientations,...ut_velocities,...in_state)>>>channel_model.show_topology()

- Input:
batch_size (int) – Batch size
num_ut (int) – Number of UTs to sample per batch example
scenario (“uma” | “umi” | “rma” | “uma-calibration” | “umi-calibration”) – System level model scenario
min_bs_ut_dist (None (default) |tf.float) – Minimum BS-UT distance [m]
isd (None (default) |tf.float) – Inter-site distance [m]
bs_height (None (default) |tf.float) – BS elevation [m]
min_ut_height (None (default) |tf.float) – Minimum UT elevation [m]
max_ut_height (None (default) |tf.float) – Maximum UT elevation [m]
indoor_probability (None (default) |tf.float) – Probability of a UT to be indoor
min_ut_velocity (None (default) |tf.float) – Minimum UT velocity [m/s]
max_ut_velocity (None (default) |tf.float) – Maximim UT velocity [m/s]
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Output:
ut_loc ([batch_size, num_ut, 3],tf.float) – UTs locations
bs_loc ([batch_size, 1, 3],tf.float) – BS location. Set to (0,0,0) for all batch examples.
ut_orientations ([batch_size, num_ut, 3],tf.float) – UTs orientations [radian]
bs_orientations ([batch_size, 1, 3],tf.float) – BS orientations [radian]. Oriented towards the center of the sector.
ut_velocities ([batch_size, num_ut, 3],tf.float) – UTs velocities [m/s]
in_state ([batch_size, num_ut],tf.float) – Indoor/outdoor state of UTs.True means indoor,False meansoutdoor.
- sionna.phy.channel.gen_single_sector_topology_interferers(batch_size,num_ut,num_interferer,scenario,min_bs_ut_dist=None,isd=None,bs_height=None,min_ut_height=None,max_ut_height=None,indoor_probability=None,min_ut_velocity=None,max_ut_velocity=None,precision=None)[source]
Generate a batch of topologies consisting of a single BS located at theorigin,
num_utUTs randomly and uniformly dropped in a cell sector, andnum_interfererinterfering UTs randomly dropped in the adjacent cellsThe following picture shows how UTs are sampled

UT velocity and orientation are drawn uniformly at random, whereas the BS pointstowards the center of the sector it serves.
The drop configuration can be controlled through the optional parameters.Parameters set toNone are set to valid values according to the chosen
scenario(see[TR38901]).The returned batch of topologies can be used as-is with the
set_topology()method of the system level models, i.e.UMi,UMa,andRMa.In the returned
ut_loc,ut_orientations,ut_velocities, andin_statetensors, the firstnum_utitems along the axis with index1 correspond to the served UTs, whereas the remainingnum_interfereritems correspond to the interfering UTs.Example
>>># Create antenna arrays>>>bs_array=PanelArray(num_rows_per_panel=4,...num_cols_per_panel=4,...polarization='dual',...polarization_type='VH',...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)>>># Create channel model>>>channel_model=UMi(carrier_frequency=3.5e9,...o2i_model='low',...ut_array=ut_array,...bs_array=bs_array,...direction='uplink')>>># Generate the topology>>>topology=gen_single_sector_topology_interferers(batch_size=100,...num_ut=4,...num_interferer=4,...scenario='umi')>>># Set the topology>>>ut_loc,bs_loc,ut_orientations,bs_orientations,ut_velocities,in_state=topology>>>channel_model.set_topology(ut_loc,...bs_loc,...ut_orientations,...bs_orientations,...ut_velocities,...in_state)>>>channel_model.show_topology()

- Input:
batch_size (int) – Batch size
num_ut (int) – Number of UTs to sample per batch example
num_interferer (int) – Number of interfeering UTs per batch example
scenario (“uma” | “umi” | “rma” | “uma-calibration” | “umi-calibration”) – System level model scenario
min_bs_ut_dist (None (default) |tf.float) – Minimum BS-UT distance [m]
isd (None (default) |tf.float) – Inter-site distance [m]
bs_height (None (default) |tf.float) – BS elevation [m]
min_ut_height (None (default) |tf.float) – Minimum UT elevation [m]
max_ut_height (None (default) |tf.float) – Maximum UT elevation [m]
indoor_probability (None (default) |tf.float) – Probability of a UT to be indoor
min_ut_velocity (None (default) |tf.float) – Minimum UT velocity [m/s]
max_ut_velocity (None (default) |tf.float) – Maximim UT velocity [m/s]
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Output:
ut_loc ([batch_size, num_ut, 3],tf.float) – UTs locations. The first
num_utitems along the axis with index1 correspond to the served UTs, whereas the remainingnum_interfereritems correspond to the interfeering UTs.bs_loc ([batch_size, 1, 3],tf.float) – BS location. Set to (0,0,0) for all batch examples.
ut_orientations ([batch_size, num_ut, 3],tf.float) – UTs orientations [radian]. The first
num_utitems along theaxis with index 1 correspond to the served UTs, whereas theremainingnum_interfereritems correspond to the interfeeringUTs.bs_orientations ([batch_size, 1, 3],tf.float) – BS orientation [radian]. Oriented towards the center of the sector.
ut_velocities ([batch_size, num_ut, 3],tf.float) – UTs velocities [m/s]. The first
num_utitems along the axiswith index 1 correspond to the served UTs, whereas the remainingnum_interfereritems correspond to the interfeering UTs.in_state ([batch_size, num_ut],tf.float) – Indoor/outdoor state of UTs.True means indoor,False meansoutdoor. The first
num_utitems along the axis withindex 1 correspond to the served UTs, whereas the remainingnum_interfereritems correspond to the interfering UTs.
- sionna.phy.channel.exp_corr_mat(a,n,precision=None)[source]
Generates exponential correlation matrices
This function computes for every element\(a\) of a complex-valuedtensor\(\mathbf{a}\) the corresponding\(n\times n\) exponentialcorrelation matrix\(\mathbf{R}(a,n)\), defined as (Eq. 1,[MAL2018]):
\[\begin{split}\mathbf{R}(a,n)_{i,j} = \begin{cases} 1 & \text{if } i=j\\ a^{i-j} & \text{if } i>j\\ (a^\star)^{j-i} & \text{if } j<i, j=1,\dots,n\\ \end{cases}\end{split}\]where\(|a|<1\) and\(\mathbf{R}\in\mathbb{C}^{n\times n}\).
- Input:
a ([n_0, …, n_k],tf.complex) – Parameters\(a\) for the exponential correlation matrices
n (int) – Number of dimensions of the output correlation matrices
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Output:
R ([n_0, …, n_k, n, n],tf.complex) – Correlation matrices
- sionna.phy.channel.one_ring_corr_mat(phi_deg,num_ant,d_h=0.5,sigma_phi_deg=15,precision=None)[source]
Generates covariance matrices from the one-ring model
This function generates approximate covariance matrices for theso-calledone-ring model (Eq. 2.24)[BHS2017]. A uniformlinear array (ULA) with uniform antenna spacing is assumed. The elementsof the covariance matrices are computed as:
\[\mathbf{R}_{\ell,m} = \exp\left( j2\pi d_\text{H} (\ell -m)\sin(\varphi) \right) \exp\left( -\frac{\sigma_\varphi^2}{2} \left( 2\pi d_\text{H}(\ell -m)\cos(\varphi) \right)^2 \right)\]for\(\ell,m = 1,\dots, M\), where\(M\) is the number of antennas,\(\varphi\) is the angle of arrival,\(d_\text{H}\) is the antennaspacing in multiples of the wavelength,and\(\sigma^2_\varphi\) is the angular standard deviation.
- Input:
phi_deg ([n_0, …, n_k],tf.float) – Azimuth angles (deg) of arrival
num_ant (int) – Number of antennas
d_h (float, (default 0.5)) – Antenna spacing in multiples of the wavelength
sigma_phi_deg (float, (default 15)) – Angular standard deviation (deg). Values greaterthan 15 should not be used as the approximation becomes invalid.
precision (None (default) | “single” | “double”) – Precision used for internal calculations and outputs.If set toNone,
precisionis used.
- Output:
R ([n_0, …, n_k, num_ant, nun_ant],tf.complex) – Covariance matrices
- References:
- [TR38901](1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21)
3GPP TR 38.901,“Study on channel model for frequencies from 0.5 to 100 GHz”, Release 16.1
[TS38141-1]3GPP TS 38.141-1“Base Station (BS) conformance testing Part 1: Conducted conformance testing”,Release 17
[Tse]D. Tse and P. Viswanath, “Fundamentals of wireless communication“,Cambridge University Press, 2005.
[SoS]C. Xiao, Y. R. Zheng and N. C. Beaulieu, “Novel Sum-of-Sinusoids Simulation Models for Rayleigh and Rician Fading Channels,” in IEEE Transactions on Wireless Communications, vol. 5, no. 12, pp. 3667-3679, December 2006, doi: 10.1109/TWC.2006.256990.
[MAL2018]R. K. Mallik,“The exponential correlation matrix: Eigen-analysis andapplications”, IEEE Trans. Wireless Commun., vol. 17, no. 7,pp. 4690-4705, Jul. 2018.
[BHS2017]E. Björnson, J. Hoydis, L. Sanguinetti (2017),“Massive MIMO Networks: Spectral, Energy, and Hardware Efficiency”,Foundations and Trends in Signal Processing:Vol. 11, No. 3-4, pp 154–655.