get_window#

gwpy.signal.window.get_window(window: WindowLike, Nx: int, *args, **kwargs) NDArray[source]#

Return a window of a given length and type.

This is a thin wrapper around scipy.signal.get_window that handles pre-computed window arrays.

Parameters:
windowstr, float, tuple, numpy.ndarray

The specification for the window. Anything accepted by scipy.signal.get_window or an array-like object that is already a window (for convenience).

Nxint

The size of the window. If window is an array, this size will be checked against the size of the array.

args, kwargs

All other arguments are passed to scipy.signal.get_window.

Returns:
windownumpy.ndarray

A 1-d window array with size Nx.

Raises:
ValueError

If an window is given an array that doesn’t have shape matching (Nx,).

See also

scipy.signal.get_window

For details of available window types and valid arguments.