spyrit.misc.walsh_hadamard.iwalsh2_Sļ
- spyrit.misc.walsh_hadamard.iwalsh2_S(Y, T=None)[source]ļ
Inverse Fast Walsh S-transform of Y in ā2Dā
- Args:
Y(np.ndarray): n-by-n signal. n**2 should be a power of two.T(np.ndarray): Inverse S-matrix- Returns:
np.ndarray: n-by-1 S-transformed signal
- Examples:
>>> import spyrit.misc.walsh_hadamard as wh >>> import numpy as np >>> X = np.array([[1, 3, 0, 8],[7, 5, 1, 2],[2, 3, 6, 1],[4, 6, 8, 0]]) >>> print(f"image:\n {X}") >>> Y = wh.walsh2_S(X) >>> print(f"s-transform:\n {Y}") >>> Z = wh.iwalsh2_S(Y) >>> print(f"inverse s-transform:\n {Z}")
Note that the first pixel is not meaningful and arbitrily set to 0.