mlx.core.bartlett

Contents

mlx.core.bartlett#

bartlett(M: int, *, stream: Stream | mlx.core.ThreadLocalStream | Device | None = None) array#

Return the Bartlett window.

The Bartlett window is a taper formed by using a weighted cosine.

\[w(n) = 1 - \frac{2|n - (M-1)/2|}{M-1} \qquad 0 \le n \le M-1\]
Parameters:

M (int) – Number of points in the output window.

Returns:

The window, with the maximum value normalized to one (the value one

appears only if the number of samples is odd).

Return type:

array