{
  "aliases": null,
  "backlinks": [
    {
      "field": "uses",
      "target": "9HYM2ZMS31"
    },
    {
      "field": "uses",
      "target": "BH3NNAYJT5"
    },
    {
      "field": "uses",
      "target": "RY3QGW87HX"
    },
    {
      "field": "uses",
      "target": "S966EZX3ZT"
    }
  ],
  "body": "\n## Statement\n\nFor an integer $M \\ge 1$ let $\\omega_M = e^{-2\\pi i/M}$, a [[primitive $M$-th root of unity|0EHM5ZP5QH]].\nLet $N = N_1 N_2$ with integers $N_1, N_2 \\ge 1$, let $x = (x_0, \\ldots, x_{N-1}) \\in \\C^N$, and let $X$ be its [[discrete Fourier transform|TST0GH66A5]], $X_k = \\sum_{n=0}^{N-1} x_n \\omega_N^{nk}$.\nThen for all $0 \\le k_1 \u003c N_1$ and $0 \\le k_2 \u003c N_2$,\n$$X_{k_1 + N_1 k_2} = \\sum_{n_2=0}^{N_2-1} \\omega_{N_2}^{n_2 k_2} \\left[ \\omega_N^{n_2 k_1} \\sum_{n_1=0}^{N_1-1} x_{N_2 n_1 + n_2}\\, \\omega_{N_1}^{n_1 k_1} \\right].$$\nThus a DFT of length $N$ is obtained in three stages.\nFirst come $N_2$ DFTs of length $N_1$, then $N$ multiplications by the twiddle factors $\\omega_N^{n_2 k_1}$, then $N_1$ DFTs of length $N_2$.\nIn particular, if $N = 2^m$, applying this with $N_1 = 2$ (or $N_2 = 2$) recursively computes $X$ with $O(N \\log N)$ arithmetic operations.\n\n## Remarks\n\nThe proof is one line: write $n = N_2 n_1 + n_2$ and $k = k_1 + N_1 k_2$ and expand $\\omega_N^{nk}$.\nThe factor $\\omega_N^{N_2 N_1 n_1 k_2}$ equals $1$, while $\\omega_N^{N_2 n_1 k_1} = \\omega_{N_1}^{n_1 k_1}$ and $\\omega_N^{N_1 n_2 k_2} = \\omega_{N_2}^{n_2 k_2}$.\nFor $N = 2M$ the radix-2 form reads $X_k = E_k + \\omega_N^k O_k$ and $X_{k+M} = E_k - \\omega_N^k O_k$ for $0 \\le k \u003c M$, where $E$ and $O$ are the DFTs of length $M$ of the even-indexed and odd-indexed entries.\nThe cost then satisfies $T(N) = 2T(N/2) + O(N)$, so $T(N) = O(N \\log N)$.\nDirect evaluation of the defining sums costs about $N^2$ multiplications; for $N = 2^{20}$ the ratio is about $5 \\times 10^4$.\nThe splitting is useless when $N$ is prime, since then one factor is $1$.\n\n## Explanations\n\n### L1 human\n\nThe discrete Fourier transform of $N$ numbers looks like it needs $N^2$ multiplications.\nThe Cooley–Tukey idea is to split the input into interleaved pieces, transform each piece, and glue the results with a few extra multiplications.\nFor $N = 8$: transform the entries with even index and those with odd index separately, then combine.\nRepeating the split when $N$ is a power of $2$ brings the cost down to a multiple of $N \\log N$.\n\n### L2 human\n\nThis is the most common fast Fourier transform.\nThe index maps $n = N_2 n_1 + n_2$ and $k = k_1 + N_1 k_2$ turn a one-dimensional transform into a two-dimensional one, up to the twiddle factors.\nRadix-2, radix-4, split-radix and mixed-radix versions differ only in how $N$ is factored at each step.\nWhen $N_1$ and $N_2$ are coprime, the prime-factor algorithm uses other index maps and avoids the twiddle factors.\nPrime lengths need a different reduction, such as Rader's or Bluestein's algorithm.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "about": [
      "TST0GH66A5"
    ],
    "kind": "statement",
    "msc": [
      "65T50",
      "65Y20"
    ],
    "name": "Cooley–Tukey FFT algorithm",
    "role": "theorem",
    "same_as": {
      "wikidata": "Q5167446",
      "wikipedia": "Cooley–Tukey FFT algorithm"
    },
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Cooley–Tukey_FFT_algorithm"
      }
    ],
    "tag": "9N8D9E5TB2",
    "uses": [
      "TST0GH66A5",
      "0EHM5ZP5QH",
      "0TGV80E6A4"
    ]
  },
  "kind": "statement",
  "link": "https://tamnd.github.io/math2/node/9N8D9E5TB2/",
  "links": [
    {
      "field": "about",
      "target": "TST0GH66A5"
    },
    {
      "field": "uses",
      "target": "TST0GH66A5"
    },
    {
      "field": "uses",
      "target": "0EHM5ZP5QH"
    },
    {
      "field": "uses",
      "target": "0TGV80E6A4"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/9N8D9E5TB2.md",
  "msc": [
    "65T50",
    "65Y20"
  ],
  "name": "Cooley–Tukey FFT algorithm",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/9N8/9N8D9E5TB2.md",
  "status": null,
  "tag": "9N8D9E5TB2",
  "uri": "m2://9N8D9E5TB2",
  "url": "https://tamnd.github.io/math2/wiki/cooley-tukey-fft-algorithm/",
  "writing": {
    "tag": "9N8D9E5TB2",
    "kind": "statement",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
