Algorithm Search⌘K

Proofs: Bluestein's algorithm

These are the human proofs of Bluestein's algorithm, at full length.

Bluestein's algorithm computes the DFT of any length with three FFTs of length M, and has a first-order error bound full

This proof shows: correctness, complexity, error-bound.

Let RR be a commutative ring, n≥1n \ge 1, and ζ∈R\zeta \in R with ζ2n=1\zeta^{2n} = 1 such that ω=ζ2\omega = \zeta^2 is a principal nn-th root of unity. Let MM be the least power of two with M≥2n−1M \ge 2n - 1, and suppose RR has a principal MM-th root of unity and MM is a unit in RR. For an integer mm put cm=ζm2c_m = \zeta^{m^2}; since ζ2n=1\zeta^{2n} = 1, cm=ζm2 mod 2nc_m = \zeta^{m^2 \bmod 2n}, which is the value of line L2, and c−m=cmc_{-m} = c_m. Each cmc_m is a unit, with inverse ζ2n−(m2 mod 2n)\zeta^{2n - (m^2 \bmod 2n)}.

Lemma 1 (the identity). For all integers jj and kk, ωjk=cj ck ck−j−1\omega^{jk} = c_j \, c_k \, c_{k-j}^{-1}.

Proof. j2+k2−(k−j)2=2jkj^2 + k^2 - (k - j)^2 = 2jk, so cjckck−j−1=ζj2+k2−(k−j)2=ζ2jk=ωjkc_j c_k c_{k-j}^{-1} = \zeta^{j^2 + k^2 - (k-j)^2} = \zeta^{2jk} = \omega^{jk}. □\square

Lemma 2 (the kernel). After line L4, for every integer dd with ∣d∣<n|d| < n, b[d mod M]=cd−1b[d \bmod M] = c_d^{-1}, and b[r]=0b[r] = 0 for every other position rr.

Proof. For 0≤m<n0 \le m < n, line L4 writes cm−1c_m^{-1} at mm and at (M−m) mod M(M - m) \bmod M, which is d mod Md \bmod M for d=md = m and d=−md = -m; as c−m=cmc_{-m} = c_m, the value written is cd−1c_d^{-1} in both cases. The positions 0,1,…,n−10, 1, \ldots, n - 1 and M−n+1,…,M−1M - n + 1, \ldots, M - 1 are distinct, because M−n+1≥nM - n + 1 \ge n when M≥2n−1M \ge 2n - 1. For m=0m = 0 both writes go to position 00 with the same value. No other position is written, and all start at 00. □\square

Theorem 1 (forward). BLUESTEIN(x,ζ)(x, \zeta) returns the DFT Xk=∑j=0n−1xjωjkX_k = \sum_{j=0}^{n-1} x_j \omega^{jk}, 0≤k<n0 \le k < n.

Proof. After line L3, aj=xjcja_j = x_j c_j for j<nj < n and aj=0a_j = 0 for n≤j<Mn \le j < M. Let z=a⊛bz = a \circledast b be the cyclic convolution of length MM, zk=∑j=0M−1ajb[(k−j) mod M]z_k = \sum_{j=0}^{M-1} a_j b[(k - j) \bmod M]. Lines L5 to L7 compute zz exactly: by the convolution theorem over RR, with the principal MM-th root and MM a unit, FM−1(FMa⊙FMb)=a⊛bF_M^{-1}(F_M a \odot F_M b) = a \circledast b, and the FFT and its inverse compute FMF_M and FM−1F_M^{-1} exactly in RR by the FFT page. For 0≤k<n0 \le k < n, only j<nj < n contribute, and then d=k−jd = k - j satisfies ∣d∣<n|d| < n, so by Lemma 2, zk=∑j<nxjcjck−j−1z_k = \sum_{j<n} x_j c_j c_{k-j}^{-1}. By Lemma 1, line L8 gives ckzk=∑j<nxjωjk=Xkc_k z_k = \sum_{j<n} x_j \omega^{jk} = X_k. □\square

Theorem 2 (inverse). INVERSE-BLUESTEIN(X,ζ)(X, \zeta) returns the xx whose DFT is XX, provided nn is a unit.

Proof. ζ−1\zeta^{-1} satisfies (ζ−1)2n=1(\zeta^{-1})^{2n} = 1, and (ζ−1)2=ω−1(\zeta^{-1})^2 = \omega^{-1} is again a principal nn-th root of unity: (ω−1)n=1(\omega^{-1})^n = 1, and for 0<i<n0 < i < n, ∑kω−ik=∑kω(n−i)k=0\sum_k \omega^{-ik} = \sum_k \omega^{(n-i)k} = 0 because 0<n−i<n0 < n - i < n. So by Theorem 1, line L10 returns yj=∑kXkω−jky_j = \sum_k X_k \omega^{-jk}. By the inversion formula on the DFT page, yj=nxjy_j = n x_j, and line L11 divides by nn. □\square

