TimeChannel#
- class sionna.phy.channel.TimeChannel(channel_model, bandwidth: float, num_time_samples: int, maximum_delay_spread: float = 3e-06, l_min: int | None = None, l_max: int | None = None, normalize_channel: bool = False, return_channel: bool = False, precision: str | None = None, device: str | None = None, **kwargs)[source]#
Bases:
sionna.phy.block.BlockGenerates 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 channel inputs \(x_0,\cdots,x_{N_B}\), where \(N_B\) isnum_time_samples, this layer 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\) 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 \(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 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\) is thebandwidth.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 – Used channel model
bandwidth (float) – Bandwidth (\(W\)) [Hz]
num_time_samples (int) – Number of time samples forming the channel input (\(N_B\))
maximum_delay_spread (float) – Maximum delay spread [s]. Used to compute the default value of
l_maxifl_maxis set to None. If a value is given forl_max, this parameter is not used. Defaults to 3e-6, which was found to be large enough to include most significant paths with all channel models included in Sionna assuming a nominal delay spread of 100ns.l_min (int | None) – Smallest time-lag for the discrete complex baseband channel (\(L_{\text{min}}\)). If set to None, defaults to the value given by
time_lag_discrete_time_channel().l_max (int | None) – Largest time-lag for the discrete complex baseband channel (\(L_{\text{max}}\)). If set to None, it is computed from
bandwidthandmaximum_delay_spreadusingtime_lag_discrete_time_channel(). If it is not set to None, then the parametermaximum_delay_spreadis not used.normalize_channel (bool) – If set to True, the channel is normalized over the block size to ensure unit average energy per time step. Defaults to False.
return_channel (bool) – If set to True, the channel response is returned in addition to the channel output. Defaults to False.
precision (str | None) – Precision used for internal calculations and outputs. If set to None,
precisionis used.device (str | None) – Device for computation. If None,
deviceis used.
- Inputs:
x – [batch size, num_tx, num_tx_ant, num_time_samples], torch.complex. Channel inputs.
no – None (default) | torch.Tensor, torch.float. Tensor whose shape can be broadcast to the shape of the channel 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 to the shape of the channel outputs. This allows, e.g., adding noise of different variance to each example in a batch. Ifnohas a lower rank than the channel outputs, thennowill be broadcast to the shape of the channel outputs by adding dummy dimensions after the last axis.
- Outputs:
y – [batch size, num_rx, num_rx_ant, num_time_samples + l_max - l_min], torch.complex. Channel outputs. 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.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], torch.complex. (Optional) Channel responses. Returned only if
return_channelis set to True. For each batch example,num_time_samples+l_max-l_mintime steps of the channel realizations are generated to filter the channel input.
Examples
import torch from sionna.phy.channel import RayleighBlockFading, TimeChannel channel_model = RayleighBlockFading(num_rx=1, num_rx_ant=2, num_tx=1, num_tx_ant=4) channel = TimeChannel( channel_model, bandwidth=1e6, num_time_samples=100, l_min=-6, l_max=20, return_channel=True ) x = torch.randn(32, 1, 4, 100, dtype=torch.complex64) y, h_time = channel(x) print(y.shape) # torch.Size([32, 1, 2, 126]) print(h_time.shape) # torch.Size([32, 1, 2, 1, 4, 126, 27])
Attributes