Algorithm Search⌘K

Proofs: Nonuniform FFT

These are the human proofs of Nonuniform FFT, at full length.

The Gaussian NUFFT of types 1 and 2 has error at most ε times the 1-norm of the input, in O(n log n + m log(1/ε)) operations full

This proof shows: correctness, complexity.

Setting. Exact real arithmetic. Let n≥1n \ge 1, 0<ε≤1/20 < \varepsilon \le 1/2, and M,N,τM, N, \tau as on the page: M=max⁡(2,⌈32πln⁡(4/ε)⌉)M = \max(2, \lceil \frac{3}{2\pi} \ln(4/\varepsilon) \rceil), NN the least power of two with N≥max⁡(2n,2M)N \ge \max(2n, 2M), τ=πM/(N(N−n/2))\tau = \pi M / (N(N - n/2)). Put h=2π/Nh = 2\pi/N, s=⌊n/2⌋s = \lfloor n/2 \rfloor, R=N/n≥2R = N/n \ge 2, G(x)=e−x2/(4τ)G(x) = e^{-x^2/(4\tau)}, and for points tjt_j let xj=2π(tj mod 1)x_j = 2\pi (t_j \bmod 1). Write e(t)=e−2πite(t) = e^{-2\pi i t} and AA for the m×nm \times n matrix Ajk=e(ktj)A_{jk} = e(k t_j).

Statement. NUFFT-TYPE-1 returns X~\tilde X with ∣X~k−(ATc)k∣≤4e−2πM/3∥c∥1≤ε∥c∥1|\tilde X_k - (A^{\mathsf T} c)_k| \le 4 e^{-2\pi M/3} \lVert c \rVert_1 \le \varepsilon \lVert c \rVert_1 for 0≤k<n0 \le k < n, and the type 2 procedure of the page returns y~\tilde y with ∣y~j−(Af)j∣≤ε∥f∥1|\tilde y_j - (A f)_j| \le \varepsilon \lVert f \rVert_1. Both use O(Nlog⁡N+mM)O(N \log N + mM) arithmetic operations and O(mM+n)O(mM + n) exponentials.

Lemma 1 (the kernel). The 2π2\pi-periodic function gτ(x)=∑p∈ZG(x−2πp)g_\tau(x) = \sum_{p \in \mathbb{Z}} G(x - 2\pi p) satisfies gτ(x)=∑κ∈Zg^(κ)eiκxg_\tau(x) = \sum_{\kappa \in \mathbb{Z}} \hat g(\kappa) e^{i\kappa x} for all xx, with g^(κ)=τ/π e−τκ2\hat g(\kappa) = \sqrt{\tau/\pi}\, e^{-\tau\kappa^2}, and the series converges absolutely.

Proof. The sum defining gτg_\tau converges uniformly with all derivatives, so gτg_\tau is smooth and periodic, and its Fourier series converges to it absolutely. Its coefficients are 12π∫02π∑pG(x−2πp)e−iκx dx=12π∫RG(x)e−iκx dx=12π4πτ e−τκ2\frac{1}{2\pi} \int_0^{2\pi} \sum_p G(x - 2\pi p) e^{-i\kappa x}\, dx = \frac{1}{2\pi} \int_{\mathbb{R}} G(x) e^{-i\kappa x}\, dx = \frac{1}{2\pi} \sqrt{4\pi\tau}\, e^{-\tau\kappa^2}, by the Gaussian integral ∫Re−x2/(4τ)e−iκx dx=4πτ e−τκ2\int_{\mathbb{R}} e^{-x^2/(4\tau)} e^{-i\kappa x}\, dx = \sqrt{4\pi\tau}\, e^{-\tau\kappa^2}. □\square

