ertk.utils.frame_arrays

ertk.utils.frame_arrays(arrays: List[ndarray] | ndarray, frame_size: int, frame_shift: int, max_frames: int | None = None, vlen: bool = False) ndarray

Creates sequences of frames from the given arrays. This is mainly a convenience wrapper around frame_array() for instance arrays.

Parameters:
arrays: list of np.ndarray

The arrays to process.

frame_size: int

Length of each frame.

frame_shift: int

Amount each frame is shifted.

max_frames: int, optional

If given, only the first max_frames are returned for each array.

vlen: bool

Whether to return a contiguous array if vlen=False (default) or an array of variable length arrays.

Returns:
framed_arrays:

Framed arrays.