Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Filtering accelerometer data noise

Tags:

How do I filter noise of the accelerometer data in Android? I would like to create a high-pass filter for my sample data so that I could eliminate low frequency components and focus on the high frequency components. I have read that Kalman filter might be the best candidate for this, but how do I integrate or use this method in my application which will mostly written in Android Java? or can it be done in the first place? or through Android NDK? Is there by any chance that this can be done in real-time?

Any idea will be much appreciated. Thank you!

like image 829
Faiz Avatar asked Oct 28 '09 17:10

Faiz


People also ask

How can an accelerometer reduce noise?

You can start with a low-pass filter. Ask yourself what is the maximum frequency possible (it depends of where the accelerometer is) and filter out all frequencies above that. The cut-off frequency will be a few Hz. You will need a colleague with some signal processing background to help you implement the LP filter.

How do I filter noisy data?

One of the easiest ways to filter noisy data is by averaging. Averaging works by adding together a number of measurements, the dividing the total by the number of measurements you added together. The more measurements you include in the average the more noise gets removed.

How do you reduce IMU noise?

In the signal preprocessing part, sensor calibration, digital-analog conversion and signal smoothing are applied on raw signals to reduce IMU noises.


1 Answers

The samples from Apple's SDK actually implement the filtering in an even simpler way which is by using ramping:

 //ramp-speed - play with this value until satisfied const float kFilteringFactor = 0.1f;  //last result storage - keep definition outside of this function, eg. in wrapping object float accel[3];   //acceleration.x,.y,.z is the input from the sensor  //result.x,.y,.z is the filtered result  //high-pass filter to eliminate gravity accel[0] = acceleration.x * kFilteringFactor + accel[0] * (1.0f - kFilteringFactor); accel[1] = acceleration.y * kFilteringFactor + accel[1] * (1.0f - kFilteringFactor); accel[2] = acceleration.z * kFilteringFactor + accel[2] * (1.0f - kFilteringFactor); result.x = acceleration.x - accel[0]; result.y = acceleration.y - accel[1]; result.z = acceleration.z - accel[2]; 
like image 175
Till Avatar answered Sep 18 '22 10:09

Till