3

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

codercat
  • 22,873
  • 9
  • 61
  • 85
flatronka
  • 1,061
  • 25
  • 51
  • 1
    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 Jan 04 '14 at 12:40
  • I've edited my question with the answers. Thanks for your interest. – flatronka Jan 04 '14 at 12:55
  • 1
    I either still have difficulties understanding the question or the question is a duplicate of [Indoor Positioning System based on Gyroscope and Accelerometer](http://stackoverflow.com/q/7499959/341970) and probably many others. – Ali Jan 04 '14 at 13:00
  • 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 Jan 04 '14 at 13:02
  • 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 Jan 04 '14 at 13:03
  • I want to detect the movement around :), I have the data just I need some clever data processing idea, because a simple high pass filter I lost a lot of data. Thanks for your comment. – flatronka Jan 04 '14 at 13:09
  • Get the Apple sample project ["MotionGraphs"](https://developer.apple.com/library/ios/samplecode/MotionGraphs/Introduction/Intro.html) and look at the "DeviceMotion" tab, "UserAcc" selection. This just shows the user movement, no gravity. – zaph Jan 04 '14 at 13:32
  • Thanks for the idea, but I've already played with the sample project. The question is not that how can I get data from the accelerometer, the question is how can I transform the data, how can I get real information from the data. – flatronka Jan 04 '14 at 14:07

2 Answers2

2

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).

Nikolai Ruhe
  • 81,520
  • 17
  • 180
  • 200
  • Sorry about the position I want to say orientation. If you put down your phone like the picture above you get a value around -1 on x coordinate while the device is in rest. I think these are the big steps like "chairs". And the peaks show the actual acceleration. If I put my device to the table and after I shake the table a bit I got a small peak. I want just these peaks which show the actual acceleration. – flatronka Jan 04 '14 at 16:21
  • In the base accelerometer data you get two things: 1) gravity which is essentially a constant and device movement. In the example I mentioned what you get is motion with gravity removed. What more are you looking for? The gyro provides movement about it's axis. Between these you should be able to get about everything possible. The caveat is the accuracy which may not be sufficient for your needs. If you are not willing or able to provide more detailed information of what you want there is little help that can be provided. – zaph Jan 04 '14 at 20:03
1

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.

jmalmari
  • 139
  • 1
  • 4