GenerateTimeChannel#
- class sionna.phy.channel.GenerateTimeChannel(channel_model, bandwidth: float, num_time_samples: int, l_min: int, l_max: int, normalize_channel: bool = False, precision: str | None = None, device: str | None = None, **kwargs)[source]#
Bases:
sionna.phy.object.ObjectGenerate channel responses in the time domain
For each batch example,
num_time_samples+l_max-l_mintime steps of a channel 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 layer 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.- Parameters:
channel_model – Channel model to be used
bandwidth (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) – If set to True, the channel is normalized over the block size to ensure unit average energy per time step. 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:
batch_size – None (default) | int. Batch size. Defaults to None for channel models that do not require this parameter.
- Outputs:
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. Channel responses. For each batch example,
num_time_samples+l_max-l_mintime steps of a channel realization are generated by this layer. These can be used to filter a channel input of lengthnum_time_samplesusing theApplyTimeChannellayer.
Examples
import torch from sionna.phy.channel import RayleighBlockFading, GenerateTimeChannel channel_model = RayleighBlockFading(num_rx=1, num_rx_ant=2, num_tx=1, num_tx_ant=4) gen_channel = GenerateTimeChannel( channel_model, bandwidth=1e6, num_time_samples=100, l_min=-6, l_max=20 ) h_time = gen_channel(batch_size=32) print(h_time.shape) # torch.Size([32, 1, 2, 1, 4, 126, 27])
Attributes