I'm trying to use the vDSP_desamp()
routine to perform downsampling of an audio signal that is being constantly captured. According to the Accelerate-framework documentation, this routine performs FIR filtering and decimation.
However I have a conflict, since the API does not provide an input parameter for the circular buffer that to my knowledge, is needed to preserve sample history to perform FIR filtering. This leads me to believe that the sample history is being reset during each function call or perhaps a different algorithm is being applied from the one I know.
Unfortunately the function is a complete black box and no hint is given on how the filtering is performed or how signal continuity should be ensured.
Do you think it would suffice if I pad each frame with the last N samples (N being the number of filter taps) of the previous buffer, to acquire filtering continuity? I would discard those padding-sample outputs after calling vDSP_desamp()
, but I guess that the sample history line should be correctly initialized after the padding samples are processed.
Any hints on the innards of vDSP_desamp()
are welcome.