Lemma 2 (the spread values). For 0≤j<m0 \le j < m let l0=⌊xj/h⌋l_0 = \lfloor x_j/h \rfloor and Wj={l0−M+1,…,l0+M}W_j = \{l_0 - M + 1, \ldots, l_0 + M\}. Since 2M≤N2M \le N, the elements of WjW_j are distinct modulo NN. Line L5 adds to vlv_{l}, for l∈[0,N)l \in [0, N), the amount bj∑L∈Wj, L≡lG(Lh−xj)b_j \sum_{L \in W_j,\, L \equiv l} G(Lh - x_j). The full periodic kernel would add bjgτ(lh−xj)=bj∑L≡l (N)G(Lh−xj)b_j g_\tau(lh - x_j) = b_j \sum_{L \equiv l \ (N)} G(Lh - x_j), since lh−2πp=(l−pN)hlh - 2\pi p = (l - pN)h. So the omitted amount is bj∑L∉Wj, L≡lG(Lh−xj)b_j \sum_{L \notin W_j,\, L \equiv l} G(Lh - x_j), and summed over ll its absolute value is at most

∣bj∣∑L∉WjG(Lh−xj)≤2∣bj∣∑q≥0G((M+q)h)≤2∣bj∣ G(Mh)1−e−Mh2/(2τ).|b_j| \sum_{L \notin W_j} G(Lh - x_j) \le 2 |b_j| \sum_{q \ge 0} G((M + q) h) \le \frac{2 |b_j|\, G(Mh)}{1 - e^{-Mh^2/(2\tau)}}.

Proof of the bounds. Since l0h≤xj<(l0+1)hl_0 h \le x_j < (l_0 + 1) h, the omitted L=l0−M−qL = l_0 - M - q (q≥0q \ge 0) have xj−Lh≥(M+q)hx_j - Lh \ge (M + q) h, and the omitted L=l0+M+1+qL = l_0 + M + 1 + q have Lh−xj>(M+q)hLh - x_j > (M + q) h. GG decreases in ∣x∣|x|, which gives the first inequality. For the second, (M+q)2≥M2+2Mq(M + q)^2 \ge M^2 + 2Mq, so G((M+q)h)≤G(Mh) (e−Mh2/(2τ))qG((M+q)h) \le G(Mh)\, (e^{-Mh^2/(2\tau)})^q, and the geometric series sums. □\square

Lemma 3 (aliasing). Let vlfull=∑jbj gτ(lh−xj)v^{\mathrm{full}}_l = \sum_j b_j\, g_\tau(lh - x_j) and Vrfull=∑l<Nvlfull ωNlrV^{\mathrm{full}}_r = \sum_{l<N} v^{\mathrm{full}}_l\, \omega_N^{lr}. Then for every integer κ\kappa,

Vκ mod Nfull=N∑q∈Zg^(κ+qN)∑jbje−i(κ+qN)xj.V^{\mathrm{full}}_{\kappa \bmod N} = N \sum_{q \in \mathbb{Z}} \hat g(\kappa + qN) \sum_j b_j e^{-i(\kappa + qN) x_j}.

Proof. By Lemma 1, vlfull=∑jbj∑pg^(p)eip(lh−xj)v^{\mathrm{full}}_l = \sum_j b_j \sum_p \hat g(p) e^{ip(lh - x_j)}. With r=κ mod Nr = \kappa \bmod N, ωNlr=e−irlh\omega_N^{lr} = e^{-i r l h}, so Vrfull=∑jbj∑pg^(p)e−ipxj∑l<Nei(p−r)lhV^{\mathrm{full}}_r = \sum_j b_j \sum_p \hat g(p) e^{-ipx_j} \sum_{l<N} e^{i(p - r) l h}, exchanging finite sums with an absolutely convergent one. The inner sum is a geometric sum of NN-th roots of unity, equal to NN if p≡r≡κ(modN)p \equiv r \equiv \kappa \pmod N and 00 otherwise. Writing p=κ+qNp = \kappa + qN gives the claim. □\square

