DiscreteHadamardTransform

DiscreteHadamardTransform[list]

gives the discrete Hadamard transform of list.

Details and Options

  • DiscreteHadamardTransform is also known as the Walsh transform and WalshHadamard 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 whose length is a power of 2. 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, which specifies the sequency ordering (number of zero crossings in the Hadamard basis sequences) of the transform. Possible settings include:
  • "BitComplement"
    "GrayCode"Gray code reordering of "BitComplement"
    "Sequency"sequency increases with row and column index (default)
  • The bit complement ordering is also known as the Sylvester ordering.
  • The sequency ordering is also known as the Walsh ordering.
  • The Gray code ordering is also known as the dyadic ordering or Paley ordering.
  • 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:

Use the bit complement ordering for the Hadamard transform:

Use the Gray code ordering for the Hadamard transform:

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 discrete Hadamard transform is its own inverse (an involution):

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

Define a function for generating a bit-reversal permutation:

Define a function for generating a Gray code permutation:

Generate random data, and take its discrete Hadamard transform for different sequency orderings:

The Hadamard transform with Gray code ordering is equivalent to applying the Gray code permutation to the Hadamard transform with bit-complement sequency ordering:

The Hadamard transform with sequency ordering is equivalent to applying the bit-reversal permutation to the Hadamard transform with Gray code ordering:

The Hadamard transform with sequency ordering is equivalent to successively applying the bit-reversal permutation and Gray code permutation to the Hadamard transform with bit-complement sequency ordering:

Neat Examples  (1)

Compare the discrete Hadamard transform with DCT:

Wolfram Research (2012), DiscreteHadamardTransform, Wolfram Language function, https://reference.wolfram.com/language/ref/DiscreteHadamardTransform.html (updated 2023).

Text

Wolfram Research (2012), DiscreteHadamardTransform, Wolfram Language function, https://reference.wolfram.com/language/ref/DiscreteHadamardTransform.html (updated 2023).

CMS

Wolfram Language. 2012. "DiscreteHadamardTransform." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/DiscreteHadamardTransform.html.

APA

Wolfram Language. (2012). DiscreteHadamardTransform. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DiscreteHadamardTransform.html

BibTeX

@misc{reference.wolfram_2023_discretehadamardtransform, author="Wolfram Research", title="{DiscreteHadamardTransform}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/DiscreteHadamardTransform.html}", note=[Accessed: 18-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_discretehadamardtransform, organization={Wolfram Research}, title={DiscreteHadamardTransform}, year={2023}, url={https://reference.wolfram.com/language/ref/DiscreteHadamardTransform.html}, note=[Accessed: 18-March-2024 ]}