Air-Math Software EMA Implementation #5
Madacool01
started this conversation in
General
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Uh oh!
There was an error while loading. Please reload this page.
While developing my Air-Math Project ( #3 ), I noticed a flaw in my tracking. Due to the natural shake of the human hand, the lines drawn were very jittery and inaccurate. After some research, I found a simple yet effective solution to the problem, known as Exponential Moving Average (EMA) Smoothing, which is mathematically defined as:
$S_{t} = \alpha X_{1}+(1-\alpha)\cdot S_{t-1}.$
$X_{1}=$ Current X/Y coordinate
$S_{t}=$ Smoothed value
$S_{t-1}=$ Previous smoothed value
$\alpha=$ Smoothing Factor $\to$ 0.1 = Very smooth/Unresponsive; 0.9 = Very fast, Highly responsive.
Where:
This allowed me to be able to smoothen the values out and get a responsive yet smooth movement.
Python Implementation:
All reactions