# 快速傅里叶变换

快速傅里叶变换（FFT）是一族算法，用于在约 N log₂ N 次运算内计算 N 个数据点的离散傅里叶变换（DFT），而直接计算该变换需要 O(N²) 次运算。<sup>[1](https://faculty.washington.edu/seattle/brain-physics/FFT/history.pdf)</sup> DFT 将复值向量从时域映射到其频域表示，<sup>[2](https://docs.nvidia.com/cuda/cufft/index.html?highlight=plan)</sup> FFT 则利用傅里叶矩阵的结构，把相应的矩阵-向量乘积从二次时间降到准线性时间。<sup>[3](https://homepages.math.uic.edu/~jan/mcs472/mcs472notes/lec10.html)</sup> 它是计算物理和信号处理中使用最广泛的数值算法之一。<sup>[2](https://docs.nvidia.com/cuda/cufft/index.html?highlight=plan)</sup>

| 关键事实 | 细节 |
|---|---|
| 计算内容 | 对 N 个输入样本计算离散傅里叶变换 \( X_{k} = \sum_{n=0}^{N-1} x_{n} e^{-2\pi i kn/N} \)<sup>[2](https://docs.nvidia.com/cuda/cufft/index.html?highlight=plan)</sup> |
| 复杂度 | 约 N log₂ N 次运算，直接计算则为 N²；通常称为准线性时间<sup>[1](https://faculty.washington.edu/seattle/brain-physics/FFT/history.pdf)</sup><sup> • </sup><sup>[3](https://homepages.math.uic.edu/~jan/mcs472/mcs472notes/lec10.html)</sup> |
| 里程碑文献 | 库利与图基，《一种用于机器计算复傅里叶级数的算法》，《计算数学》19 (90)，297–301（1965）；1964 年 8 月 17 日收稿<sup>[4](https://web.stanford.edu/class/cme324/classics/cooley-tukey.pdf)</sup> |
| 实测加速 | 1964 年在 IBM 7094 上，当 N = 2048、4096、8192 时，复数运算量分别约减少为原来的 1/186、1/341 和 1/630<sup>[5](https://ethw.org/Milestones%3AFirst_Demonstration_of_the_Fast_Fourier_Transform_%28FFT%29%2C_1964)</sup> |
| 核心机制 | 分治递归配合蝶形合并步骤，共 log₂ N 层，每层代价为 O(N)<sup>[6](https://www.cs.cmu.edu/~15322/book/ch08/05.html)</sup> |
| 实用尺寸 | 含小质因子的变换尺寸运行最快；cuFFT 针对 \( 2^{a} \times 3^{b} \times 5^{c} \times 7^{d} \) 形式的尺寸进行优化<sup>[2](https://docs.nvidia.com/cuda/cufft/index.html?highlight=plan)</sup> |
| 主要应用 | 频谱分析、卷积与多项式乘法、MRI 图像重建，以及多媒体和无线信号处理<sup>[7](https://www.nist.gov/publications/fast-fourier-transform-experimentalists-part-iii-classical-spectral-estimates)</sup><sup> • </sup><sup>[8](https://pmc.ncbi.nlm.nih.gov/articles/PMC4276738/)</sup><sup> • </sup><sup>[6](https://www.cs.cmu.edu/~15322/book/ch08/05.html)</sup> |

## 算法原理

最著名的 FFT——库利-图基算法——是一种分治方法。基-2 版本将 N 点变换拆分为偶数下标样本和奇数下标样本的两个半长变换，再用称为“蝶形”的合并步骤把两个结果合起来。当 N = 8 时，每对输出按 \( X[k] = E[k] + W_N^k\, O[k] \) 和 \( X[k+4] = E[k] - W_N^k\, O[k] \) 构成，其中 \( W_N^k = e^{-2\pi j k / N} \) 是旋转因子。合并步骤代价为 O(N)，递归到单点变换共 log₂ N 层，总计 O(N log N)。<sup>[6](https://www.cs.cmu.edu/~15322/book/ch08/05.html)</sup>

相比直接计算，FFT 的优势不仅在渐近意义上，在实践中也很显著。对于 4096 个样本的窗口，O(N²) 与 O(N log N) 的差别约为 1600 万次运算对约 5 万次运算。<sup>[6](https://www.cs.cmu.edu/~15322/book/ch08/05.html)</sup> 库利与图基的原始论文指出，该算法在不到 2N log₂ N 次运算内给出结果，且所需数据存储不超过输入数组本身。<sup>[4](https://web.stanford.edu/class/cme324/classics/cooley-tukey.pdf)</sup> 由于执行时间主要取决于算术运算，而 FFT 把这些运算量削减了与 N / log N 成正比的一个因子，因此论文发表后，在几乎所有能运行该算法的计算机上都能获得这一量级的加速。<sup>[5](https://ethw.org/Milestones%3AFirst_Demonstration_of_the_Fast_Fourier_Transform_%28FFT%29%2C_1964)</sup>

逆变换不需要单独的快速算法：由于 \( F^{-1}_n = \overline{F}_n \)，逆变换可按 \( \overline{F_n \overline{y}} \) 计算，复用正向算法。<sup>[3](https://homepages.math.uic.edu/~jan/mcs472/mcs472notes/lec10.html)</sup>

## 历史

1965 年库利与图基描述他们的算法时，许多了解内情的人都视之为新事物，认为傅里叶分析需要与 N² 成正比的运算量。针对这篇论文，斯克里普斯海洋研究所的 P. 鲁德尼克描述了一个运算量同为 N log₂ N 的计算机程序，其基础是丹尼尔森与兰乔斯 1942 年发表的方法。<sup>[1](https://faculty.washington.edu/seattle/brain-physics/FFT/history.pdf)</sup> 计算史研究者还发现，早在那之前，卡尔·弗里德里希·高斯就曾为计算有限傅里叶级数的系数设计过一种类似 FFT 的算法；迈克尔·T. 海德曼、唐·H. 约翰逊和 C. 西德尼·伯鲁斯（当时分别是莱斯大学和洛克希德公司的电气工程研究人员）1984 年的论文记录下了这段前史。<sup>[9](https://nonagon.org/ExLibris/sites/default/files/pdf/Gauss-History-FFT.pdf)</sup>

1965 年的算法本身是 1964 年在 IBM 7094 计算机上开发并用 FORTRAN 编写的，库利与图基运行了 N = 2048、4096 和 8192 的算例。<sup>[5](https://ethw.org/Milestones%3AFirst_Demonstration_of_the_Fast_Fourier_Transform_%28FFT%29%2C_1964)</sup> 一块 IEEE 里程碑铭牌将 1964 年的演示纪念为 FFT 的首次实际演示。<sup>[5](https://ethw.org/Milestones%3AFirst_Demonstration_of_the_Fast_Fourier_Transform_%28FFT%29%2C_1964)</sup>

## 算法变体

没有哪一种 FFT 算法对所有尺寸都是最优的，因此实用库会组合使用多种算法。库利-图基方法适用于 N 为合数的情况，不一定是 2 的幂。<sup>[1](https://faculty.washington.edu/seattle/brain-physics/FFT/history.pdf)</sup> FFTW（西方最快傅里叶变换）实现了多种算法：库利-图基、质因子算法、尺寸为质数时的雷德算法，以及经丹尼尔·J. 伯恩斯坦修改的分裂基方案。<sup>[10](https://fftw.org/fftw2_doc/fftw_1.html)</sup>

GPU 库也明确做出同样的选择。NVIDIA 的 cuFFT 实现了基-2、基-3、基-5 和基-7 构建块，对 \( 2^{a} \times 3^{b} \times 5^{c} \times 7^{d} \) 形式的任意尺寸进行优化，为小于 128 的其他质数提供基-m 块，并在长度无法如此分解时回退到布卢斯坦算法。<sup>[2](https://docs.nvidia.com/cuda/cufft/index.html?highlight=plan)</sup>

## 软件库

FFTW 由马泰奥·弗里戈和史蒂文·G. 约翰逊在 MIT 开发，是一个广泛使用的自由软件 C 库，可计算任意尺寸、一维或多维、实数与复数数据、以及偶/奇数据（离散余弦和正弦变换）的 DFT。<sup>[11](https://www.fftw.org/?trk=public_post-text)</sup> 它的显著特点是运行时规划器：测量众多候选方案的实际速度，为主机硬件挑选最快者；简单的子问题由称为“小代码块”的优化直线代码片段执行，这些小代码块由专用编译器生成。<sup>[12](https://fftw.org/fftw-paper-ieee.pdf)</sup> FFTW 获得了 1999 年 J. H. 威尔金森数值软件奖，其论文《一种快速傅里叶变换编译器》于 2009 年获得最具影响力 PLDI 论文奖。<sup>[11](https://www.fftw.org/?trk=public_post-text)</sup> cuFFT 的 API 仿照 FFTW，NVIDIA 提供与 FFTW 兼容的接口，作为迁移到 GPU 的途径。<sup>[2](https://docs.nvidia.com/cuda/cufft/index.html?highlight=plan)</sup>

由于浮点运算并不精确，不同的 FFT 算法给出的结果略有差异，双精度下典型的相对差异在 10⁻¹⁵ 量级。<sup>[13](https://www.fftw.org/faq/section3.html)</sup>

## 选择变换尺寸

FFT 的速度在很大程度上取决于长度的质因数分解。SciPy 的 FFT 算法从递归分治中获得速度，而分治依赖于对小质因数的高效处理，因此当长度可分解为所支持的基的乘积时变换最快。<sup>[14](https://docs.scipy.org/doc/scipy/reference/generated/scipy.fft.next_fast_len.html)</sup> SciPy 文档量化了在一台机器上的效果：质数长度 93059 的 FFT 耗时 11.4 毫秒，补零到下一个快速长度 93312 后降至 1.6 毫秒，加速 7.3 倍；而上取到下一个 2 的幂 131072 则耗时 3.0 毫秒，耗时约为 `next_fast_len` 所选尺寸的 1.9 倍。<sup>[14](https://docs.scipy.org/doc/scipy/reference/generated/scipy.fft.next_fast_len.html)</sup> 补零是在末尾追加零值样本，以增大有效变换尺寸和输出频点数量，而不增加关于信号的新信息。<sup>[15](https://github.com/dmccreary/fft-benchmarking/blob/main/docs/chapters/15-windowing-spectral-leakage-and-peak-detection/index.md)</sup>

## 实践考量：泄漏与加窗

DFT 把采样信号当作周期延拓来处理，记录两端的间断会产生频谱泄漏，即在真实谱峰附近出现虚假分量。泄漏无法完全消除，但在变换前施加窗函数可将其最小化，通常以频率分辨率为代价。汉宁窗消除了端点间断；每次施加可使旁瓣衰减 12 dB/倍频程，并使主瓣展宽 2Δf。<sup>[16](https://tf.nist.gov/phase/Properties/ten.htm)</sup> 基于 FFT 的实验指南还涵盖补零、混叠和用于估计实测时间序列功率谱与振幅谱的锥形窗。<sup>[7](https://www.nist.gov/publications/fast-fourier-transform-experimentalists-part-iii-classical-spectral-estimates)</sup>

## 应用

FFT 是数字信号处理诸多领域的基础，包括音频分析、多媒体压缩和无线通信。<sup>[6](https://www.cs.cmu.edu/~15322/book/ch08/05.html)</sup> 借助 DFT 的卷积性质，频域中的逐分量相乘等于时域中的卷积，因此 FFT 将一次卷积的代价从 O(n²) 降到 O(n log n)；这是快速多项式乘法和滤波的基础。<sup>[3](https://homepages.math.uic.edu/~jan/mcs472/mcs472notes/lec10.html)</sup>

在磁共振成像中，原始数据在称为 k 空间的空频域中采集，对于笛卡尔网格上的样本，可用 FFT 高效重建图像；偏离直线网格的采样模式（如螺旋成像）需要非均匀 FFT，通常用网格化算法实现。<sup>[8](https://pmc.ncbi.nlm.nih.gov/articles/PMC4276738/)</sup> FFT 也长期用于行星雷达测高之类的频谱处理，在那里它用于计算多普勒回波信号的傅里叶系数。<sup>[17](https://ntrs.nasa.gov/api/citations/19710027072/downloads/19710027072.pdf)</sup>

## References

1. [J. W. Cooley, P. A. W. Lewis, and P. D. Welch, "Historical Notes on the Fast Fourier Transform," IEEE Transactions on Audio and Electroacoustics](https://faculty.washington.edu/seattle/brain-physics/FFT/history.pdf)
2. [cuFFT documentation, NVIDIA CUDA Toolkit](https://docs.nvidia.com/cuda/cufft/index.html?highlight=plan)
3. [The Fast Fourier Transform, MCS 472 lecture notes, University of Illinois Chicago](https://homepages.math.uic.edu/~jan/mcs472/mcs472notes/lec10.html)
4. [J. W. Cooley and J. W. Tukey, "An Algorithm for the Machine Calculation of Complex Fourier Series," Mathematics of Computation 19 (90), 297–301 (1965)](https://web.stanford.edu/class/cme324/classics/cooley-tukey.pdf)
5. [Milestones: First Demonstration of the Fast Fourier Transform (FFT), 1964, Engineering and Technology History Wiki](https://ethw.org/Milestones%3AFirst_Demonstration_of_the_Fast_Fourier_Transform_%28FFT%29%2C_1964)
6. [8.5 The Fast Fourier Transform, CMU Intro to Computer Music](https://www.cs.cmu.edu/~15322/book/ch08/05.html)
7. [D. Donnelly and B. Rust, "The Fast Fourier Transform for Experimentalists Part III: Classical Spectral Estimates," Computing in Science & Engineering 7 (5), 2005, NIST](https://www.nist.gov/publications/fast-fourier-transform-experimentalists-part-iii-classical-spectral-estimates)
8. [Image reconstruction: an overview for clinicians, PMC](https://pmc.ncbi.nlm.nih.gov/articles/PMC4276738/)
9. [M. T. Heideman, D. H. Johnson, and C. S. Burrus, "Gauss and the History of the Fast Fourier Transform" (1984)](https://nonagon.org/ExLibris/sites/default/files/pdf/Gauss-History-FFT.pdf)
10. [FFTW 2.1.5 manual, Introduction](https://fftw.org/fftw2_doc/fftw_1.html)
11. [FFTW Home Page](https://www.fftw.org/?trk=public_post-text)
12. [M. Frigo and S. G. Johnson, "The Design and Implementation of FFTW3," Proceedings of the IEEE 93 (2), 216–231 (2005)](https://fftw.org/fftw-paper-ieee.pdf)
13. [FFTW FAQ, Section 3](https://www.fftw.org/faq/section3.html)
14. [scipy.fft.next_fast_len, SciPy v1.18.0 Manual](https://docs.scipy.org/doc/scipy/reference/generated/scipy.fft.next_fast_len.html)
15. [Windowing, spectral leakage, and peak detection, fft-benchmarking documentation](https://github.com/dmccreary/fft-benchmarking/blob/main/docs/chapters/15-windowing-spectral-leakage-and-peak-detection/index.md)
16. [Section Ten, NIST Time and Frequency Division, Properties](https://tf.nist.gov/phase/Properties/ten.htm)
17. [Fast Fourier Transform Processing, NASA Technical Reports Server](https://ntrs.nasa.gov/api/citations/19710027072/downloads/19710027072.pdf)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数学分析与数学模型 › Harmonic analysis, transforms, and integral equations

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/fast-fourier-transform

English original: https://www.edgepedia.org/fast-fourier-transform
