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 float #pragma float #pragma float #pragma float // 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