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.

  • 1
    $\begingroup$ How would the filter automatically tell the difference between the signal you want and the signal you don't want? What are your criteria? $\endgroup$
    – endolith
    Commented Mar 28, 2013 at 19:48

1 Answer 1


There are a few ways that you could do run-time dynamic filters.

  1. With a program like Matlab or Octave, but I'm guessing that they aren't available to your application. There might be DSP libraries that have functions for generating filters though.
  2. Calculating from scratch a windowed sinc function.
  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}$, ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.