spyrit.misc.walsh_hadamard.walsh2_S_foldļ
- spyrit.misc.walsh_hadamard.walsh2_S_fold(x)[source]ļ
Fold a signal to get a ā2dā s-transformed representation
Note: the top left (first) pixel is arbitrarily set to zero
- Args:
- x (np.ndarray): N-by- vector. N is such that N+1 = n*n, where n is a
power of two. N = 2**(2b) - 1, where b is an integer
- Returns:
X (np.ndarray): n-by-n matrix
- Example 1:
>>> import spyrit.misc.walsh_hadamard as wh >>> S = wh.walsh2_S_matrix(4) >>> X = wh.walsh2_S_fold(S[2,:]) >>> print(X) [[0. 1. 0. 1.] [0. 1. 0. 1.] [0. 1. 0. 1.] [0. 1. 0. 1.]]