Savitzky-Golay filter implementation. For more information see http://www.nrbook.com/a/bookcpdf/c14-8.pdf. This implementation, however, does not use FFT
@author Marcin Rzeźnicki
Savitzky-Golay filter implementation. For more information see http://www.nrbook.com/a/bookcpdf/c14-8.pdf. This implementation, however, does not use FFT
@author Marcin Rzeźnicki
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| computeSGCoefficients | 1 | Computes Savitzky-Golay coefficients for given parameters |
| .ctor | 1 | Constructs Savitzky-Golay filter which uses specified numebr of surrounding data points |
| appendDataFilter | 1 | Appends data filter |
| appendPreprocessor | 1 | Appends data preprocessor |
| insertDataFilter | 1 | Inserts data filter |
| insertPreprocessor | 1 | Inserts preprocessor |
| removeDataFilter | 2 | Removes data filter |
| removePreprocessor | 2 | Removes preprocessor |
| smooth | 10 | Smooths data by using Savitzky-Golay filter. |
03 Properties
04 Members
Int32, Int32, Int32)Computes Savitzky-Golay coefficients for given parameters
| Name | Type | Description |
|---|---|---|
nl | Int32 | numer of past data points filter will use |
nr | Int32 | number of future data points filter will use |
degree | Int32 | order of smoothin polynomial |
Savitzky-Golay coefficients
Int32, Int32)Constructs Savitzky-Golay filter which uses specified numebr of surrounding data points
| Name | Type | Description |
|---|---|---|
nl | Int32 | numer of past data points filter will use |
nr | Int32 | numer of future data points filter will use |
Appends data filter
| Name | Type | Description |
|---|---|---|
dataFilter | DataFilter | dataFilter |
Appends data preprocessor
| Name | Type | Description |
|---|---|---|
p | Preprocessor | preprocessor |
Int32)Inserts data filter
| Name | Type | Description |
|---|---|---|
dataFilter | DataFilter | data filter |
index | Int32 | where it should be placed in data filters queue |
Int32)Inserts preprocessor
| Name | Type | Description |
|---|---|---|
p | Preprocessor | preprocessor |
index | Int32 | where it should be placed in preprocessors queue |
Removes data filter
| Name | Type | Description |
|---|---|---|
dataFilter | DataFilter | data filter to be removed |
{@code true} if data filter existed and was removed, {@code false} otherwise
Int32)Removes data filter
| Name | Type | Description |
|---|---|---|
index | Int32 | which data filter to remove |
removed data filter
Int32)Removes preprocessor
| Name | Type | Description |
|---|---|---|
index | Int32 | which preprocessor to remove |
removed preprocessor
Removes preprocessor
| Name | Type | Description |
|---|---|---|
p | Preprocessor | preprocessor to be removed |
{@code true} if preprocessor existed and was removed, {@code false} otherwise
Double(), Double())Smooths data by using Savitzky-Golay filter. This method will use 0 for any element beyond {@code data} which will be needed for computation (you may want to use some Preprocessor)
| Name | Type | Description |
|---|---|---|
data | Double() | data for filter |
coeffs | Double() | filter coefficients |
filtered data
Double(), Double(), Double(), Double())Smooths data by using Savitzky-Golay filter. Smoothing uses {@code leftPad} and/or {@code rightPad} if you want to augment data on boundaries to achieve smoother results for your purpose. If you do not need this feature you may pass empty arrays (filter will use 0s in this place, so you may want to use appropriate preprocessor)
| Name | Type | Description |
|---|---|---|
data | Double() | data for filter |
leftPad | Double() | left padding |
rightPad | Double() | right padding |
coeffs | Double() | filter coefficients |
filtered data
Double(), Double(), Double(), Int32, Double()())Smooths data by using Savitzky-Golay filter. Smoothing uses {@code leftPad} and/or {@code rightPad} if you want to augment data on boundaries to achieve smoother results for your purpose. If you do not need this feature you may pass empty arrays (filter will use 0s in this place, so you may want to use appropriate preprocessor). If you want to use different (probably non-symmetrical) filter near both ends of (padded) data, you will be using {@code bias} and {@code coeffs}. {@code bias} essentially means "how many points of pad should be left out when smoothing". Filters taking this condition into consideration are passed in {@code coeffs}. coeffs[0] is used for unbiased data (that is, for data[bias]..data[data.length-bias-1]). Its length has to be nr + nl + 1. Filters from range coeffs[coeffs.length - 1] to coeffs[coeffs.length - bias] are used for smoothing first {@code bias} points (that is, from data[0] to data[bias]) correspondingly. Filters from range coeffs[1] to coeffs[bias] are used for smoothing last {@code bias} points (that is, for data[data.length-bias]..data[data.length-1]). For example, if you use 5 past points and 5 future points for smoothing, but have only 3 meaningful padding points - you would use {@code bias} equal to 2 and would pass in {@code coeffs} param filters taking 5-5 points (for regular smoothing), 5-4, 5-3 (for rightmost range of data) and 3-5, 4-5 (for leftmost range). If you do not wish to use pads completely for symmetrical filter then you should pass bias = nl = nr
| Name | Type | Description |
|---|---|---|
data | Double() | data for filter |
leftPad | Double() | left padding |
rightPad | Double() | right padding |
bias | Int32 | how many points of pad should be left out when smoothing |
coeffs | Double()() | array of filter coefficients |
filtered data
Double(), Int32, Int32, Double())Runs filter on data from {@code from} (including) to {@code to} (excluding). Data beyond range spanned by {@code from} and {@code to} will be used for padding
| Name | Type | Description |
|---|---|---|
data | Double() | data for filter |
from | Int32 | inedx of the first element of data |
to | Int32 | index of the first element omitted |
coeffs | Double() | filter coefficients |
filtered data
Double(), Int32, Int32, Int32, Double()())Runs filter on data from {@code from} (including) to {@code to} (excluding). Data beyond range spanned by {@code from} and {@code to} will be used for padding. See SGFilter.smooth() for usage of {@code bias}
| Name | Type | Description |
|---|---|---|
data | Double() | data for filter |
from | Int32 | inedx of the first element of data |
to | Int32 | index of the first element omitted |
bias | Int32 | how many points of pad should be left out when smoothing |
coeffs | Double()() | filter coefficients |
filtered data
Single(), Double())See SGFilter.smooth(). This method converts {@code data} to double for computation and then converts it back to float
| Name | Type | Description |
|---|---|---|
data | Single() | data for filter |
coeffs | Double() | filter coefficients |
filtered data
Single(), Single(), Single(), Double())See SGFilter.smooth(). This method converts {@code data} {@code leftPad} and {@code rightPad} to double for computation and then converts back to float
| Name | Type | Description |
|---|---|---|
data | Single() | data for filter |
leftPad | Single() | left padding |
rightPad | Single() | right padding |
coeffs | Double() | filter coefficients |
filtered data
Single(), Single(), Single(), Int32, Double()())See SGFilter.smooth(). This method converts {@code data} {@code leftPad} and {@code rightPad} to double for computation and then converts back to float
| Name | Type | Description |
|---|---|---|
data | Single() | data for filter |
leftPad | Single() | left padding |
rightPad | Single() | right padding |
bias | Int32 | how many points of pad should be left out when smoothing |
coeffs | Double()() | array of filter coefficients |
filtered data
Single(), Int32, Int32, Double())See SGFilter.smooth(). This method converts {@code data} to double for computation and then converts it back to float
| Name | Type | Description |
|---|---|---|
data | Single() | data for filter |
from | Int32 | inedx of the first element of data |
to | Int32 | index of the first element omitted |
coeffs | Double() | filter coefficients |
filtered data
Single(), Int32, Int32, Int32, Double()())See SGFilter.smooth(). This method converts {@code data} to double for computation and then converts it back to float
| Name | Type | Description |
|---|---|---|
data | Single() | data for filter |
from | Int32 | inedx of the first element of data |
to | Int32 | index of the first element omitted |
bias | Int32 | how many points of pad should be left out when smoothing |
coeffs | Double()() | filter coefficients |
filtered data
number of past data points that this filter uses
number of future data points that this filter uses