Efficient real time spectrum graphing techniques?

DSP, Plug-in and Host development discussion.
Fender19
KVRist
282 posts since 30 Aug, 2012

Post Wed Aug 14, 2019 7:43 am

matt42 wrote:
Tue Aug 13, 2019 8:49 pm
Fender19 wrote:
Tue Aug 13, 2019 8:06 pm
4-6% CPU usage that some are stating here is not “light” IMO. Try to use a dozen plugins like that in a typical mixing scenario and see what happens!
Perhaps, but I wouldn't keep a dozen plugins open all displaying spectral graphs at the same time and, presumably, your plugin will only perform these calculations while the interface is open.
Excellent point - also good info for plugin USERs who like to keep lots of windows open! Thank you.

quikquak
KVRian
548 posts since 6 Aug, 2005 from England

Re: Efficient real time spectrum graphing techniques?

Post Wed Aug 14, 2019 7:46 am

But you're saying "FFTs are NOT light on resources" - have you tried Intel's IPP ?
Last edited by quikquak on Wed Aug 14, 2019 7:51 am, edited 2 times in total.

Fender19
KVRist
282 posts since 30 Aug, 2012

Re: Efficient real time spectrum graphing techniques?

Post Wed Aug 14, 2019 7:49 am

mystran wrote:
Wed Aug 14, 2019 1:24 am
Something that should probably be mentioned is that a typical text-book radix-2 can easily be a factor of 100 (or more) slower than a properly optimised FFT library.
Yes - this would explain why my observation that FFT was slow.

Do you have a source for good, efficient audio FFTs you could point me to?

Fender19
KVRist
282 posts since 30 Aug, 2012

Re: Efficient real time spectrum graphing techniques?

Post Wed Aug 14, 2019 7:49 am

quikquak wrote:
Wed Aug 14, 2019 7:46 am
But you're saying "FFTs are NOT light on resources" - have you tried Intel's IPP ?
Not yet but since you mentioned it I will!

quikquak
KVRian
548 posts since 6 Aug, 2005 from England

Re: Efficient real time spectrum graphing techniques?

Post Wed Aug 14, 2019 7:52 am

What I've done in the past is to call the FFT in the render thread using with whatever data is available at the time of rendering. Meanwhile the audio thread is filling up a short loop of data that I can read from in a write position going backwards fashion, guarranteeing there is no read/write clashes.

User avatar
vortico
KVRist
283 posts since 19 Jul, 2008

Re: Efficient real time spectrum graphing techniques?

Post Wed Aug 14, 2019 12:02 pm

Yes, don't write your own FFT implementation for production, unless of course you want to learn how it works, or if you have a very specific use case and know what you're doing.
In very rough order of performance, some of the best FFT libraries for CPUs are: Intel IPP (proprietary freeware binary-only), Apple vDSP (Mac only), FFTW (GPLv2+), KissFFT (BSD), Julien Pommier's pffft (MIT-ish license). With that said, all perform within a factor of 2 compared to each other.
VCV Rack open-source virtual modular synthesizer

Return to “DSP and Plug-in Development”