Input Matrix Construction

New in version 0.1.

Changed in version 1.2.0.

This function creates input matrix from historical values.

Minimal Working Example

An example how to create input matrix from historical values

>>> import numpy as np
>>> import padasip as pa
>>> a = np.arange(1, 7, 1)
>>> a
array([1, 2, 3, 4, 5, 6])
>>> pa.input_from_history(a,3)
array([[1, 2, 3],
       [2, 3, 4],
       [3, 4, 5],
       [4, 5, 6]])

Code Explanation

padasip.preprocess.input_from_history.input_from_history(a, n, bias=False)[source]

This is function for creation of input matrix.

Args:

  • a : series (1 dimensional array)

  • n : size of input matrix row (int). It means how many samples of previous history you want to use as the filter input. It also represents the filter length.

Kwargs:

  • bias : decides if the bias is used (Boolean). If True, array of all ones is appended as a last column to matrix x. So matrix x has `n`+1 columns.

Returns:

  • x : input matrix (2 dimensional array) constructed from an array a. The length of x is calculated as length of a - n + 1. If the bias is used, then the amount of columns is n if not then amount of columns is `n`+1).