Yes, this was the filter code which I made my first tests. But after I also saw the error. Now I did some tests with this filter:
/// runChebyshev: Low Pass; 2nt Order; cutoff =300Hz; sampling=5000Hz; long type 8bit;
_v[0] = _v[1];
_v[1] = _v[2];
long tmp = ((((data * 5342655L) >> 5) //= ( 3.9805879528e-2 * x)
+ ((_v[0] * -7243194L) >> 2) //+( -0.4317280064*v[0])
+ (_v[1] * 5337271L) //+( 1.2725044883*v[1])
)+2097152) >> 22; // round and downshift fixed point /4194304
_v[2]= (short)tmp;
return (short)((
(_v[0] + _v[2])
+2 * _v[1])); // 2^
I used “long type” whit 8 bit. Without “-1 bit saturation save“.
Are that settings ok?
I have to do more tests but until now it doesn’t work correctly.
Thank you very much for the Idea using a big array for filter validation!