Menu

#116 [PATCH] Adding FFTW support speeds up spectrogram by factor of ten

None
open
nobody
None
5
2022-08-16
2017-03-04
Martin Guy
No

"sox spectrogram" has two custom FFT routines, a fast one for power-of-two DFTs (which in pratice is almost never used) and a much slower one for everything else.
FFTW3 is more than ten times as fast as the slower one, and the same speed as the fast one (well, taking 0.5s instead of 0.44s)

Example: src/soc src/monkey.wav -x 10000 -y1024 took 9.63 seconds of CPU
-y1025 took 0.37, -y1026 9.78 and -y1200 13.48.
With FFTW, -y1024 takes 0.94, -y1025 0.47, -y1026 0.48 and -y1200 0.67.

This becomes more important when using higher DFT sizes, not currently testable in mainline because of an arbitrary limit of 1200 on y_size.

1 Attachments

Discussion

  • Martin Guy

    Martin Guy - 2017-03-05

    This version (now!) applies cleanly to sox-14.4.2

     

    Last edit: Martin Guy 2022-08-16
  • Mans Rullgard

    Mans Rullgard - 2018-04-27

    Ticket moved from /p/sox/bugs/287/

     
  • Martin Guy

    Martin Guy - 2022-08-16

    This version adapts the patch to apply cleanly to current git master head 42b3557e

     

Log in to post a comment.