{
  "aliases": null,
  "backlinks": [
    {
      "field": "uses",
      "target": "S966EZX3ZT"
    }
  ],
  "body": "\n## Statement\n\nLet $N \\ge 1$, let $x \\in \\C^N$ and let $X$ be its [[discrete Fourier transform|TST0GH66A5]], $X_k = \\sum_{n=0}^{N-1} x_n e^{-2\\pi i nk/N}$.\nFor integers $m$ let $b_m = e^{\\pi i m^2/N}$, and for $0 \\le n \u003c N$ let $a_n = x_n e^{-\\pi i n^2/N}$.\nThen for $0 \\le k \u003c N$,\n$$X_k = \\overline{b_k} \\sum_{n=0}^{N-1} a_n\\, b_{k-n}.$$\nLet $M \\ge 2N - 1$, let $\\alpha \\in \\C^M$ be $a$ followed by zeros, and let $\\beta \\in \\C^M$ have $\\beta_j = b_j$ for $0 \\le j \u003c N$, $\\beta_{M-j} = b_{-j}$ for $1 \\le j \u003c N$, and zeros elsewhere.\nThen $X_k = \\overline{b_k}\\, (\\alpha \\circledast \\beta)_k$ for $0 \\le k \u003c N$, where $(\\alpha \\circledast \\beta)_k = \\sum_{j=0}^{M-1} \\alpha_j \\beta_{(k-j) \\bmod M}$ is the cyclic [[convolution|2Z29JN3VES]] of length $M$.\nTake $M$ a power of $2$ and compute the cyclic convolution with three [[radix-2 FFTs|9N8D9E5TB2]] of length $M$.\nThen the DFT of any length $N$ costs $O(N \\log N)$ operations.\n\n## Remarks\n\nThe key identity is $nk = \\frac12 \\bigl(n^2 + k^2 - (k-n)^2\\bigr)$, which gives $e^{-2\\pi i nk/N} = e^{-\\pi i n^2/N} e^{-\\pi i k^2/N} e^{\\pi i (k-n)^2/N}$.\nSo the DFT is a pointwise product with a chirp, a convolution with the conjugate chirp, and another pointwise product.\nThe index $k - n$ runs from $-(N-1)$ to $N-1$, and the zero padding to $M \\ge 2N-1$ makes the cyclic convolution agree with this linear convolution on $0 \\le k \u003c N$.\nThe cyclic convolution of length $M$ equals the inverse DFT of the product of the DFTs of $\\alpha$ and $\\beta$.\nSince one can choose $M \u003c 4N$, the constant in $O(N \\log N)$ does not depend on the arithmetic of $N$; in particular prime $N$ is allowed.\nThe same identity with $e^{-2\\pi i/N}$ replaced by any complex $z$ evaluates the chirp z-transform $\\sum_n x_n z^{-nk}$, which is the subject of the source article.\n\n## Explanations\n\n### L1 human\n\nThe fast Fourier transform is easiest when the length is a power of two.\nBluestein's trick rewrites a transform of any length, even a prime length, as a convolution.\nA convolution can be padded with zeros to a power-of-two length and computed with power-of-two FFTs.\nSo every length gets the speed $N \\log N$, at the price of a larger constant.\n\n### L2 human\n\nThe algorithm is the standard fallback in FFT libraries for lengths with large prime factors.\nCompared with Rader's algorithm, it does not need a primitive root and works for every $N$, not only primes.\nIt needs about three FFTs of length $M \\approx 2N$ to $4N$, so it is slower than a direct Cooley–Tukey FFT of a highly composite length.\nThe chirp $e^{\\pi i m^2/N}$ is the same object as in the fractional Fourier transform and in radar signal processing.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "about": [
      "TST0GH66A5"
    ],
    "kind": "statement",
    "msc": [
      "65T50",
      "65Y20"
    ],
    "name": "Bluestein's FFT algorithm",
    "role": "theorem",
    "sources": [
      {
        "locator": "Bluestein's algorithm",
        "url": "https://en.wikipedia.org/wiki/Chirp_Z-transform"
      }
    ],
    "tag": "RY3QGW87HX",
    "uses": [
      "TST0GH66A5",
      "2Z29JN3VES",
      "9N8D9E5TB2",
      "0TGV80E6A4"
    ]
  },
  "kind": "statement",
  "link": "https://tamnd.github.io/math2/node/RY3QGW87HX/",
  "links": [
    {
      "field": "about",
      "target": "TST0GH66A5"
    },
    {
      "field": "uses",
      "target": "TST0GH66A5"
    },
    {
      "field": "uses",
      "target": "2Z29JN3VES"
    },
    {
      "field": "uses",
      "target": "9N8D9E5TB2"
    },
    {
      "field": "uses",
      "target": "0TGV80E6A4"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/RY3QGW87HX.md",
  "msc": [
    "65T50",
    "65Y20"
  ],
  "name": "Bluestein's FFT algorithm",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/RY3/RY3QGW87HX.md",
  "status": null,
  "tag": "RY3QGW87HX",
  "uri": "m2://RY3QGW87HX",
  "url": "https://tamnd.github.io/math2/wiki/bluesteins-fft-algorithm/",
  "writing": {
    "tag": "RY3QGW87HX",
    "kind": "statement",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
