-
-
Notifications
You must be signed in to change notification settings - Fork 0
Reconstructor
Restores original data from smoothed data with 100% accuracy when the smoothing algorithm along its parameters is perfectly known.
A mathematically perfect "anti-hardware-smoothing."
Download Reconstructor from latest releases.
Then copy zip contents to:
| Platform | Path |
|---|---|
| Windows | %localappdata%\OpenTabletDriver\Plugins |
| Linux | ~/.config/OpenTabletDriver/Plugins |
| MacOS | $HOME/Library/Application Support/OpenTabletDriver/Plugins |
Most of the explanation for the configurations are available as a tooltip. More information about moving averages can be found here.
Below are the in-depth explanation and proofs to how and why Reconstructor works, explained through showing the derivation for the reconstruction of original data from smoothed data.
Tablets with smoothing employ some form of noise reduction to improve drawing experience at the cost of some latency. Reconstructor works by assuming that the smoothing algorithm done by the tablet's hardware is some form of moving average.
As a sidenote, hawku's smoothing is a form of cumulative moving average.
For the following equations, we will have to define several variables as the following:
is the smoothed data
is the original data
is the amount of samples to consider, or alternatively, the window of the moving average
is the weight applied by exponential moving average (EMA) or modified cumulative moving average (MCMA).
Moving average (MA) is defined as:
And the following is the derivation process to get back:
private static Vector2 ReverseMAFunc(IEnumerable<Vector2> trueHistory, Vector2 input, int window)
{
Vector2 sum = new Vector2();
foreach (var item in trueHistory)
sum += item;
return (input * window) - sum;
}Exponential Moving Average (EMA) is defined as:
And the following is the derivation to get back:
private static Vector2 ReverseEMAFunc(Vector2 currentEMA, Vector2 lastEMA, float weight)
{
return ((currentEMA - lastEMA) / weight) + lastEMA;
}