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)