spyrit.misc.walsh_hadamard.walsh_S_matrix
- spyrit.misc.walsh_hadamard.walsh_S_matrix(n, H=None)[source]
Return Walsh-ordered Hadamard S-matrix of order n
- Args:
n (int): Matrix order. n+1 should be a power of two. H (np.ndarray, optional): Hadamard matrix of order n+1.
- Returns:
np.ndarray: S-matrix of shape (n,n)
- Examples:
Walsh-ordered Hadamard S-matrix of order 7
>>> import spyrit.misc.walsh_hadamard as wh >>> print(wh.walsh_S_matrix(7)) [[0. 0. 0. 1. 1. 1. 1.] [0. 1. 1. 1. 1. 0. 0.] [0. 1. 1. 0. 0. 1. 1.] [1. 1. 0. 0. 1. 1. 0.] [1. 1. 0. 1. 0. 0. 1.] [1. 0. 1. 1. 0. 1. 0.] [1. 0. 1. 0. 1. 0. 1.]]