BlackmanWindow#
- class sionna.phy.signal.BlackmanWindow(normalize: bool = False, precision: Literal['single', 'double'] | None = None, device: str | None = None, **kwargs)[source]#
Bases:
sionna.phy.signal.window.WindowBlock for defining a Blackman window function.
The window function is applied through element-wise multiplication.
The Blackman window is defined by
\[w_n = a_0 - a_1 \cos \left( \frac{2 \pi n}{N} \right) + a_2 \cos \left( \frac{4 \pi n}{N} \right), 0 \leq n \leq N-1\]where \(N\) is the window length, \(a_0 = \frac{7938}{18608}\), \(a_1 = \frac{9240}{18608}\), and \(a_2 = \frac{1430}{18608}\).
- 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,
precisionis used.device (str | None) – Device for computation. If None,
deviceis 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
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 BlackmanWindow window = BlackmanWindow() x = torch.randn(32, 64) y = window(x) print(y.shape) # torch.Size([32, 64])
Methods
- build(input_shape: tuple) None[source]#
Initialize the block based on the inputs’ shapes.
Subclasses can override this method to create tensors or sub-blocks whose sizes depend on the input shapes.
- Parameters:
*arg_shapes – Shapes of the positional arguments. Can be tuples (for tensors) or nested structures thereof (for lists/dicts of tensors).
**kwarg_shapes – Shapes of the keyword arguments. Can be tuples (for tensors) or nested structures thereof (for lists/dicts of tensors).
input_shape (tuple)