Android Gravity sensor data denoising method

Source: Internet
Author: User

public void Onsensorchanged (Sensorevent event)     {          final float alpha = 0.8;          GRAVITY[0] = Alpha * Gravity[0] + (1-alpha) * event.values[0];          GRAVITY[1] = Alpha * Gravity[1] + (1-alpha) * event.values[1];          GRAVITY[2] = Alpha * gravity[2] + (1-alpha) * event.values[2];          Linear_acceleration[0] = event.values[0]-gravity[0];          LINEAR_ACCELERATION[1] = event.values[1]-gravity[1];          LINEAR_ACCELERATION[2] = event.values[2]-gravity[2];      }

The difference equation of the system by the above code is described as:

The system transfer function is:

The effect is as follows:


Summarize:

The essence is to construct a first-order filter, which is implemented in Android by iterative iteration. If you have the basics of digital signal processing, it can be easily understood.

Welcome to Exchange: Q316190672

Android Gravity sensor data denoising method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.