segment_data

ketos.audio.base_audio.segment_data(x, window, step=None)[source]

Divide the time axis into segments of uniform length, which may or may not be overlapping.

Window length and step size are converted to the nearest integer number of time steps.

If necessary, the data array will be padded with zeros at the end to ensure that all segments have an equal number of samples.

Args:
x: BaseAudioTime

Data to be segmented

window: float

Length of each segment in seconds.

step: float

Step size in seconds.

Returns:
audio_objects: list(BaseAudioTime)

Data segments