torch.signal.windows.bartlett
torch.signal.windows.bartlett(M, *, sym=True, dtype=None, layout=torch.strided, device=None, requires_grad=False)
Computes the Bartlett window.
The Bartlett window is defined as follows:
  w_n = 1 - \left| \frac{2n}{M - 1} - 1 \right| = \begin{cases}
  \frac{2n}{M - 1} & \text{if } 0 \leq n \leq \frac{M - 1}{2} \\
  2 - \frac{2n}{M - 1} & \text{if } \frac{M - 1}{2} < n < M \\
  \end{cases}

The window is normalized to 1 (maximum value is 1). However, the 1
   doesn't appear if "M" is even and "sym" is True.
Parameters:
      M (int) -- the length of the window. In other words, the
      number of points of the returned window.
Keyword Arguments:
      * sym (bool, optional) -- If False, returns a
        periodic window suitable for use in spectral analysis. If
        True, returns a symmetric window suitable for use in filter
        design. Default: True.