accelerometer

FFT library in android Sdk

空扰寡人 提交于 2019-11-26 21:42:30
I am working with android project.I need FFT algorithm to process the android accelerometer data.Is there FFT library available in android sdk? EricLarch You can use this class, which is fast enough for real time audio analysis public class FFT { int n, m; // Lookup tables. Only need to recompute when size of FFT changes. double[] cos; double[] sin; public FFT(int n) { this.n = n; this.m = (int) (Math.log(n) / Math.log(2)); // Make sure n is a power of 2 if (n != (1 << m)) throw new RuntimeException("FFT length must be power of 2"); // precompute tables cos = new double[n / 2]; sin = new

Distance moved by Accelerometer

女生的网名这么多〃 提交于 2019-11-26 19:57:20
I want to move objects on iPhone screen (rectangle, circle and so on) by moving iPhone. For example, I move iPhone along X-axis and the object moves along X-axis. The same for Y,Z-axis. How can I do this? Can I get algorithm for it? Thank you. P.S: I looked for a while and seems like it is possible using accelerometer. Ali You get position by integrating the linear acceleration twice but the error is horrible. It is useless in practice. Here is an explanation why (Google Tech Talk) at 23:20. I highly recommend this video. However the gyro mouse might work for your application, see between 37

How can I get the direction of movement using an accelerometer?

十年热恋 提交于 2019-11-26 19:56:17
问题 I'm developing a Android application and I would like to know if is possible detect the direction of movement with one axis fixed. For example, I want put my phone on the table and detect the direction when I move it (left, right, up and down). The distance is not necessary, I just want know the accurate direction. 回答1: Yes. Using the SensorEventListener.onSensorChanged(SensorEvent event) you can determine the values provided along the X & Y axis. You would need to record these values and

Calculating distance using Linear acceleration android [duplicate]

我的梦境 提交于 2019-11-26 19:47:15
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Android accelerometer accuracy (Inertial navigation) I am using the following code to calculate the distance. tnew and anew are arraylists containing timestamps and accelerations respectively. double distance=0; double init_vel=0; long time_prev=tnew.next(); while(anew.hasNext()) { float temp_acc=anew.next(); long temp_time=tnew.next(); interval=(temp_time-time_prev)/1000f; //milliseconds to seconds double fin

Detect change in orientation using javascript

核能气质少年 提交于 2019-11-26 18:49:50
Is it possible to detect change in orientation of the browser on the iPad or Galaxy Tab using javascript? I think it's possible using css media queries. UPDATE: You might want to check out jQuery mobile orientationchange or the plain JS one: window.addEventListener("orientationchange", function() { alert(window.orientation); }, false); MDN: window.addEventListener("orientationchange", function() { alert("the orientation of the device is now " + screen.orientation.angle); }); Older answer http://www.nczonline.net/blog/2010/04/06/ipad-web-development-tips/ Safari on the iPad does support the

Get frequency with highest amplitude from FFT

寵の児 提交于 2019-11-26 18:38:01
问题 I have raw accelerometer data in form of x,y,z axes which is smoothened and I applied a band pass filter. Now I want to convert it to frequency domain signal and using the scipy.fftpack.fft to apply FFT. sampling_frequency = 32 def fft(acc_data): N = len(acc_data) fft_data = sp.fftpack.fft(acc_data) freqs = sp.fftpack.fftfreq(N) plt.bar(freqs, np.abs(fft_data)) plt.xlabel('Frequency in Hertz [Hz]') plt.ylabel('Magnitude') plt.title('FFT') plt.show() This figure has no points plotted and is

track small movements of iphone with no GPS

☆樱花仙子☆ 提交于 2019-11-26 18:26:47
问题 I have to write an application for iphone that tracks the movement of the iphone itself, given its initial position, without ever using GPS. That is, I can only use data provided by the gyroscope and the accelerometer. The distances I need to measure are rather small and the precision I'm looking for is 40-50cm (~2 feet) at the very most. Is this possible? If so, what's the best way to go about it? Also, do you know of any existing (and possibly open source) projects that have implemented

Transforming accelerometer's data from device's coordinates to real world coordinates

杀马特。学长 韩版系。学妹 提交于 2019-11-26 18:11:48
问题 I'm really sorry if this is a very basic question, but I have not choice but ask it: How do you translate the accelerometer data from the device coordinates to real world coordinates? I mean, assuming that the accelerometer is giving me somenting like (Ax,Ay,Az) -in device's coordinates-, what transformations should I apply to transform the values into (Ax',Ay',Az') -in real world's coordinates-, so I can use the acceleration vector in real worlds coordinates to calculate if the device is

How to access accelerometer/gyroscope data from Javascript?

寵の児 提交于 2019-11-26 18:03:32
I have recently come across a few websites that seems to access the accelerometer or gyroscope on my laptop, detecting changes in orientation or movement. How is this done? Must I subscribe to some kind of event on the window object? On which devices (laptops, mobile phones, tablets) is this known to work? NB : I actually already know (part of) the answer to this question, and I am going to post it right away. The reason that I am posting the question here, is to let everyone else know that accelerometer data is available in Javascript (on certain devices) and to challenge the community to

calculating distances using accelerometer

那年仲夏 提交于 2019-11-26 17:59:22
问题 After reading many researches and papers beside to many forums about how to measure the distance based on the acceleration data I found the double integration method, but the error related to this method is big and increases by time. In addition I found some people who suggested Kalman filter I read some references about it but it was not clear to me how to use it. also some were talking about the fusion sensors ... but after reading them I did not get any new ideas. so I am still confused