Type 1. Fix 0≤k<n0 \le k < n and κ=k−s\kappa = k - s, so ∣κ∣≤n/2|\kappa| \le n/2. Since ss is an integer, e(stj)=e−isxje(s t_j) = e^{-isx_j}, so bj=cje−isxjb_j = c_j e^{-isx_j} (line L4) and ∑jbje−iκxj=∑jcje−ikxj=Xk\sum_j b_j e^{-i\kappa x_j} = \sum_j c_j e^{-ikx_j} = X_k. Line L6 computes V=DFTN(v)V = \mathrm{DFT}_N(v) and line L8 sets X~k=Vκ mod N/(Ng^(κ))\tilde X_k = V_{\kappa \bmod N} / (N \hat g(\kappa)), because π/τ eτκ2=1/g^(κ)\sqrt{\pi/\tau}\, e^{\tau\kappa^2} = 1/\hat g(\kappa). By Lemma 3 and linearity, X~k−Xk=Ealias−Etrunc\tilde X_k - X_k = E_{\mathrm{alias}} - E_{\mathrm{trunc}}, where

Ealias=∑q≠0g^(κ+qN)g^(κ)∑jbje−i(κ+qN)xj,Etrunc=(Vfull−V)κ mod NNg^(κ).E_{\mathrm{alias}} = \sum_{q \ne 0} \frac{\hat g(\kappa + qN)}{\hat g(\kappa)} \sum_j b_j e^{-i(\kappa + qN) x_j}, \qquad E_{\mathrm{trunc}} = \frac{(V^{\mathrm{full}} - V)_{\kappa \bmod N}}{N \hat g(\kappa)}.

Aliasing. For q≠0q \ne 0, (κ+qN)2−κ2=q2N2+2qκN≥∣q∣N(∣q∣N−n)≥∣q∣N(N−n)(\kappa + qN)^2 - \kappa^2 = q^2N^2 + 2q\kappa N \ge |q| N (|q| N - n) \ge |q| N (N - n), using ∣κ∣≤n/2|\kappa| \le n/2. So g^(κ+qN)/g^(κ)≤ρ∣q∣\hat g(\kappa + qN)/\hat g(\kappa) \le \rho^{|q|} with ρ=e−τN(N−n)\rho = e^{-\tau N (N - n)}, and ∣Ealias∣≤∥c∥1⋅2ρ/(1−ρ)|E_{\mathrm{alias}}| \le \lVert c \rVert_1 \cdot 2\rho/(1 - \rho), since ∣bj∣=∣cj∣|b_j| = |c_j|. Here τN(N−n)=πM(R−1)/(R−12)\tau N (N - n) = \pi M (R - 1)/(R - \frac12), which increases with RR and is 23πM\frac23 \pi M at R=2R = 2; so ρ≤e−2πM/3≤e−4π/3<0.016\rho \le e^{-2\pi M/3} \le e^{-4\pi/3} < 0.016 and ∣Ealias∣≤2.04 e−2πM/3∥c∥1|E_{\mathrm{alias}}| \le 2.04\, e^{-2\pi M/3} \lVert c \rVert_1.

Truncation. ∣(Vfull−V)r∣≤∑l∣vlfull−vl∣|(V^{\mathrm{full}} - V)_r| \le \sum_l |v^{\mathrm{full}}_l - v_l|, which by Lemma 2 is at most 2∥c∥1G(Mh)/(1−e−Mh2/(2τ))2\lVert c \rVert_1 G(Mh)/(1 - e^{-Mh^2/(2\tau)}). Now compute with the chosen τ\tau: M2h24τ=πM(1−12R)\frac{M^2h^2}{4\tau} = \pi M (1 - \frac{1}{2R}), Mh22τ=2π(1−12R)≥3π2\frac{Mh^2}{2\tau} = 2\pi (1 - \frac{1}{2R}) \ge \frac{3\pi}{2}, and 1Ng^(κ)=πτeτκ2N≤1−1/(2R)M  eτn2/4≤12eτn2/4\frac{1}{N \hat g(\kappa)} = \sqrt{\frac{\pi}{\tau}} \frac{e^{\tau\kappa^2}}{N} \le \sqrt{\frac{1 - 1/(2R)}{M}}\; e^{\tau n^2/4} \le \frac{1}{\sqrt 2} e^{\tau n^2/4} with τn24=πM4R(R−12)\frac{\tau n^2}{4} = \frac{\pi M}{4R(R - \frac12)}. Hence ∣Etrunc∣≤22 (1−e−3π/2) e−β∥c∥1≤1.43 e−β∥c∥1|E_{\mathrm{trunc}}| \le \frac{2}{\sqrt2\,(1 - e^{-3\pi/2})}\, e^{-\beta} \lVert c \rVert_1 \le 1.43\, e^{-\beta} \lVert c \rVert_1, where β=πM(1−12R−14R(R−1/2))\beta = \pi M \bigl(1 - \frac{1}{2R} - \frac{1}{4R(R - 1/2)}\bigr). The bracket increases with RR and equals 34−112=23\frac34 - \frac1{12} = \frac23 at R=2R = 2, so e−β≤e−2πM/3e^{-\beta} \le e^{-2\pi M/3}.

