pyntbci.stimulus.make_de_bruijn_sequence

pyntbci.stimulus.make_de_bruijn_sequence(k: int = 2, n: int = 6, seed: list[int] = None) NDArray[source]

Make a de Bruijn sequence. This code to generate a de Bruijn sequence is largely inspired by Eviatar Bach.

Parameters:
  • k (int (default: 2)) – The size of the alphabet.

  • n (int (default: 6)) – The order of the sequence.

  • seed (list[int] (default: None)) – Seed for the initial register. None leads to an all zero initial register.

Returns:

stimulus – A matrix with a de Bruijn sequence of shape (1, n_bits).

Return type:

NDArray

References

De Bruijn, N. G. (1946). A combinatorial problem. Proceedings of the Section of Sciences of the Koninklijke Nederlandse Akademie van Wetenschappen te Amsterdam, 49(7), 758-764. Eviatar Bach: git.sagemath.org/sage.git/tree/src/sage/combinat/debruijn_sequence.pyx