# Walsh Hadamard (G Dataflow)

Last Modified: June 25, 2019

Computes the real Walsh Hadamard transform of a sequence.  ## reset

A Boolean that specifies whether to reset the internal state of the node.

 True Resets the internal state of the node. False Does not reset the internal state of the node.

This input is available only if you wire a double-precision, floating-point number to x.

Default: False ## x

The input sequence.

The length of the sequence must be a power of 2, otherwise this node returns an error.

This input accepts a double-precision, floating-point number or a 1D array of double-precision, floating-point numbers. ## sample length

Length of each set of data. The node performs computation for each set of data.

sample length must be greater than zero.

This input is available only if you wire a double-precision, floating-point number to x.

Default: 128 ## error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error  If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error ## Walsh-Hadamard{x}

The Walsh Hadamard transform of the input sequence. ## error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error  If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

## Algorithm Definition

The Walsh Hadamard transform is based on an orthogonal system consisting of functions of only two elements -1 and 1. For the special case of n = 4, the Walsh Hadamard transform of the signal X = {x0, x1, x2, x3} can be noted in the following matrix form:

$WH\left\{X\right\}=\left[\begin{array}{cccc}1& 1& 1& 1\\ 1& -1& 1& -1\\ 1& 1& -1& -1\\ 1& -1& -1& 1\end{array}\right]\left[\begin{array}{c}{\begin{array}{c}x\end{array}}_{0}\\ {x}_{1}\\ {x}_{2}\\ {x}_{3}\end{array}\right]$

If WHn and WHn+1 denote the Walsh Hadamard matrices of dimension 2n and 2n + 1 respectively, the rule is

${WH}_{n+1}=\left[\begin{array}{cc}{WH}_{n}& {WH}_{n}\\ {WH}_{n}& {-WH}_{n}\end{array}\right]$

where -WHn is meant in the element wise sense. Note

The Walsh Hadamard transform fulfills the Convolution Theorem: WH{X*Y} = WH{X}WH{Y}.

## Comparing the Walsh Hadamard Transform with the Fourier Transform

The Walsh Hadamard transform has similar properties to the Fourier transform, but the computational effort is considerably smaller.

The following diagram shows the Walsh Hadamard transform of a pulse pattern signal of length 256, delay 32, and width 64. Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported

Web Server: Not supported in VIs that run in a web application