2016-02-18 09:37 AM
Hello everyone, i try to make iir filter on STM32F4. Here how ive written it:
float Sum,s1,s2, b0=3622,b1=7243,b2=3622,a1=822690,a2=-837162;
int in0,in1,in2;
in0 = ADC1->DR; // pass ADC -> circular buffer x1
Sum = 0;
Sum +=in0*b0+b1*in1+b2*in2+a1*s1+a2*s2;
in2=in1;
in1=in0;
s2=s1;
s1=Sum;
Please dont pay attention to the coefficients. They are chosen randomly to check the speed of filter's producing. it is about 0,25 uS. In DSP library CMSIS there are functions for IIR filter but i dont understand how to use them. Could you explain me please how to use this function for my programme. Will iir filter from dsp library work faster than mine?
#stm32f4-dsp-iir