Downsampling#

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

Bases: sionna.phy.block.Block

Downsamples a tensor along a specified axis by retaining one out of samples_per_symbol elements.

Parameters:
  • samples_per_symbol (int) – Downsampling factor. If samples_per_symbol is equal to n, then the downsampled axis will be n-times shorter.

  • offset (int) – Index of the first element to be retained. Defaults to 0.

  • num_symbols (int | None) – Total number of symbols to be retained after downsampling. If None, all available symbols are retained. Defaults to None.

  • axis (int) – Dimension to be downsampled. 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 downsampled. n is the size of the axis dimension.

Outputs:

y – […, k, …], torch.float or torch.complex. Downsampled tensor, where k is min((n-offset)//samples_per_symbol, num_symbols).

Examples

import torch
from sionna.phy.signal import Downsampling

downsampler = Downsampling(samples_per_symbol=4, offset=2)
x = torch.randn(32, 400)
y = downsampler(x)
print(y.shape)
# torch.Size([32, 100])

Attributes

property samples_per_symbol: int#

Downsampling factor

property offset: int#

Index of the first element to be retained

property num_symbols: int | None#

Total number of symbols to be retained after downsampling

property axis: int#

Dimension to be downsampled