pyntbci.stimulus.is_gold_code
- pyntbci.stimulus.is_gold_code(stimulus: NDArray) bool[source]
Check whether a stimulus is a Gold code. Gold codes have a 3-valued auto- and cross-correlation function.
If the length of the linear feedback shift register m is even: * 1/(2^n−1) * −(2^{(n+2)/2}+1)/(2^n−1) * (2^{(n+2)/2}−1)/(2^n−1) in ratio ~3/4, ~1/8, ~1/8.
If the length of the linear feedback shift register n is odd: * 1/(2^n−1) * −(2^{(n+1)/2}+1)/(2^n−1) * (2^{(n+1)/2}−1)/(2^n−1) in ratio ~1/2, ~1/4, ~1/4
- Parameters:
stimulus (NDArray) – A matrix with the Gold codes of shape (n_classes, n_bits).
- Returns:
out – True if the stimulus is a Gold code, otherwise False.
- Return type:
bool
References
Gold, R. (1967). Optimal binary sequences for spread spectrum multiplexing (Corresp.). IEEE Transactions on information theory, 13(4), 619-621. Meel, J. (1999). Spread spectrum (SS). De Nayer Instituut, Hogeschool Voor Wetenschap & Kunst.