neurodsp.utils.data.split_signal

neurodsp.utils.data.split_signal(sig, n_samples)[source]

Split a signal into non-overlapping segments.

Parameters
sig1d array

Time series.

n_samplesint

The chunk size to split the signal into, in samples.

Returns
segments2d array

The signal, split into segments, with shape [n_segment, segment_size].

Notes

If the signal does not divide evenly into the number of segments, this approach will truncate the signal, returning the maximum number of segments, and dropping any leftover samples.