# Dynamically changing cut-off and sampling frequency of a digital filter

I have designed a low pass filter that smooths the output coming from an accelerometer attached to a vibrating machine. I designed this assuming cut-off frequency $f_{c1}$, and sampling frequency $f_s$. Now the issue is when I change the machine , I have to change the cut-off frequency and $f_s$ manually, else the output is not as smooth as expected. That is every machine is actually vibrating with slightly changed frequency.

Is there a way the filter learns the appropriate Cut-off frequency $f_{c2}$ and $f_{s2}$, itself, without me to change the code and perform filtering based on this $f_{c2}$ and $f_{s2}$?

I shall appreciate if some one can provide some web-links so I can explore this area further.

• How would the filter automatically tell the difference between the signal you want and the signal you don't want? What are your criteria? – endolith Mar 28 '13 at 19:48

3. You could create somewhat crude low-pass filters based off of your starting filter. For instance, if you wanted to halve the cutoff frequency you would halve the filter sample time. You would thus create a new filter that had all of the original filter's samples and a sample in between those samples. You could create the extra samples through splines. This same approach could be used to create any fractional cutoff frequency change. A more complicated example would be if you wanted the cutoff frequency to be $\frac{9}{8}f_c$. If we say that your original filter's samples are at time 0, 1, 2, ..., $n$, then the new filter's samples would be at time 0, $\frac{9}{8}$, $\frac{18}{8}$, ...