Alexander Kojevnikov | Blog

Faster Fast Fourier Transform

Spek logo Spek is already pretty fast at analyzing audio files and creating their spectrograms. Apparently, it can be made even faster!

A sizable chunk of processing time is spent calculating discrete Fourier transforms of audio samples. In this post I'm going to explore a few DFT libraries and compare their performance to what Spek is currently using.

This won't be a comprehensive overview of all available libraries. I'm going to benchmark only what Spek needs:

The list of candidates is surprisingly short:

The test setup is straightforward (the code is on GitHub in case you're curious):



As expected, djbfft is the slowest, using SIMD instructions does make things faster. I am however surprised how fast the FFTW is compared to avfft (approximately 60% faster!)

Conclusion: Next version of Spek will switch to FFTW.

Published: 2014-08-31

Tags: spek