CIRDataset#
- class sionna.phy.channel.CIRDataset(cir_generator: Callable[[], Iterator[Tuple[torch.Tensor, torch.Tensor]]], batch_size: int, num_rx: int, num_rx_ant: int, num_tx: int, num_tx_ant: int, num_paths: int, num_time_steps: int, precision: str | None = None, device: str | None = None, **kwargs)[source]#
Bases:
sionna.phy.channel.channel_model.ChannelModelCreates a channel model from a dataset that can be used with classes such as
TimeChannelandOFDMChannel. The dataset is defined by a generator.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.- Parameters:
cir_generator (Callable[[], Iterator[Tuple[torch.Tensor, torch.Tensor]]]) –
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 dtypetorch.complex, andtauthe tensor of path delays of shape[num_rx, num_tx, num_paths]and dtypetorch.float.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 (str | None) – Precision used for internal calculations and outputs. If set to None,
precisionis used.device (str | None) – Device for computation (e.g., ‘cpu’, ‘cuda:0’). If None,
deviceis used.
- Inputs:
batch_size – int. Batch size (ignored, uses the configured batch_size).
num_time_steps – int. Number of time steps (ignored, uses the configured num_time_steps).
sampling_frequency – float. Sampling frequency [Hz] (ignored).
- Outputs:
a – [batch size, num_rx, num_rx_ant, num_tx, num_tx_ant, num_paths, num_time_steps],
torch.complex. Path coefficients.tau – [batch size, num_rx, num_tx, num_paths],
torch.float. Path delays [s].
Examples
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>>> class MyGenerator: ... ... def __call__(self): ... ... ... yield a, tau
that returns torch.complex path coefficients
awith shape[num_rx, num_rx_ant, num_tx, num_tx_ant, num_paths, num_time_steps]and torch.float path delaystau(in second)[num_rx, num_tx, num_paths].Attributes