# tensorplay.signal.windows.blackman Source: https://www.tensorplay.cn/docs/generated/tensorplay.signal.windows.blackman.html ```python tensorplay.signal.windows.blackman(M: int, *, sym: bool = True, dtype: dtype | None = None, layout: Layout = tensorplay.strided, device: device | None = None, requires_grad: bool = False) → Tensor ``` Computes the Blackman window. The samples are $$w_n = 0.42 - 0.5 \cos \left( \frac{2 \pi n}{M - 1} \right) + 0.08 \cos \left( \frac{4 \pi n}{M - 1} \right)$$ The window is scaled so that its largest value is 1. The value 1 itself does not occur when M is even and sym is True. Parameters: M ([int](https://docs.python.org/3/builtins/functions.html#int)) – number of points of the returned window. Keyword Arguments: - sym ([bool](https://docs.python.org/3/builtins/functions.html#bool), optional) – if False, returns a periodic window, which is the usual choice for spectral analysis. If True, returns a symmetric window, which is the usual choice for filter design. Default: True. - dtype ([tensorplay.dtype](/docs/generated/tensorplay.DType.html#tensorplay.DType), optional) – the desired data type of the returned tensor. Default: if None, uses the global default (see [tensorplay.set_default_dtype()](/docs/generated/tensorplay.set_default_dtype.html#tensorplay.set_default_dtype)). - layout ([tensorplay.Layout](/docs/generated/tensorplay.Layout.html#tensorplay.Layout), optional) – the desired layout of the returned tensor. Default: tensorplay.strided. - device ([tensorplay.device](/docs/generated/tensorplay.Device.html#tensorplay.Device), optional) – the desired device of the returned tensor. Default: if None, uses the current default tensor device (see [tensorplay.set_default_device()](/docs/generated/tensorplay.set_default_device.html#tensorplay.set_default_device)). - requires_grad ([bool](https://docs.python.org/3/builtins/functions.html#bool), optional) – whether autograd should record operations on the returned tensor. Default: False. Examples: ``` >>> # Symmetric Blackman window. >>> tensorplay.signal.windows.blackman(5) tensor([-0., 0.34, 1., 0.34, -0.]) >>> # Periodic Blackman window. >>> tensorplay.signal.windows.blackman(5, sym=False) tensor([-0., 0.2008, 0.8492, 0.8492, 0.2008]) ```