{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $m \\ge 0$ and $N = 2^m$.\nLet $H_0 = (1)$, and for $m \\ge 1$ let $H_m = H_1 \\otimes H_{m-1}$, where $\\otimes$ is the [[Kronecker product|0N7ENQRCXN]] and\n$$H_1 = \\begin{pmatrix} 1 \u0026 1 \\\\ 1 \u0026 -1 \\end{pmatrix}.$$\nThe *Walsh–Hadamard transform* of a vector $x \\in \\C^N$ is the vector $H_m x \\in \\C^N$.\nIndex rows and columns by $0, \\dots, N-1$.\nThen $(H_m)_{jk} = (-1)^{j \\cdot k}$, where $j \\cdot k$ counts the positions where the binary expansions of $j$ and $k$ both have the digit $1$.\n\n## Remarks\n\n$H_m$ is a symmetric [[Hadamard matrix|J0N4J606X0]] of order $N$, so $H_m^2 = N I$ and the inverse transform is $x = N^{-1} H_m (H_m x)$.\nMany authors use the normalized matrix $N^{-1/2} H_m$, which is orthogonal and its own inverse.\nWriting $x$ as two halves $x = (x', x'')$, one has $H_m x = (H_{m-1}(x' + x''), H_{m-1}(x' - x''))$; iterating this gives the fast transform with $m N$ additions and subtractions.\n\nExample: for $m = 2$,\n$$H_2 = \\begin{pmatrix} 1 \u0026 1 \u0026 1 \u0026 1 \\\\ 1 \u0026 -1 \u0026 1 \u0026 -1 \\\\ 1 \u0026 1 \u0026 -1 \u0026 -1 \\\\ 1 \u0026 -1 \u0026 -1 \u0026 1 \\end{pmatrix},$$\nand $x = (1, 0, 0, 0)$ goes to $(1, 1, 1, 1)$, while $x = (1, 1, 1, 1)$ goes to $(4, 0, 0, 0)$.\nCheck of one entry: $(H_2)_{3,3} = (-1)^{2} = 1$, since $3 = 11_2$ shares two digits $1$ with itself.\n\nNon-example: the discrete Fourier transform matrix $(e^{-2\\pi i jk/4})_{j,k}$ of order $4$ has entries $\\pm i$, so it is not $H_2$, although its rows are also orthogonal.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "K784BA2WHV",
    "kind": "definition",
    "msc": [
      "42C10",
      "65T50",
      "94A12"
    ],
    "name": "Walsh–Hadamard transform",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Hadamard_transform"
      }
    ],
    "tag": "3BTA41B7M1",
    "uses": [
      "J0N4J606X0",
      "0N7ENQRCXN"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/3BTA41B7M1/",
  "links": [
    {
      "field": "defines",
      "target": "K784BA2WHV"
    },
    {
      "field": "uses",
      "target": "J0N4J606X0"
    },
    {
      "field": "uses",
      "target": "0N7ENQRCXN"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/3BTA41B7M1.md",
  "msc": [
    "42C10",
    "65T50",
    "94A12"
  ],
  "name": "Walsh–Hadamard transform",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/3BT/3BTA41B7M1.md",
  "status": null,
  "tag": "3BTA41B7M1",
  "uri": "m2://3BTA41B7M1",
  "url": "https://tamnd.github.io/math2/wiki/walsh-hadamard-transform-definition/",
  "writing": {
    "tag": "3BTA41B7M1",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
