I finally exploited the functions to make the filter work per sample: put this in the init code and call it at s-rate.
static __attribute__ ((noinline)) int32_t biquad_dsp_sample(biquad_state *state,
biquad_coefficients *coefs,
int32_t filterinput) {
int32_t accu = ___SMMUL(coefs->cxn_0, filterinput);
accu = ___SMMLA(coefs->cxn_1, state->filter_x_n1, accu);
accu = ___SMMLA(coefs->cxn_2, state->filter_x_n2, accu);
accu = ___SMMLS(coefs->cyn_1, state->filter_y_n1, accu);
accu = ___SMMLS(coefs->cyn_2, state->filter_y_n2, accu);
int32_t filteroutput;
filteroutput = accu << 4;
state->filter_x_n2 = state->filter_x_n1;
state->filter_x_n1 = filterinput;
state->filter_y_n2 = state->filter_y_n1;
state->filter_y_n1 = filteroutput;
return __SSAT(filteroutput, 28);
}
This one is another function, you can use it to morph between coefficients (i'm thinking of the z-plane filters, here )
static __attribute__ ((noinline)) void biquad_morph_coefs(biquad_coefficients *incoefs1, biquad_coefficients *incoefs2, biquad_coefficients *outcoefs, int32_t morph)
{
outcoefs->cyn_1 = ___SMMLA(incoefs2->cyn_1-incoefs1->cyn_1<<2,morph<<3,incoefs1->cyn_1);
outcoefs->cyn_2 = ___SMMLA(incoefs2->cyn_2-incoefs1->cyn_2<<2,morph<<3,incoefs1->cyn_2);
outcoefs->cxn_0 = ___SMMLA(incoefs2->cxn_0-incoefs1->cxn_0<<2,morph<<3,incoefs1->cxn_0);
outcoefs->cxn_1 = ___SMMLA(incoefs2->cxn_1-incoefs1->cxn_1<<2,morph<<3,incoefs1->cxn_1);
outcoefs->cxn_2 = ___SMMLA(incoefs2->cxn_2-incoefs1->cxn_2<<2,morph<<3,incoefs1->cxn_2);
}
You can see it applied in sptnk/filter/morph