suppress

Removes spikes from a curve.

Syntax

suppress(indep_vector, dep_vector, sharpness)

Argument

indep_vector
The independent vector.
dep_vector
The dependent vector.
sharpness
A number from 0 to 1 which sets the sharpness threshold.
0
Every point is suppressed.
1
No points are suppressed.

Example

Templex Expression Results
{x = 1:5:1}

{y = {1, 1, 1E6, 2, 2}}

{suppress(x, y, .9)}

1, 1. 1.5, 2, 2
Curve Math Vectors Results
x = c1.x

y = suppress(c1.x, c1.y, .9)

A curve is created which is the original curve c1 with spikes removed according to the sharpness criteria (0.9).

Comments

suppress is typically used to remove discontinuities from otherwise continuous curves.

The sharpness for each data point is based on the cosine of the included angle with the two surrounding data points. If the calculated sharpness for a data point is less than the sharpness threshold, the data point is unaffected. If the calculated sharpness for a data point is greater than the sharpness threshold, the data point is modified to be the average of the two surrounding data points. The sharpness may not be equal to 0 or 1.