Smooths a curve by modifying the Y values to remove sharp changes. |
||
Syntax |
Ynew = Suppress(X, Y, sharpness) |
|
Arguments |
Name |
Description |
X |
A vector of real domain values that is assumed to be sorted in ascending order. |
|
Y |
A vector of real range values. |
|
sharpness |
A number from 0 to 1 which sets the sharpness threshold. 0 = every point is suppressed. 1 = no points are suppressed. |
|
Outputs |
Name |
Description |
Ynew |
The smoothed version of Y. |
|
Example 1 |
Remove a spike from a curve. |
|
Syntax |
|
|
Ynew = Suppress([1:1:5], [1,1,1E+6,2,2], 0.9) |
||
Results |
|
|
Ynew = 1 1 1.5 2 2 |
||
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. |
|
See Also: |