lmlib.statespace.cost.map_windows(windows, ks, K, merge_ks=False, merge_seg=False, fill_value=0)#

Maps the window amplitudes of one or multiple Segment to indices ks into a common target output vector of length K.

The parameter windows is commonly directly the output of one of the following methods:

  • windows

  • ks (array_like of shape=(KS) of ints) – target indices in the target output vector, where to map the windows to

  • K (int) – Length of target output vector

  • merge_ks (bool, optional) – If True, all windows from different target indices ks are merged into a single array of length K; if the windows of two target indices overlap, only the window with the larger value remains.

  • merge_seg (bool, optional) – If True, all segments P are merged to a single target vector of length K; if the windows of two segments overlap, only window value with the larger value remains.

  • fill_value (scalar or None, optional) – Default value of target output vector elements, when no window is assigned.



  • Dimension KS only exists, if merge_ks=False.

  • Dimension P only exists, if merge_seg=False.

Return type

ndarray of shape=([KS,] [P,] K) of floats

KS : number of (time) indices in the list
P : number of segments
K : number of samples