Total. ∣X~k−Xk∣≤(2.04+1.43) e−2πM/3∥c∥1≤4e−2πM/3∥c∥1|\tilde X_k - X_k| \le (2.04 + 1.43)\, e^{-2\pi M/3} \lVert c \rVert_1 \le 4 e^{-2\pi M/3} \lVert c \rVert_1. Since M≥32πln⁡(4/ε)M \ge \frac{3}{2\pi}\ln(4/\varepsilon), e−2πM/3≤ε/4e^{-2\pi M/3} \le \varepsilon/4, so the error is at most ε∥c∥1\varepsilon \lVert c \rVert_1.

Type 2. Let Φ=diag(e(stj))\Phi = \mathrm{diag}(e(s t_j)), let SS be the N×mN \times m matrix with Slj=∑L∈Wj, L≡lG(Lh−xj)S_{lj} = \sum_{L \in W_j,\, L \equiv l} G(Lh - x_j), FF the DFT matrix of order NN, Flr=ωNlrF_{lr} = \omega_N^{lr}, which is symmetric, and DD the n×Nn \times N matrix with Dk,(k−s) mod N=1/(Ng^(k−s))D_{k, (k - s) \bmod N} = 1/(N \hat g(k - s)) and zeros elsewhere (the indices (k−s) mod N(k - s) \bmod N are distinct because n≤Nn \le N). Type 1 computes BcB c with B=DFSΦB = D F S \Phi, and type 2, as defined on the page, computes ΦSTFDTf=BTf\Phi S^{\mathsf T} F D^{\mathsf T} f = B^{\mathsf T} f, because Φ\Phi is diagonal and FF symmetric. Taking cc to be the jj-th unit vector in the type 1 bound gives ∣Bkj−Ajk∣≤ε|B_{kj} - A_{jk}| \le \varepsilon for all j,kj, k. Hence ∣(BTf−Af)j∣=∣∑k(Bkj−Ajk)fk∣≤ε∥f∥1|(B^{\mathsf T} f - A f)_j| = |\sum_k (B_{kj} - A_{jk}) f_k| \le \varepsilon \lVert f \rVert_1.

Operation count. Lines L3 to L5 do, per point, one complex exponential, 2M2M real exponentials, 2M2M products of a complex by a real number, 2M2M complex additions and O(M)O(M) real operations for the arguments Lh−xLh - x: O(mM)O(mM) in all. Line L6 is a radix-2 FFT of length NN, N2lg⁡N\frac N2 \lg N complex multiplications and Nlg⁡NN \lg N complex additions. Lines L7 and L8 do nn exponentials and O(n)O(n) multiplications. Type 2 performs the same operations in reverse order. Since M=O(log⁡(1/ε))M = O(\log(1/\varepsilon)) and N≤4max⁡(n,M)N \le 4\max(n, M), the total is O(nlog⁡n+mlog⁡(1/ε)+log⁡(1/ε)log⁡log⁡(1/ε))O(n \log n + m \log(1/\varepsilon) + \log(1/\varepsilon) \log\log(1/\varepsilon)), and the extra space is the grid of NN entries plus the output. ■\blacksquare

Back to Nonuniform FFT