ApplyOFDMChannel#
- class sionna.phy.channel.ApplyOFDMChannel(precision: Literal['single', 'double'] | None = None, device: str | None = None, **kwargs)[source]#
Bases:
sionna.phy.block.BlockApply single-tap channel frequency responses to channel inputs
For each OFDM symbol \(s\) and subcarrier \(n\), the single-tap channel is 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 antenna of each receiver and by summing over all the antennas of all transmitters.
- Parameters:
- Inputs:
x – [batch size, num_tx, num_tx_ant, num_ofdm_symbols, fft_size], torch.complex. Channel inputs.
h_freq – [batch size, num_rx, num_rx_ant, num_tx, num_tx_ant, num_ofdm_symbols, fft_size], torch.complex. Channel frequency responses.
no – None (default) | Tensor, torch.float. Tensor whose shape can be broadcast to the shape of the channel outputs: [batch size, num_rx, num_rx_ant, num_ofdm_symbols, fft_size]. 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_ofdm_symbols, fft_size], torch.complex. Channel outputs.
Examples
import torch from sionna.phy.channel import ApplyOFDMChannel apply_ch = ApplyOFDMChannel() # Create dummy inputs batch_size, num_tx, num_tx_ant = 16, 2, 4 num_rx, num_rx_ant = 1, 8 num_ofdm_symbols, fft_size = 14, 64 x = torch.randn(batch_size, num_tx, num_tx_ant, num_ofdm_symbols, fft_size, dtype=torch.complex64) h_freq = torch.randn(batch_size, num_rx, num_rx_ant, num_tx, num_tx_ant, num_ofdm_symbols, fft_size, dtype=torch.complex64) y = apply_ch(x, h_freq) print(y.shape) # torch.Size([16, 1, 8, 14, 64])