Skip to content

hamming75

Generates a Hamming window of the given size with 75% overlap.

Parameters:

Name Type Description Default
segment_size int

Size of the window to be created.

required
dtype dtype

The desired datatype of the window

float32

Returns:

Type Description
Tuple[NDArray[Any], int]

A hamming window with 75% overlap

Source code in src/libsegmenter/windows/hamming.py
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
def hamming75(
    segment_size: int, dtype: DTypeLike = np.float32
) -> Tuple[NDArray[Any], int]:
    """
    Generates a Hamming window of the given size with 75% overlap.

    Args:
        segment_size (int): Size of the window to be created.
        dtype (np.dtype): The desired datatype of the window

    Returns:
        A hamming window with 75% overlap

    """
    assert segment_size % 4 == 0, f"segment_size must be modulus 4, got {segment_size}"

    return _hamming(segment_size, dtype=dtype), segment_size // 4