This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[c55x] iircas51 (iircas 5) issues

Is there a way to execute Iircas51 (and iircas5) functions recursively with an odd number of samples (nx) and specifically with the value 1? According to the DSP Lib documentation this is possible but I don’t see how.

The delay line dbuffer (D[]) being circular it exchanges the order of x(n-1) and x(n-2) (and y(n-1) and y(n-2) for simplification I omit y(n) from now on), so that for even samples delay buffer contents represents x(n-1) x(n-2), but for odd samples the contents are actually x(n-2) x(n-1)

                   D[0]   D[1]

n=0 ->            0       0
n=1 ->            0       x(0)
n=2 ->            x(1)    x(0)
n=3 ->            x(1)    x(2)

If the function is called recursively with nx=1 (or any odd number), AR3 is always initialized so that it points to D[0], but for odd samples it should point to D[1], so in this particular case (nx=1), D[0] always contains 0, and x(n) it is always written into D[1].

 According to DSP lib doc (Rev J):

This function retains the address of the delay filter memory d containing the previous delayed values to allow consecutive processing of blocks.This function is more efficient for block-by-block filter implementation due to the C-calling overhead. However, it can be used for sample-by-sample filtering (nx = 1).

But I don’t see how this address is retained, it seems that every time this function is called the address of D[0] is passed to AR3, that defines the start of the circular buffer, if the address of D[1] is passed for odd samples, the circular buffer is wrongly initialized.

This function might need an additional parameter that is set to 0 for even samples and not 0 for odd samples, so that AR3, AR4 are properly initialized each time the function is called.

Additionally the doc specifies dbuffer[4*nbiq+1], but it should be dbuffer[4*nbiq] isn’t it?