TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Notes on Fast Fourier Transforms for Implementers

95 pointsby thxgabout 2 years ago

3 comments

amirhirschabout 2 years ago
Optimization is a bit different between an FFT algorithm running on a CPU architecture versus FPGA&#x2F;hardware implementation.<p>If you’re making a digital filter on FPGA you are going to be optimizing your structure with a DIF-FFT to produce out of order results followed by DIT-iFFT which accepts the out of order data. The arithmetic irregularities mentioned in the article about the DIF and split-radix structure don&#x27;t factor in the same when you control the hardware, the complex multiply is implemented with 3muls, and 5adds and twiddles are better computed than wasting transistors to store them.
tgvaughanabout 2 years ago
I remember attending a conference presentation back in the early 2000&#x27;s by one of the FFTW authors. They claimed that the mapping between architecture and optimal FT algorithm was complex enough that the only sensible approach was implementing several and empirically determining the best one at runtime.
评论 #35244377 未加载
评论 #35244653 未加载
ack_completeabout 2 years ago
I wrote an optimized FFT for fun a while ago and a lot of this is quite familiar. Optimized FFTs are a fascinating field with a long history. I wouldn&#x27;t recommend writing one from scratch for production instead of using an existing library, but it&#x27;s a good exercise.<p>Using a real-to-complex FFT is really significant for performance and important to start with, as it places some additional constraints on the main FFT. In particular, the butterfly needed in the r2c and c2r passes isn&#x27;t very amenable to working in bit-reversed order, so the trick of processing frequency domain in bit reversed order doesn&#x27;t necessarily work. It&#x27;s also important for comparison against the Fast Hartley Transform, which looks good performance-wise against a complex FFT but not against a real FFT.<p>I also found that radix-4 performed better than split-radix or conjugate pair FFT with SSE2&#x2F;AVX SIMD. Both the instruction and data flow is cleaner, and the CPU has an easier time flooding the FMA units with simple loops than the more chaotic data flow of SRFFT&#x2F;CPFFT. An FMA-based radix-4 loop can easily keep the FMA units at &gt;95% utilization.<p>For data ordering, the vector-interleaved format mentioned is indeed great for the main passes, but real&#x2F;imag interleaved turns out to have some benefits for the smallest butterflies. What worked best in my case was to do the deinterleave&#x2F;transpose as part of an initial radix-8 pass that also handled the bit reversal a cache line at a time.