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.BlockDownsamples a tensor along a specified axis by retaining one out of
samples_per_symbolelements.- Parameters:
samples_per_symbol (int) – Downsampling factor. If
samples_per_symbolis 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,
precisionis used.device (str | None) – Device for computation. If None,
deviceis 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
kis 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