using vDSP_deq22 correctly

By vb, 04/04/2015

On a mac the Accelerate framework delivers a lot of very useful DSP functions. Most of them are pretty straight forward to use, some are a little complicated. One of those is vDSP_deq22 / vDSP_deq22D which implements a vectorized 2 pole 2 zero filter (biquad).

Because of the recursive structure of a biquad filter, the input and output vectors must both be two elements longer than the actual number of samples that you want to filter. The first two elements of the input and output vectors must be filled with the last two values from the last calculation. The new input values then start from index 3. After applying the biquad, the output values start from index 3 of the output vector – it’s a common mistake to use the output values starting from index 0!

Below is a little code example, which is the perform routine of a max external that implements a simple biquad filter. Coefficient calculation is not included.

 

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *