Window#

class sionna.phy.signal.Window(normalize: bool = False, precision: Literal['single', 'double'] | None = None, device: str | None = None, **kwargs)[source]#

Bases: sionna.phy.block.Block

Abstract class defining a window function.

The window function is applied through element-wise multiplication.

The window function is real-valued. The dtype of the output is the same as the dtype of the input x to which the window function is applied. The window function and the input must have the same precision.

Parameters:
  • 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, precision is used.

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

Inputs:

x – […, N], torch.complex or torch.float. The input to which the window function is applied. The window function is applied along the last dimension. The length of the last dimension N must be the same as the length of the window function.

Outputs:

y – […, N], torch.complex or torch.float. Output of the windowing operation.

Examples

import torch
from sionna.phy.signal import HannWindow

window = HannWindow()
x = torch.randn(32, 64)
y = window(x)
print(y.shape)
# torch.Size([32, 64])

Attributes

property coefficients: torch.Tensor#

Raw window coefficients (before normalization)

property length: int#

Window length in number of samples

property normalize: bool#

If True, the window is normalized to have unit average power per coefficient

Methods

show(samples_per_symbol: int, domain: str = 'time', scale: str = 'lin') None[source]#

Plot the window in time or frequency domain.

For the computation of the Fourier transform, a minimum DFT size of 1024 is assumed which is obtained through zero padding of the window coefficients in the time domain.

Parameters:
  • samples_per_symbol (int) – Number of samples per symbol, i.e., the oversampling factor

  • domain (str) – Desired domain. Can be “time” or “frequency”. Defaults to “time”.

  • scale (str) – y-scale of the magnitude in the frequency domain. Can be “lin” (i.e., linear) or “db” (i.e., Decibel). Defaults to “lin”.