Walsh functions

Syntax: y = WALSH(k,x)

The Walsh functions form a complete set of orthogonal, normalized, rectangular periodic functions with a period of one.

Let m be found so that k can be written as a binary number:

where    is the Rademacher function.

Note that the WALSH function can return the values of 1 or -1 only.