using dsp::RealFFT

I am using dsp::RealFFT but I don’t like how I am initializing it, though it works. I could only get it to initialize in the process function as follows:

void process(const ProcessArgs& args) override { dsp::RealFFT outFFT(SIZE); …do stuff }

Seems like a bad idea to call that repeatedly. I’ve tried to declare it with the other variables for my module and initialize it in the constructor, but it gives errors like:

error: unknown type name ‘SIZE’ 54 | dsp::RealFFT outFFT(SIZE);

SIZE is declared before this call as: static const int SIZE = 2048;

Any ideas? Thanks!

why not look at one of the VCV Fundamental plugins that use it and copy what they do?

1 Like

Thanks. I looked again and found noise uses an extra Struct for FFT processing. It is constructed there and called by the main processing loop for fft operations. I made the change and module cpu utilization dropped off dramatically, as I was hoping.

2 Likes