SavitzkyGolayFiltering
Advanced Analysis Library Only
AnalysisLibErrType SavitzkyGolayFiltering (double inputSequence[], ssize_t numberOfElements, int polynomialOrder, int nSidePoints, double weightingVector[], double filteredData[]);
Purpose
Applies a Savitzky-Golay smoothing FIR filter to the sequence inputSequence.This function smooths a noisy signal using piece-by-piece fitting of a polynomial function to the signal. The fitting is done by least squares minimization. See SavitzkyGolayCoef for how the Savitzky-Golay filter coefficients are obtained to apply them here to produce the filtered signal.
Parameters
| Input | ||
| Name | Type | Description |
| inputSequence | double [] | The sequence to be filtered. |
| numberOfElements | ssize_t | The length of inputSequence. |
| polynomialOrder | int | The polynomial order. |
| nSidePoints | int | (2*nSidePoints +1) is frameSize, which specifies how many data points to use in the polynomial fitting. frameSize must be greater than polynomialOrder. |
| weightingVector | double [] | A weighting vector with length frameSize, used in the least square polynomial fitting. If weightingVector is NULL, the function assumes all points have the equal weight. |
| Output | ||
| Name | Type | Description |
| filteredData | double [] | The data after the filter is applied. |
Return Value
| Name | Type | Description |
| status | AnalysisLibErrType | A value that specifies the type of error that occurred. Refer to analysis.h for definitions of these constants. |
Additional Information
Library: Advanced Analysis Library
Include file: analysis.h
LabWindows/CVI compatibility: LabWindows/CVI 8.1 and later