nnmnkwii.util.apply_delta_windows¶
-
nnmnkwii.util.
apply_delta_windows
(x, windows)[source]¶ Apply delta windows and combine them.
This function computes delta features given delta windows, and then returns combined features (e.g., static + delta + delta-delta). Note that if you want to keep static features, you need to give static window as well as delta windows.
Parameters: - x (numpy.ndarray) – Input static features, of shape (``T x D`).
- y (list) – List of windows. See
nnmnkwii.functions.mlpg()
for what the delta window means.
Returns: static + delta features (
T x (D * len(windows)
).Return type: Examples
>>> from nnmnkwii.util import apply_delta_windows >>> 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 ... ] >>> T, static_dim = 10, 24 >>> x = np.random.rand(T, static_dim) >>> y = apply_delta_windows(x, windows) >>> assert y.shape == (T, static_dim * len(windows))