nnmnkwii.paramgen.build_win_mats

nnmnkwii.paramgen.build_win_mats(windows, T)[source]

Builds a window matrix of a given size for each window in a collection.

Parameters
  • windows (list) – specifies the collection of windows as a sequence of

  • `` (l, u, win_coeff) –

  • pecifying the left and right extents of the window and (integers) –

  • is an array specifying the window coefficients. (win_coeff) –

  • T (int) – Number of frames.

Returns

The returned value is a list of window matrices, one for each of the windows specified in windows. Each window matrix is a T by T Toeplitz matrix with lower bandwidth l and upper bandwidth u. The non-zero coefficients in each row of this Toeplitz matrix are given by win_coeff. The returned window matrices are stored as BandMats, i.e. using a banded representation.

Return type

list

Examples

>>> from nnmnkwii import paramgen as G
>>> import numpy as np
>>> windows = [
...     (0, 0, np.array([1.0])),            # static
...     (1, 1, np.array([-0.5, 0.0, 0.5])), # delta
...     (1, 1, np.array([1.0, -2.0, 1.0])), # delta-delta
... ]
>>> win_mats = G.build_win_mats(windows, 3)