pyntbci.stimulus.make_gold_codes

pyntbci.stimulus.make_gold_codes(poly1: list[int] | None = None, poly2: list[int] | None = None, seed1: list[int] | None = None, seed2: list[int] | None = None) ndarray[Any, dtype[_ScalarType_co]][source]

Make a set of Gold codes. The Gold codes [13] should be generated with two polynomials that define a preferred pair of m-sequences.

Parameters:
  • poly1 (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) and 1 + 4x + 3x^2 as (4, 3).

  • poly2 (list[int] (default: None)) – The feedback tap points defined by a primitive polynomial. If None, [1, 1, 0, 0, 1, 1] is used. Example: 1 + x + x^6 is represented as (1, 0, 0, 0, 0, 1) and 1 + 4x + 3x^2 as (4, 3).

  • seed1 (list[int] (default: None)) – Seed for the initial shift register of poly1. If None, an all zero initial register is used.

  • seed2 (list[int] (default: None)) – Seed for the initial shift register of poly2. If None, an all zero initial register is used.

Returns:

stimulus – A matrix with Gold codes of shape (n_classes, n_bits).

Return type:

NDArray

References