torch_bartlett_window | R Documentation |
Bartlett_window
torch_bartlett_window(
window_length,
periodic = TRUE,
dtype = NULL,
layout = NULL,
device = NULL,
requires_grad = FALSE
)
window_length |
(int) the size of returned window |
periodic |
(bool, optional) If TRUE, returns a window to be used as periodic function. If False, return a symmetric window. |
dtype |
( |
layout |
( |
device |
( |
requires_grad |
(bool, optional) If autograd should record operations on the returned tensor. Default: |
Bartlett window function.
w[n] = 1 - \left| \frac{2n}{N-1} - 1 \right| = \left\{ \begin{array}{ll}
\frac{2n}{N - 1} & \mbox{if } 0 \leq n \leq \frac{N - 1}{2} \\
2 - \frac{2n}{N - 1} & \mbox{if } \frac{N - 1}{2} < n < N \\
\end{array}
\right. ,
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 \mbox{window\_length} + 1
. Also, we always have
torch_bartlett_window(L, periodic=TRUE)
equal to
torch_bartlett_window(L + 1, periodic=False)[:-1])
.
If `window_length` \eqn{=1}, the returned window contains a single value 1.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.