Upsampling#

class sionna.phy.signal.Upsampling(samples_per_symbol: int, axis: int = -1, precision: Literal['single', 'double'] | None = None, device: str | None = None, **kwargs)[source]#

Bases: sionna.phy.block.Block

Upsamples a tensor along a specified axis by inserting zeros between samples.

Parameters:
  • samples_per_symbol (int) – Upsampling factor. If samples_per_symbol is equal to n, then the upsampled axis will be n-times longer.

  • axis (int) – Dimension to be up-sampled. Must not be the first dimension. Defaults to -1.

  • precision (Literal['single', 'double'] | None) – Precision used for internal calculations and outputs. If set to None, precision is used.

  • device (str | None) – Device for computation. If None, device is used.

Inputs:

x – […, n, …], torch.float or torch.complex. Tensor to be upsampled. n is the size of the axis dimension.

Outputs:

y – […, n*samples_per_symbol, …], torch.float or torch.complex. Upsampled tensor.

Examples

import torch
from sionna.phy.signal import Upsampling

upsampler = Upsampling(samples_per_symbol=4)
x = torch.randn(32, 100)
y = upsampler(x)
print(y.shape)
# torch.Size([32, 400])

Attributes

property samples_per_symbol: int#

Upsampling factor

property axis: int#

Dimension to be upsampled