Repository navigation
Pseudo‐Polyfit Filter
The Pseudo-Polyfit Filter is a pre-transform plugin, which means it operates on tablet coordinates. For the average user's case, it should apply before almost all other pre-transform plugins, as it relies heavily on raw tablet data, more so than Noise Compensation. The plugin is synchronous.
The plugin uses a little trick where for evenly spaced points in time, a weighted sum of values using pre-computed weights for a specific amount of samples and derivatives taking far less than a microsecond matches the output of a polynomial fit that is then evaluated at t=0, which takes much more time even at a smaller amount of samples and derivatives, scaling even greater with samples and derivatives. Because of this optimization, quite a few fits can be done in one report with little impact on performance.
This setting looks better up here. It lerps the output between the position filter (0.0) and the velocity filter (1.0). If one of those values is exactly picked, the other will not even run.
The filter subtracts a fulcrum position within the sample range close to the latest position from all sample positions. then rotates all sample positions about the origin by the inverted angle from the fulcrum position to the latest position. This is for if Dynamic Threshold is being used, which makes it so different fits can be used for the approximate magnitude and direction of movement. Then, it does its fitting, rotates it back by the angle, and adds the fulcrum position back.
Decides the samples used for fitting.
Decides the derivatives used for fitting.
If this is above 0, then the filter starts at a lower derivative value based on movement relative to this setting, and climbs up if the fits are not sufficiently close to the adjusted latest position. The rotated X and Y derivative values can be different. The amount of samples used can change if the movement velocity is low enough.
If this is checked, multiple fits across numbers of samples and derivatives will be averaged for the position filter's output.
Somehow, fitting some number of samples of per-report positional change and adding that to a filter's output every report does not cause drift. Averaging multiple of these fits also doesn't cause drift. This is save for the initial positions/velocities being incorrect, which is similar to applying simple EMA to per-report directional change, but that has the same movement as normal EMA. This is quite different, as the points being fitted are not immediate position points but points representing the movement between them. There is no rotation or adaptation this time around, as that causes drift.
1D refers to fitting the samples to 1 derivative, while 2D refers to fitting the samples to 2 derivatives. They are all added up and then divided by their total count.
The filter will start adding up fits to samples starting at the amount set by this setting.
The filter will add up this many fits for the number of derivatives.