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.

Question on DSPF_sp_biquad() in C674x DSPLIB

Hi,

I am trying to implement an IIR filter using the DSPF_sp_biquad() function in C674x DSPLIB.  I am using C6748 DSP.

As the order of the filter is higher than 2, I am cascading several biquads one after another.

I am planning to utilize the DSPF_sp_biquad() function as follows to support up to 9 biquads:

#pragma

 

 

DATA_ALIGN(filter_data, 8);

float

 

 

filter_data[10][BUFFER_SIZE];

#pragma

 

 

DATA_ALIGN(delay_node, 8);

float

 

 

delay_node[9][2];

#pragma

 

 

DATA_ALIGN(coeff_a, 8);

float

 

 

coeff_a[9][4];

#pragma

 

 

DATA_ALIGN(coeff_b, 8);

float

 

 

coeff_b[9][4];

// coeff_a and coeff_b will be initialized here

// delay_nodes will be set to 0.0 only before the first call of the function iir_filter()

// The document mentions that the delay_nodes value have to be pre-calculated but since x[i-1],x[i-2],y[i-1],y[i-2] are all zero for the 1st call, delay[0] and delay[1] will be zero

// the output of the first biquad will become the input of the second biquad and so on

// n_biquad is the number of biquads, BUFFER_SIZE is the number of data which will be an even number

void iir_filter(void)

{

    float *p2, *p3; int i;

    for(i=0; i<n_biquad; i++)

    {

    p2 = &filter_data[i][0];

    p3 = &filter_data[i+1][0];

    DSPF_sp_biquad(p2, &coeff_b[i][0], &coeff_a[i][0], &delay_node[i][0], p3, BUFFER_SIZE);

    }

 

}

Does the above make sense to you?  Did I miss anything?

Thanks in advance for your help!

David