tf.keras.ops.bartlett

Bartlett window function.

The Bartlett window is a triangular window that rises then falls linearly.

x Scalar or 1D Tensor. Window length.

A 1D tensor containing the Bartlett window values.

Example:

x = keras.ops.convert_to_tensor(5)
keras.ops.bartlett(x)
array([0. , 0.5, 1. , 0.5, 0. ], dtype=float32)