[android-developers] Re: Accelerometer frequency
hi i'm trying to logging the data received with timestamps for magnetic field sensor, could you give me the java code that you used in this article? 2009년 2월 18일 수요일 오후 4시 8분 2초 UTC+9, gjs 님의 말: > > Hi, > > Try logging the data received with timestamps ( in memory ) for > android.hardware.SensorListener.onSensorChanged(int sensor, float[] > values) and you'll soon work out the Frequency, I have found > accelerometer updates being received at approximately 30~40ms > intervals on a G1 eg: > > 1227266554492 2 [0] = 0.16344418 [1] = -9.629586 [2] = -1.3620348 [3] > = 0.16344418 [4] = -9.629586 [5] = -1.3620348 > 1227266554495 1 [0] = 7.3883734 [1] = -82.0 [2] = 1.0 [3] = 7.3883734 > [4] = -82.0 [5] = 1.0 > 1227266554525 8 [0] = 8.3125 [1] = 12.875 [2] = -71.5625 [3] = 8.3125 > [4] = 12.875 [5] = -71.5625 > 1227266554528 2 [0] = 0.05448139 [1] = -9.684067 [2] = -1.3075534 [3] > = 0.05448139 [4] = -9.684067 [5] = -1.3075534 > 1227266554531 1 [0] = 7.5050936 [1] = -82.0 [2] = 0.0 [3] = 7.5050936 > [4] = -82.0 [5] = 0.0 > 1227266554564 8 [0] = 8.5625 [1] = 12.125 [2] = -71.5625 [3] = 8.5625 > [4] = 12.125 [5] = -71.5625 > 1227266554566 2 [0] = 0.040861044 [1] = -9.670447 [2] = -1.3211738 [3] > = 0.040861044 [4] = -9.670447 [5] = -1.3211738 > 1227266554603 8 [0] = 8.0625 [1] = 12.375 [2] = -71.8125 [3] = 8.0625 > [4] = 12.375 [5] = -71.8125 > 1227266554606 2 [0] = -0.013620348 [1] = -9.724928 [2] = -1.2666923 > [3] = -0.013620348 [4] = -9.724928 [5] = -1.2666923 > 1227266554609 1 [0] = 7.5050936 [1] = -83.0 [2] = 0.0 [3] = 7.5050936 > [4] = -83.0 [5] = 0.0 > 1227266554643 8 [0] = 8.3125 [1] = 12.375 [2] = -71.8125 [3] = 8.3125 > [4] = 12.375 [5] = -71.8125 > 1227266554646 2 [0] = -0.013620348 [1] = -9.615966 [2] = -1.2666923 > [3] = -0.013620348 [4] = -9.615966 [5] = -1.2666923 > 1227266554649 1 [0] = 7.5050936 [1] = -82.0 [2] = 0.0 [3] = 7.5050936 > [4] = -82.0 [5] = 0.0 > 1227266554683 8 [0] = 7.8125 [1] = 11.625 [2] = -71.5625 [3] = 7.8125 > [4] = 11.625 [5] = -71.5625 > 1227266554686 2 [0] = 0.040861044 [1] = -9.615966 [2] = -1.2666923 [3] > = 0.040861044 [4] = -9.615966 [5] = -1.2666923 > > (These examples were when using SENSOR_DELAY_GAME rate, you can > probably do better if you listen just for the accelerometer updates > and use a faster RATE) > > You can also vary this Frequency (rate) with > android.hardware.SensorManager.registerListener(SensorListener > listener, int sensors, int rate) > > intSENSOR_DELAY_FASTESTget sensor data as fast as possible > intSENSOR_DELAY_GAMErate suitable for games > intSENSOR_DELAY_NORMALrate (default) suitable for screen > orientation > changes > intSENSOR_DELAY_UIrate suitable for the user interface > > I can't help you with the Precision, maybe have a look at > android.hardware.SensorListener.onAccuracyChanged (int sensor, int > accuracy). > > Another idea is to find the specs for the sensor being used in the g1 > or g2, but there is nothing like measuring it for yourself > > Regards > > On Feb 17, 8:39 pm, ashu wrote: > > So my question still stands. Frequency? Precision? Thanks for the > > attempt, Jubei. > > > > On Feb 11, 6:14 am, Jubei wrote: > > > > > Supposedly you pass a 3rd parameter to the sensormanager's > > > registerLister function but It doesnt seem to make any difference. > > > > > On Feb 11, 7:33 pm,ashu wrote: > > > > > > Hey, I wanted to get the frequency of accelerometer output. How > many > > > > readings can I get per second? And to what precision do I get? > Thanks- Hide quoted text - > > > > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Accelerometer frequency
Supposedly you pass a 3rd parameter to the sensormanager's registerLister function but It doesnt seem to make any difference. On Feb 11, 7:33 pm, ashu wrote: > Hey, I wanted to get the frequency of accelerometer output. How many > readings can I get per second? And to what precision do I get? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Accelerometer frequency
So my question still stands. Frequency? Precision? Thanks for the attempt, Jubei. On Feb 11, 6:14 am, Jubei wrote: > Supposedly you pass a 3rd parameter to the sensormanager's > registerLister function but It doesnt seem to make any difference. > > On Feb 11, 7:33 pm,ashu wrote: > > > > > Hey, I wanted to get the frequency of accelerometer output. How many > > readings can I get per second? And to what precision do I get? Thanks- > > Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Accelerometer frequency
Hi, Try logging the data received with timestamps ( in memory ) for android.hardware.SensorListener.onSensorChanged(int sensor, float[] values) and you'll soon work out the Frequency, I have found accelerometer updates being received at approximately 30~40ms intervals on a G1 eg: 1227266554492 2 [0] = 0.16344418 [1] = -9.629586 [2] = -1.3620348 [3] = 0.16344418 [4] = -9.629586 [5] = -1.3620348 1227266554495 1 [0] = 7.3883734 [1] = -82.0 [2] = 1.0 [3] = 7.3883734 [4] = -82.0 [5] = 1.0 1227266554525 8 [0] = 8.3125 [1] = 12.875 [2] = -71.5625 [3] = 8.3125 [4] = 12.875 [5] = -71.5625 1227266554528 2 [0] = 0.05448139 [1] = -9.684067 [2] = -1.3075534 [3] = 0.05448139 [4] = -9.684067 [5] = -1.3075534 1227266554531 1 [0] = 7.5050936 [1] = -82.0 [2] = 0.0 [3] = 7.5050936 [4] = -82.0 [5] = 0.0 1227266554564 8 [0] = 8.5625 [1] = 12.125 [2] = -71.5625 [3] = 8.5625 [4] = 12.125 [5] = -71.5625 1227266554566 2 [0] = 0.040861044 [1] = -9.670447 [2] = -1.3211738 [3] = 0.040861044 [4] = -9.670447 [5] = -1.3211738 1227266554603 8 [0] = 8.0625 [1] = 12.375 [2] = -71.8125 [3] = 8.0625 [4] = 12.375 [5] = -71.8125 1227266554606 2 [0] = -0.013620348 [1] = -9.724928 [2] = -1.2666923 [3] = -0.013620348 [4] = -9.724928 [5] = -1.2666923 1227266554609 1 [0] = 7.5050936 [1] = -83.0 [2] = 0.0 [3] = 7.5050936 [4] = -83.0 [5] = 0.0 1227266554643 8 [0] = 8.3125 [1] = 12.375 [2] = -71.8125 [3] = 8.3125 [4] = 12.375 [5] = -71.8125 1227266554646 2 [0] = -0.013620348 [1] = -9.615966 [2] = -1.2666923 [3] = -0.013620348 [4] = -9.615966 [5] = -1.2666923 1227266554649 1 [0] = 7.5050936 [1] = -82.0 [2] = 0.0 [3] = 7.5050936 [4] = -82.0 [5] = 0.0 1227266554683 8 [0] = 7.8125 [1] = 11.625 [2] = -71.5625 [3] = 7.8125 [4] = 11.625 [5] = -71.5625 1227266554686 2 [0] = 0.040861044 [1] = -9.615966 [2] = -1.2666923 [3] = 0.040861044 [4] = -9.615966 [5] = -1.2666923 (These examples were when using SENSOR_DELAY_GAME rate, you can probably do better if you listen just for the accelerometer updates and use a faster RATE) You can also vary this Frequency (rate) with android.hardware.SensorManager.registerListener(SensorListener listener, int sensors, int rate) int SENSOR_DELAY_FASTESTget sensor data as fast as possible int SENSOR_DELAY_GAME rate suitable for games int SENSOR_DELAY_NORMAL rate (default) suitable for screen orientation changes int SENSOR_DELAY_UI rate suitable for the user interface I can't help you with the Precision, maybe have a look at android.hardware.SensorListener.onAccuracyChanged (int sensor, int accuracy). Another idea is to find the specs for the sensor being used in the g1 or g2, but there is nothing like measuring it for yourself Regards On Feb 17, 8:39 pm, ashu wrote: > So my question still stands. Frequency? Precision? Thanks for the > attempt, Jubei. > > On Feb 11, 6:14 am, Jubei wrote: > > > Supposedly you pass a 3rd parameter to the sensormanager's > > registerLister function but It doesnt seem to make any difference. > > > On Feb 11, 7:33 pm,ashu wrote: > > > > Hey, I wanted to get the frequency of accelerometer output. How many > > > readings can I get per second? And to what precision do I get? Thanks- > > > Hide quoted text - > > > - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Accelerometer frequency
I've done some experiments with the accelerometers, and so I figured that I would share the results. As for precision, the values are floats. I don't know how else to quantify the precision without looking at the specs for the actual sensors being used. Qualitatively, the noise in these sensors is very low. I've worked with accelerometers in other devices, and the G1 sensors have the least amount of noise of all the sensors that I've used. For my experiments, I'm not interested in large forces, more the kind that occur during natural human motion. The sensor readings tend to lie in the (-3g,3g) range. In the documentation, it says that there are 6 sensor values: x,y,z,raw_x,raw_y,raw_z. The documentation states that the x,y,z values may be smoothed, while the raw ones are the raw sensor readings. However, on the G1, the raw readings are identical to the "smoothed" readings. One thing that I'm suspicious of is that the low noise in the readings is actually due to the G1 doing some smoothing of the data, and the raw values aren't in fact the raw values, but are also smoothed. I'm not sure how to figure out if this is what is really happening. I first tried SENSOR_DELAY_FASTEST. I collected data over a 15 minute period. The average frequency was 21.0025, with standard deviation of 8.0061. I then tried SENSOR_DELAY_GAME, and found that the frequency was more consistent. I went for a 2 minute walk and the average frequency was 40.2894 with a standard deviation of only 3.3162. I hope that someone finds this useful. Cheers, Jordan Frank On Feb 18, 2:08 am, gjs wrote: > Hi, > > Try logging the data received with timestamps ( in memory ) for > android.hardware.SensorListener.onSensorChanged(int sensor, float[] > values) and you'll soon work out the Frequency, I have found > accelerometer updates being received at approximately 30~40ms > intervals on a G1 eg: > > 1227266554492 2 [0] = 0.16344418 [1] = -9.629586 [2] = -1.3620348 [3] > = 0.16344418 [4] = -9.629586 [5] = -1.3620348 > 1227266554495 1 [0] = 7.3883734 [1] = -82.0 [2] = 1.0 [3] = 7.3883734 > [4] = -82.0 [5] = 1.0 > 1227266554525 8 [0] = 8.3125 [1] = 12.875 [2] = -71.5625 [3] = 8.3125 > [4] = 12.875 [5] = -71.5625 > 1227266554528 2 [0] = 0.05448139 [1] = -9.684067 [2] = -1.3075534 [3] > = 0.05448139 [4] = -9.684067 [5] = -1.3075534 > 1227266554531 1 [0] = 7.5050936 [1] = -82.0 [2] = 0.0 [3] = 7.5050936 > [4] = -82.0 [5] = 0.0 > 1227266554564 8 [0] = 8.5625 [1] = 12.125 [2] = -71.5625 [3] = 8.5625 > [4] = 12.125 [5] = -71.5625 > 1227266554566 2 [0] = 0.040861044 [1] = -9.670447 [2] = -1.3211738 [3] > = 0.040861044 [4] = -9.670447 [5] = -1.3211738 > 1227266554603 8 [0] = 8.0625 [1] = 12.375 [2] = -71.8125 [3] = 8.0625 > [4] = 12.375 [5] = -71.8125 > 1227266554606 2 [0] = -0.013620348 [1] = -9.724928 [2] = -1.2666923 > [3] = -0.013620348 [4] = -9.724928 [5] = -1.2666923 > 1227266554609 1 [0] = 7.5050936 [1] = -83.0 [2] = 0.0 [3] = 7.5050936 > [4] = -83.0 [5] = 0.0 > 1227266554643 8 [0] = 8.3125 [1] = 12.375 [2] = -71.8125 [3] = 8.3125 > [4] = 12.375 [5] = -71.8125 > 1227266554646 2 [0] = -0.013620348 [1] = -9.615966 [2] = -1.2666923 > [3] = -0.013620348 [4] = -9.615966 [5] = -1.2666923 > 1227266554649 1 [0] = 7.5050936 [1] = -82.0 [2] = 0.0 [3] = 7.5050936 > [4] = -82.0 [5] = 0.0 > 1227266554683 8 [0] = 7.8125 [1] = 11.625 [2] = -71.5625 [3] = 7.8125 > [4] = 11.625 [5] = -71.5625 > 1227266554686 2 [0] = 0.040861044 [1] = -9.615966 [2] = -1.2666923 [3] > = 0.040861044 [4] = -9.615966 [5] = -1.2666923 > > (These examples were when using SENSOR_DELAY_GAME rate, you can > probably do better if you listen just for the accelerometer updates > and use a faster RATE) > > You can also vary this Frequency (rate) with > android.hardware.SensorManager.registerListener(SensorListener > listener, int sensors, int rate) > > int SENSOR_DELAY_FASTEST get sensor data as fast as possible > int SENSOR_DELAY_GAME rate suitable for games > int SENSOR_DELAY_NORMAL rate (default) suitable for screen orientation > changes > int SENSOR_DELAY_UI rate suitable for the user interface > > I can't help you with the Precision, maybe have a look at > android.hardware.SensorListener.onAccuracyChanged (int sensor, int > accuracy). > > Another idea is to find the specs for the sensor being used in the g1 > or g2, but there is nothing like measuring it for yourself > > Regards > > On Feb 17, 8:39 pm, ashu wrote: > > > So my question still stands. Frequency? Precision? Thanks for the > > attempt, Jubei. > > > On Feb 11, 6:14 am, Jubei wrote: > > > > Supposedly you pass a 3rd parameter to the sensormanager's > > > registerLister function but It doesnt seem to make any difference. > > > > On Feb 11, 7:33 pm,ashu wrote: > > > > > Hey, I wanted to get the frequency of accelerometer output. How many > > > > readings can I get per second? And to what precision do I get? > > > > Thanks- Hide quoted text - > > > > - Show quoted text - > > --~--~-~