mlx.core.hamming

Contents

mlx.core.hamming#

hamming(M: int, *, stream: None | Stream | Device = None) array#

Return the Hamming window.

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

\[w(n) = 0.54 - 0.46 \cos\left(\frac{2\pi n}{M-1}\right) \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