2015-07-21 6:43 AM
Hello there
I've been trying to implement an IIR biquad lowpass filter with the DSP library lately. I started out by designing the filter in MATLAB and calculating the IIR parameters before I pretty much copied the code from ARMs CMSIS page. The low pass should filter a 320 double long input signal stored in ''testInput_f64''. The filter itself should also be double precision, so I used the df2T float64 version of the IIRs.float64_t testInput_f64[320] = { * here are 320 doubles ... * };
float64_t testOutput_f64[320] = {0};
const float64_t coeffs[5] = { 0.0168191501070571,
0.0336383002141143,
0.0168191501070571,
-1.60109239418362,
0.668368994611848};
static float64_t biquadStateBandF64[4]; // one stage -> 4x state variables {x[n-1], x[n-2], y[n-1], y[n-2]}
 int main(void)
 {
 arm_biquad_cascade_df2T_instance_f64 S1;
 float64_t *inputF64, *outputF64;
 /* Link */
 inputF64 = &testInput_f64[0];
 outputF64 = &testOutput_f64[0];
 /* Initialize biquad f64 */
 arm_biquad_cascade_df2T_init_f64 (&S1, 1, (float64_t *) &coeffs[0], &biquadStateBandF64[0]);
 /* Run biquad */
 arm_biquad_cascade_df2T_f64(&S1, inputF64, outputF64, 320);
 } 