user1809790
user1809790

Reputation: 1369

Low/High Pass Filters

I am creating an android phonegap application that detects road surface irregularities such as potholes and speed bumps. I am relying on the accelerometer values provided by the phone through phonegap and will use the values to do some processing.

However, since the values are rather rough, I wanted to use some kind of filtering to smooth down the values. I am aware that there are low and high pass filters. But what is the difference between them? And how would using one rather the other in my application affect the smoothness and reliability of the values?

Upvotes: 0

Views: 734

Answers (1)

Oliver Charlesworth
Oliver Charlesworth

Reputation: 272537

It's perhaps a bit facile to say this, but the straightforward explanation is that low-pass filters allow low frequencies and reject/reduce high frequencies, and vice versa.

Smoothing normally involves rejecting high-frequency components. You may be able to make progress with a couple of simple techniques:

  1. Simple moving average (simply average the most recent N samples).

  2. Exponential moving average (y[n] = alpha * y[n-1] + (1 - alpha) * x[n]).

See e.g. http://en.wikipedia.org/wiki/Moving_average for more info.

Choosing the value of the N or alpha parameter requires application-specific tuning.

However, proper filter design is a complex science/art. For instance, rejecting high-frequency components will probably impair your ability to detect "real" events like potholes (they'll be smoothed out too). You may start to need complex non-linear techniques such as thresholding. But that's the subject of entire books!

Upvotes: 1

Related Questions