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.ChannelModel

Creates a channel model from a dataset that can be used with classes such as TimeChannel and OFDMChannel. The dataset is defined by a generator.

The batch size is configured when instantiating the dataset or through the batch_size property. 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) where a is the tensor of channel coefficients of shape [num_rx, num_rx_ant, num_tx, num_tx_ant, num_paths, num_time_steps] and dtype torch.complex, and tau the tensor of path delays of shape [num_rx, num_tx, num_paths] and dtype torch.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, precision is used.

  • device (str | None) – Device for computation (e.g., ‘cpu’, ‘cuda:0’). If None, device is used.

Inputs:
  • batch_sizeint. Batch size (ignored, uses the configured batch_size).

  • num_time_stepsint. Number of time steps (ignored, uses the configured num_time_steps).

  • sampling_frequencyfloat. 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 MyGenerator is a generator

>>> class MyGenerator:
...
...     def __call__(self):
...         ...
...         yield a, tau

that returns torch.complex path coefficients a with shape [num_rx, num_rx_ant, num_tx, num_tx_ant, num_paths, num_time_steps] and torch.float path delays tau (in second) [num_rx, num_tx, num_paths].

Attributes

property batch_size: int#

Get/set batch size

property num_time_steps: int#

Number of time steps

property num_rx: int#

Number of receivers

property num_rx_ant: int#

Number of antennas per receiver

property num_tx: int#

Number of transmitters

property num_tx_ant: int#

Number of antennas per transmitter

property num_paths: int#

Number of paths