3
votes

I did a lot of experiment using the accelerometer for detecting the movement size(magnitude) just one value from x,y,z acceleration. I am using an iPhone 4 with accelerometer update frequency 1.0 / 50.0 (50HZ), but I've also tried with 100HZ, 150HZ, 200HZ.

Examples:

Acceleration on X axis Acceleration on Y axis Acceleration on Z axis

I assume ( I hope I am correct) that the accelerations are the small peaks on the graph, not the big steps. I think from my experiments that the big steps show the device position. If changed the position the step is changed too.

If my previous assumption is correct I need to cut the peaks from the graph and summarize them. Here comes my question how can I cut those peaks without losing the information, the peak sizes.

I know that the high pass filter does this kind of thinks(passes the high peaks and blocks the noise, the small ones, I've read some paper about the filters. But for me the filter cut a lot of information from my "signal"(accelerometer data).

I think that there should be a better way for getting the information out from the data.

I've tried a simple one which looks nice but it isn't correct.

I did this data data using my function magnitude

for i = 2 : length(x)
    converted(i-1) = x(i-1) - x(i);
end

Where x is my data and converted array is the result.

The following row generated a the image below, which looks like nice.

xyz = magnitude(datay) + magnitude(dataz) + magnitude(datax)

enter image description here

However the problem with that solution is that if I have continuos acceleration the graph just will show the first point and then goes down. I know that I need somehow better filter, but I am bit confused. Could you give some advice how can I do this properly.

Thanks for your time, I really appreciate your help

Edit(answers for Zaph question):

What are you trying to accomplish? I want to measure the movement when the iPhone is placed to desk, chair or bed. The accelerometer is so sensible if I put down a pencil it to a desk it shows me. I want to measure all movement that happens in a specific time.

What are the scale units? I'm not scaling the data.

When you say "device position" what do you mean, an accelerometer provides movement (in iPhones with gyros) I am using only the accelerometer. When I put the device like the picture below I got values around -1 on x coordinate, 0.0 on z and y coordinate. This is what I mean as device position. enter image description here

2
What are you trying to accomplish? What are the scale units? When you say "device position" what do you mean, an accelerometer provides movement (in iPhones with gyros). - zaph
I've edited my question with the answers. Thanks for your interest. - flatronka
I either still have difficulties understanding the question or the question is a duplicate of Indoor Positioning System based on Gyroscope and Accelerometer and probably many others. - Ali
Thanks for your note, I went through all the accelerometer related question before I asked the question, I don't think so that is duplicate. - flatronka
Do you want to measure the movement of the iPhone or detect a movement around. If you want to calculate the movement of the iPhone, it's basically not possible with only a gyroscope and an accelerometer, you need more data - Matthieu Rouif

2 Answers

2
votes

The measurements that are returned from the accelerometer are acceleration, not position.

I'm not sure what you mean with "big steps" but the peaks show a change of acceleration. The fact that the values are not 0 when holding the device still is from the fact that the gravitation accelerates the device with 9.81 m/s^2 (the magnitude of the acceleration vector).

1
votes

You are potentially trying to do something quite difficult, especially the with low quality sensors that are embedded in phones. That is, getting the actual coordinate acceleration of the phone.

What you can do, is to detect the time periods when the phone was moved or touched. You can first calculate magnitude (norm) of acceleration signal and then, with a moving window, check areas where sample standard deviation is smaller than some threshold. Determining how the phone moved is more complicated issue. Of course you can check orientation for the stationary areas between movements.