Would you be willing to provide your code and post it to the audio library? I am working on something that I want to be able to use the FFT to analyze on demand without taking up CPU when it is not needed. In general I would like to add a way to disable objects directly without needing to add a mixer beforehand. I am beginning on a large project with the audio library and will likely be posting a lot of new features and revisions very soon.
I'll be happy to let you have a copy of what I have right now, but please understand:
1) I am writing an extensive package of general DSP functions to extend the Audio library. The current version of the Async FFT is designed for 256 length complex (quadrature) inputs, and returns the magnitude-squared output. I am rewriting it to use the arm_math radix-2 fft functions, with real and complex inputs, together with varying radix-2 lengths. I have also written (In the past few days FFT functions based on the old tricks of computing two independent real FFTs in a single complex FFT, and computing a single length 2N real FFT in a single length N complex FFT. The latter is considerably faster than the current FFT functions in the Teensy Audio library, and I want to include it in all my FFT functions... (Including a sped-up version of Paul's functions)
2) I have a new (and I think better) way of off-loading FFT (or any low-priority compute intensive) functions from the audio library. I have written a set of "AudioDataGrabber" functions that will return the previous n buffers for real or complex data. The data is kept in a ring buffer, and all the update function does is update the pointers to the head and tail. I currently have written and tested real and complex 128 and 256 length grabbers and am in the process of extending to 512 and 1024 versions. This allows you to do whatever you wish with the data in the loop() function - including FFTs if you wish
. Very low overhead on the 2.9 msec cycle time of the audio block updates.
3) I have written a set of functions for FFT based filtering/processing/convolution operations with overlap-add output, including demodulation, Hilbert transformers, and general FIR filters.
Other functions that I am working on include adaptive-least-squares filters, decimation/interpolation, and others.
So the point is that all of these things are works-in-progress, and I need to get things organized and extended before making a general release. (I am doing this while recovering from a serious encounter with the big-"C", and still get very-very tired, and so am limited by my endurance)
PM me with you email, letting me know what you would like and I'll package up a zip file and send you the appropriate stuff.
- Derek