DiscreteHadamardTransform

DiscreteHadamardTransform[list]

gives the discrete Hadamard transform of list.

Details and Options

  • DiscreteHadamardTransform is also known as Walsh transform and Walsh-Hadamard transform.
  • The discrete Hadamard transform of a list of length is by default defined to be , where , is the ^(th) bit in the binary representation of the integer , and .
  • DiscreteHadamardTransform returns a list that has a power of 2 length. If the length of the input list is not a power of 2, it is zero padded to a length that is the smallest power of 2 greater than .
  • DiscreteHadamardTransform takes a Method option. Possible settings are "BitComplement" and "Sequency" (default).
  • The forward and inverse Hadamard transforms are identical. »

Examples

open allclose all

Basic Examples  (2)

Discrete Hadamard transform of a list:

Inverse discrete Hadamard transform:

Discrete Hadamard transform of a 2D sequence that depicts a white rectangle on a black background:

Options  (1)

Method  (1)

By default, a sequency-ordered Hadamard transform is used:

Non-ordered Hadamard transform of a sequence:

Applications  (1)

The two-dimensional Hadamard transform of an image:

Truncate modes in each axis, effectively compressing by a factor of :

Invert the Hadamard transform:

Properties & Relations  (3)

The Hadamard transform is its own inverse (an involution):

DiscreteHadamardTransform automatically pads with zeros to the nearest power of 2:

Comparing the discrete Hadamard transform with DCT:

Introduced in 2012
 (9.0)
 |
Updated in 2014
 (10.0)