Hi for a large vector (361156 points or more) I have this for loop to filter engine speed (RPM), it works fine but it is too slow
for i=1:length(RPM) RPMFilt(i) = RPM(i) + RPMFilt(i-1) - RPM(i) * RPMFiltConstantend
where RPMFiltConstant = 0.98 (heavily filtered)
Too avoid the for loop, I guess that I could use the filter function y = filter(b,a,x) (only the matlab filter function, I don't have the DSP or signal processing tool boxes)
But the problem is I am not sure what I should set b and a to in order to achieve the same result as the equation above with 0.98 filter constant, can anyway explain and show how to calculate what b and a should be for different values of RPMFiltConstant between 0 and 1.
thanks
Best Answer