Operation count. Line L3 does nn multiplications and line L8 does nn; line L6 does MM. Lines L2 and L4 form the chirp and copy its inverses, which the cost model counts apart like a table. Each of the two forward FFTs of length MM in line L5 uses M2lg⁡M\frac{M}{2} \lg M multiplications and Mlg⁡MM \lg M additions, and the inverse FFT of line L7 uses the same plus MM multiplications by M−1M^{-1}. The total is 32Mlg⁡M+2M+2n\frac{3}{2} M \lg M + 2M + 2n multiplications and 3Mlg⁡M3 M \lg M additions. As MM is the least power of two ≥2n−1\ge 2n - 1, M<2(2n−1)M < 2(2n - 1), so M=Θ(n)M = \Theta(n) and the cost is Θ(nlog⁡n)\Theta(n \log n); the extra space is the arrays of length MM and nn.

Theorem 3 (rounding error). Work over C\mathbb{C} in floating point with unit roundoff uu, and γ2=2u/(1−2u)\gamma_2 = 2u/(1 - 2u). Suppose (i) each computed chirp value satisfies ∣c^m−cm∣≤μ|\hat c_m - c_m| \le \mu, and b^m=c^m‾\hat b_m = \overline{\hat c_m}, which is exact; (ii) a complex multiplication satisfies fl(pq)=pq(1+ϵ)\mathrm{fl}(pq) = pq(1 + \epsilon) with ∣ϵ∣≤2γ2|\epsilon| \le \sqrt 2 \gamma_2 (Higham, Section 3.6); (iii) the computed FFT of length MM satisfies ∥fl(FFT(v))−FMv∥2≤εM∥FMv∥2\lVert \mathrm{fl}(\mathrm{FFT}(v)) - F_M v \rVert_2 \le \varepsilon_M \lVert F_M v \rVert_2, and the inverse FFT, done as an FFT with conjugate twiddles followed by the exact division by the power of two MM, satisfies the same bound with FM−1F_M^{-1}; Higham's Theorem 24.2 gives εM=lg⁡M⋅η+O(u2)\varepsilon_M = \lg M \cdot \eta + O(u^2). Then, with β=2n−1\beta = 2n - 1,

∥X^−X∥2≤β(2μ+22γ2+(2+2)εM)∥x∥2+(μ+2γ2)∥X∥2+O(u2).\lVert \hat X - X \rVert_2 \le \beta \left(2\mu + 2\sqrt 2 \gamma_2 + (2 + \sqrt 2) \varepsilon_M\right) \lVert x \rVert_2 + (\mu + \sqrt 2 \gamma_2) \lVert X \rVert_2 + O(u^2).

Proof. All norms are Euclidean unless marked. Put δ=μ+2γ2\delta = \mu + \sqrt 2 \gamma_2, and recall ∣cm∣=1|c_m| = 1, ∥FMv∥2=M∥v∥2\lVert F_M v \rVert_2 = \sqrt M \lVert v \rVert_2 and ∥FM−1v∥2=∥v∥2/M\lVert F_M^{-1} v \rVert_2 = \lVert v \rVert_2 / \sqrt M. Terms of order u2u^2 are dropped throughout.

Step 1 (line L3). ∣a^j−aj∣≤∣xj∣∣c^j−cj∣+2γ2∣xjc^j∣≤δ∣xj∣|\hat a_j - a_j| \le |x_j| |\hat c_j - c_j| + \sqrt 2 \gamma_2 |x_j \hat c_j| \le \delta |x_j|, so ∥a^−a∥≤δ∥x∥\lVert \hat a - a \rVert \le \delta \lVert x \rVert, and ∥a∥=∥x∥\lVert a \rVert = \lVert x \rVert.

Step 2 (line L5, the kernel). bb has β\beta nonzero entries of modulus 11, so ∥B∥∞≤∥b∥1=β\lVert B \rVert_\infty \le \lVert b \rVert_1 = \beta and ∥b∥2=β\lVert b \rVert_2 = \sqrt\beta. Write B^=FMb^+e2\hat B = F_M \hat b + e_2. Then ∥FM(b^−b)∥∞≤∥b^−b∥1≤βμ\lVert F_M(\hat b - b) \rVert_\infty \le \lVert \hat b - b \rVert_1 \le \beta \mu, and ∥e2∥∞≤∥e2∥2≤εMMβ\lVert e_2 \rVert_\infty \le \lVert e_2 \rVert_2 \le \varepsilon_M \sqrt M \sqrt \beta. Since M<2βM < 2\beta, Mβ<2β\sqrt{M \beta} < \sqrt 2 \beta, so ∥B^−B∥∞≤β(μ+2εM)\lVert \hat B - B \rVert_\infty \le \beta(\mu + \sqrt 2 \varepsilon_M).

