torch.bartlett_window
torch.bartlett_window(window_length, periodic=True, *, dtype=None, layout=torch.strided, device=None, requires_grad=False) -> Tensor
Bartlett window function.
  w[n] = 1 - \left| \frac{2n}{N-1} - 1 \right| = \begin{cases}
  \frac{2n}{N - 1} & \text{if } 0 \leq n \leq \frac{N - 1}{2} \\
  2 - \frac{2n}{N - 1} & \text{if } \frac{N - 1}{2} < n < N \\
  \end{cases},

where N is the full window size.
The input "window_length" is a positive integer controlling the
   returned window size. "periodic" flag determines whether the
   returned window trims off the last duplicate value from the
   symmetric window and is ready to be used as a periodic window with
   functions like "torch.stft()". Therefore, if "periodic" is true,
   the N in above formula is in fact \text{window_length} + 1. Also,
   we always have "torch.bartlett_window(L, periodic=True)" equal to
   "torch.bartlett_window(L + 1, periodic=False)[:-1])".
Note: