Go Down

Topic: Accelerometer Z axis filtering? Java, android, bluetooth (Read 168 times) previous topic - next topic

soeren

Hello forum,

I have a bosch BMI160 accelerometer (+ gyro) that I've written an android app for which stores the sensor data in .csv format and sends it to google drive after a logging session (usually 1-3 minutes long).

I've tried implementing some "basic" filtering on the Z axis signal (up-down) in order to isolate gravity and non-gravity components, and while I'm not completely on the wrong road - something is a bit odd I think.

First off, I'm using this library https://github.com/berndporr/iirj to implement butterworth lowpass and highpass filters with cutoff frequencies of 15hz, order of 4 and samplerate of 80hz. The BMI160 sends data to the phone in 100hz speed approx (rather 80-100 hz since some packages appear to be lost).

I have 4 signals in my chart:
Blue: original signal (untouched)
Red: Lowpass
Green: Highpass
Yellow: original minus lowpass

A snippet of the data chart is attached here. This is I hold the sensor in my hand and bounce it 5 times up and down. Notice that the green and yellow signal is (correctly) resting at "0" while the original and lowpassed signals contain the gravity components resulting in an offset.

Some of the things I don't quite understand:

1. How can the yellow signal exceed the original signal at times? Is because there is a phase shift in the filtered signals resulting in an addition (due to subtracting negative values) ?

2. why are the yellow and green signal so very different? Shouldn't they contain approx the same values?

3. Should I use a different order than 4 to get better results? increase it perhaps, to have more
calculations?

4. Is there anything else here you think I'm doing in an odd way? Something I should look out for or change?

The x axis display time (seconds).


Disclaimer: I'm not an advanced DSP programmer, but instead have a very diverse experience with programming. Please address my post with this in mind, thank you.

Cheers



Robin2

It sounds like your project does not involve an Arduino board and if so you need to post your question elsewhere.

If it is an Arduino program that you need help with then please post the program and tell us what it actually does and what you want it to do that is different.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

soeren

This project does not include an arduino board - yet - no.. I was with the impression that this sub-category in the forum, it was OK to talk about anything at all.. that's what the description said anyway. Anyway, if you're an admin you can just go ahead and delete my message then

Robin2

it was OK to talk about anything at all.. that's what the description said anyway.
Don't you think the name of the Forum should be taken into account?

There are plenty of Java and Android websites - why pick on us?

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up