pyntbci.stimulus.make_gold_codes
- pyntbci.stimulus.make_gold_codes(poly1: list[int] = None, poly2: list[int] = None, seed1: list[int] = None, seed2: list[int] = None) ndarray[tuple[Any, ...], dtype[_ScalarT]] [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] while 1 + x^5 + x^6 as [0, 0, 0, 0, 1, 1].
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] while 1 + x^5 + x^6 as [0, 0, 0, 0, 1, 1].
seed1 (list[int] (default: None)) – Seed for the initial shift register of poly1. If None, an all ones initial register is used.
seed2 (list[int] (default: None)) – Seed for the initial shift register of poly2. If None, an all ones initial register is used.
- Returns:
stimulus – A matrix with Gold codes of shape (n_classes, n_bits).
- Return type:
NDArray
References