Step 3 (line L5, the data). Write A^=FMa^+e1\hat A = F_M \hat a + e_1 with ∥e1∥≤εMM∥a^∥\lVert e_1 \rVert \le \varepsilon_M \sqrt M \lVert \hat a \rVert. Then ∥A^−A∥≤M∥a^−a∥+∥e1∥≤M(δ+εM)∥x∥\lVert \hat A - A \rVert \le \sqrt M \lVert \hat a - a \rVert + \lVert e_1 \rVert \le \sqrt M (\delta + \varepsilon_M) \lVert x \rVert, and ∥A∥=M∥x∥\lVert A \rVert = \sqrt M \lVert x \rVert.

Step 4 (line L6). With P=A⊙BP = A \odot B and P^r=A^rB^r(1+ϵr)\hat P_r = \hat A_r \hat B_r (1 + \epsilon_r),

P^−P=(A^−A)⊙B^+A⊙(B^−B)+ϵ⊙A^⊙B^,\hat P - P = (\hat A - A) \odot \hat B + A \odot (\hat B - B) + \epsilon \odot \hat A \odot \hat B,

so ∥P^−P∥≤∥A^−A∥∥B^∥∞+∥A∥∥B^−B∥∞+2γ2∥A^∥∥B^∥∞≤Mβ∥x∥(δ+μ+2γ2+(1+2)εM)\lVert \hat P - P \rVert \le \lVert \hat A - A \rVert \lVert \hat B \rVert_\infty + \lVert A \rVert \lVert \hat B - B \rVert_\infty + \sqrt 2 \gamma_2 \lVert \hat A \rVert \lVert \hat B \rVert_\infty \le \sqrt M \beta \lVert x \rVert \left(\delta + \mu + \sqrt 2 \gamma_2 + (1 + \sqrt 2) \varepsilon_M\right). Also ∥P∥≤βM∥x∥\lVert P \rVert \le \beta \sqrt M \lVert x \rVert.

Step 5 (line L7). z^=FM−1P^+e3\hat z = F_M^{-1} \hat P + e_3 with ∥e3∥≤εM∥P^∥/M≤εMβ∥x∥\lVert e_3 \rVert \le \varepsilon_M \lVert \hat P \rVert / \sqrt M \le \varepsilon_M \beta \lVert x \rVert. Since z=FM−1Pz = F_M^{-1} P, ∥z^−z∥≤∥P^−P∥/M+∥e3∥≤β∥x∥(2μ+22γ2+(2+2)εM)\lVert \hat z - z \rVert \le \lVert \hat P - P \rVert / \sqrt M + \lVert e_3 \rVert \le \beta \lVert x \rVert \left(2\mu + 2\sqrt 2 \gamma_2 + (2 + \sqrt 2) \varepsilon_M\right), using δ=μ+2γ2\delta = \mu + \sqrt 2 \gamma_2.

Step 6 (line L8). For k<nk < n, ∣X^k−Xk∣≤∣c^kz^k−ckzk∣+2γ2∣c^kz^k∣≤∣z^k−zk∣+δ∣zk∣|\hat X_k - X_k| \le |\hat c_k \hat z_k - c_k z_k| + \sqrt 2 \gamma_2 |\hat c_k \hat z_k| \le |\hat z_k - z_k| + \delta |z_k|, and ∣zk∣=∣Xk∣|z_k| = |X_k| because Xk=ckzkX_k = c_k z_k with ∣ck∣=1|c_k| = 1. Summing in the Euclidean norm over k<nk < n and using Step 5 gives the bound.

Finally ∥X∥2=n∥x∥2\lVert X \rVert_2 = \sqrt n \lVert x \rVert_2 by Parseval's identity for FnF_n, and β/n<2n\beta / \sqrt n < 2 \sqrt n, so the relative error is at most 2n(2μ+22γ2+(2+2)εM)+δ+O(u2)2\sqrt n \left(2\mu + 2\sqrt 2 \gamma_2 + (2 + \sqrt 2)\varepsilon_M\right) + \delta + O(u^2). ■\blacksquare

Back to Bluestein's algorithm