理解FFT算法 (2013)
Understanding the FFT Algorithm (2013)

原始链接: https://jakevdp.github.io/blog/2013/08/28/understanding-the-fft/

离散傅里叶变换 (DFT) 可以通过分治策略得到显著优化。 最初,DFT 被拆分为两个较小的 DFT——一个处理偶数索引数据,另一个处理奇数索引数据。 虽然这种拆分最初并不能提高效率(仍然是 O[N²]),但利用这些子问题中的对称性可以将每个子问题的计算量减少一半,从而有效地将问题规模减半至 O[M²],其中 M = N/2。 这个过程会递归地应用于这些较小的 DFT,*只要*问题规模保持偶数,就会不断地将计算成本减半。 这种递归减半持续进行,直到子问题足够小,可以直接有效地求解。 结果是规模上的显著改进:从 O[N²] 到渐近复杂度 **O[N log N]**,使其成为处理大型数据集的更快算法。 这可以在像 Python 这样的语言中有效地实现,利用原始 DFT 代码来解决小的子问题。

理解FFT算法 (2013) (jakevdp.github.io) 9点 由 peter_d_sherman 2小时前 | 隐藏 | 过去 | 收藏 | 1条评论 帮助 medbar 8分钟前 [–] 对于任何感兴趣且有30分钟时间的人,我推荐Reducible的youtube视频[1],以了解FFT的工作原理。[1]: https://youtu.be/h7apO7q16V0 回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请YC | 联系 搜索:
相关文章

原文

We've split the single Discrete Fourier transform into two terms which themselves look very similar to smaller Discrete Fourier Transforms, one on the odd-numbered values, and one on the even-numbered values. So far, however, we haven't saved any computational cycles. Each term consists of $(N/2)*N$ computations, for a total of $N^2$.

The trick comes in making use of symmetries in each of these terms. Because the range of $k$ is $0 \le k < N$, while the range of $n$ is $0 \le n < M \equiv N/2$, we see from the symmetry properties above that we need only perform half the computations for each sub-problem. Our $\mathcal{O}[N^2]$ computation has become $\mathcal{O}[M^2]$, with $M$ half the size of $N$.

But there's no reason to stop there: as long as our smaller Fourier transforms have an even-valued $M$, we can reapply this divide-and-conquer approach, halving the computational cost each time, until our arrays are small enough that the strategy is no longer beneficial. In the asymptotic limit, this recursive approach scales as $\mathcal{O}[N\log N]$.

This recursive algorithm can be implemented very quickly in Python, falling-back on our slow DFT code when the size of the sub-problem becomes suitably small:

联系我们 contact @ memedata.com