Employing Overlap-Add method in AU

I'd like to apply the overlap-add method in an Audio Unit. Do you have any recommendations on how to get this done with the Audio Unit API? As far as I understand it is only possible to consume N number of frames, so my thoughts at this time is to try to have two underlying AU's consuming at an N/2 offset of each other, each making and processing the FFT, and then feeding both to an AU which stitches/adds the frames back together.


I am of course looking for the fastest possible way to do this parallel processing, at N/2 offset of each other. Advice?

Accepted Reply

Do not depend on the number of Audio Unit frames to be a constant N. Use a circular fifo/buffer to allow using a fixed size FFT with variable size Audio Unit callback buffers (e.g. wait until the circular buffer has filled up enough for one or more FFT frames to be processed). Pass a save buffer from the previous Audio Unit callback for any needed FFT overlap/add-save scrap data.


Dispatching tasks from inside Audio Unit callbacks is not recommended (since that might need to allocate memory or block). So it appears that any async parallel processing has to be done by polling the circular buffer in timer callbacks, which adds latency.

Replies

Do not depend on the number of Audio Unit frames to be a constant N. Use a circular fifo/buffer to allow using a fixed size FFT with variable size Audio Unit callback buffers (e.g. wait until the circular buffer has filled up enough for one or more FFT frames to be processed). Pass a save buffer from the previous Audio Unit callback for any needed FFT overlap/add-save scrap data.


Dispatching tasks from inside Audio Unit callbacks is not recommended (since that might need to allocate memory or block). So it appears that any async parallel processing has to be done by polling the circular buffer in timer callbacks, which adds latency.

I wrongfully assumed that N would be constant. Good catch, thank you!