COLA¶
- class COLA(process, store, n_total, n_samples, n_overlap, sfreq, window='hann', tol=1e-10, *, verbose=None)[source][source]¶
Constant overlap-add processing helper.
- Parameters:
process (
callable) – A function that takes a chunk of input data with shape(n_channels, n_samples)and processes it.store (
callable | ndarray) – A function that takes a completed chunk of output data. Can also be anndarray, in which case it is treated as the output data in which to store the results.n_total (
int) – The total number of samples.n_samples (
int) – The number of samples per window.n_overlap (
int) – The overlap between windows.window (
str) – The window to use. Default is “hann”.tol (
float) – The tolerance for COLA checking.n_jobs (
int) – The number of jobs to run in parallel.verbose (
bool) – If True, print a message when the COLA condition is not met.
Notes
This will process data using overlapping windows to achieve a constant output value. For example, for
n_total=27,n_samples=10,n_overlap=5andwindow='triang'1 _____ _______ | \ /\ /\ / | \ / \ / \ / | x x x | / \ / \ / \ | / \/ \/ \ 0 +----|----|----|----|----|- 0 5 10 15 20 25
This produces four windows: the first three are the requested length (10 samples) and the last one is longer (12 samples). The first and last window are asymmetric.