Skip to content

Reconstructor

X9VoiD edited this page Dec 10, 2020 · 19 revisions

About

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."

Installation

Download Reconstructor from latest releases. (No official release yet so download it from here and use OTD dev build)

Then copy zip contents to:

Platform Path
Windows %localappdata%\OpenTabletDriver\Plugins
Linux ~/.config/OpenTabletDriver/Plugins
MacOS $HOME/Library/Application Support/OpenTabletDriver/Plugins

Configuration

Most of the explanation for the configurations are available as a tooltip. More information about moving averages can be found here.

Technical Details

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.

How it works

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 exponential 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)

Reverse MA

Math

Moving average (MA) is defined as:

And the following is the derivation process to get back:

Code

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;
}

Reverse EMA

Math

Exponential Moving Average (EMA) is recursively defined as:

And the following is the derivation to get back:

Code

private static Vector2 ReverseEMAFunc(Vector2 currentEMA, Vector2 lastEMA, float weight)
{
    return ((currentEMA - lastEMA) / weight) + lastEMA;
}

Acknowledgement

Big thanks to InfinityGhost for the initial idea about reversing the hardware smoothing itself instead of compensating for it through predictions.

VoiDPlugins

Experimental
Filters
Output Modes
Bindings

Clone this wiki locally