# tensorplay.signal.windows.gaussian Source: https://www.tensorplay.cn/docs/generated/tensorplay.signal.windows.gaussian.html ```python tensorplay.signal.windows.gaussian(M: int, *, std: float = 1.0, sym: bool = True, dtype: dtype | None = None, layout: Layout = tensorplay.strided, device: device | None = None, requires_grad: bool = False) → Tensor ``` Computes a window with a Gaussian waveform. The samples follow a Gaussian bump centered in the window: $$w_n = \exp{\left(-\left(\frac{n}{2\sigma}\right)^2\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: - std ([float](https://docs.python.org/3/builtins/functions.html#float), optional) – standard deviation of the Gaussian; it controls how narrow or wide the window is. Default: 1.0. - 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 Gaussian window of length 10 with std 1.0. >>> tensorplay.signal.windows.gaussian(10) tensor([0., 0.0022, 0.0439, 0.3247, 0.8825, 0.8825, 0.3247, 0.0439, 0.0022, 0.]) >>> # Periodic Gaussian window of length 10 with std 0.9. >>> tensorplay.signal.windows.gaussian(10, sym=False, std=0.9) tensor([0., 0.0001, 0.0039, 0.0847, 0.5394, 1., 0.5394, 0.0847, 0.0039, 0.0001]) ```