Window Generator#

You can generate for each signal sample a moving window with the size of the number of signal samples over the signal samples itself by calling the method window().

>>> trace = Trace('Signal', [1 , 2, 3, 4, 5, 6, 7, 8, 9])
>>> # windows with the size of 3 signal samples
>>> list(trace.window(3))
[(1, 1, 1),
 (1, 1, 2),
 (1, 2, 3),
 (2, 3, 4),
 (3, 4, 5),
 (4, 5, 6),
 (5, 6, 7),
 (6, 7, 8),
 (7, 8, 9)]

Note

The moving window generator uses the first signal sample as the preset value to generate the windows for the first number of signal samples.