CustomWindow#
- class sionna.phy.signal.CustomWindow(coefficients: torch.Tensor | numpy.ndarray, normalize: bool = False, precision: Literal['single', 'double'] | None = None, device: str | None = None, **kwargs)[source]#
Bases:
sionna.phy.signal.window.WindowBlock for defining a custom window function.
The window function is applied through element-wise multiplication.
- Parameters:
coefficients (torch.Tensor | numpy.ndarray) – Window coefficients with shape [N]
normalize (bool) – If True, the window is normalized to have unit average power per coefficient. Defaults to False.
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.complex or torch.float. Input to which the window function is applied. The window function is applied along the last dimension. The length of the last dimension
Nmust be the same as thelengthof the window function.- Outputs:
y – […, N], torch.complex or torch.float. Output of the windowing operation.
Examples
import torch from sionna.phy.signal import CustomWindow coefficients = torch.hann_window(64) window = CustomWindow(coefficients) x = torch.randn(32, 64) y = window(x) print(y.shape) # torch.Size([32, 64])