pyntbci.stimulus.make_m_sequence

pyntbci.stimulus.make_m_sequence(poly: list[int] = None, base: int = 2, seed: list[int] = None) ndarray[tuple[Any, ...], dtype[_ScalarT]][source]

Make a maximum length sequence. Maximum length sequence, or m-sequence [14].

Parameters:
  • poly (list[int] (default: None)) – The feedback tap points defined by a primitive polynomial. If None, [1, 0, 0, 0, 0, 1] is used. Example: 1 + x + x^6 is represented as [1, 0, 0, 0, 0, 1] while 1 + x^5 + x^6 as [0, 0, 0, 0, 1, 1].

  • base (int (default: 2)) – The base of the sequence (related to the Galois Field), i.e. base 2 generates a binary sequence, base 3 a tertiary sequence, etc.

  • seed (list[int] (default: None)) – The seed for the initial shift register. If None, an all ones initial register is used.

Returns:

stimulus – A matrix with an m-sequence of shape (1, n_bits).

Return type:

NDArray

References