Savitzky-Golay smooth/differentiat​ion filters and filter application

버전 1.0.0.0 (5.18 KB) 작성자: Diederick
Routine to generate Savitzky-Golay smoothing and differentiation filters and routine to apply these
다운로드 수: 4.5K
업데이트 날짜: 2011/2/4

라이선스 보기

Contains savitzkyGolay.m and savitzkyGolayFilt.m:
Function:
Savitzky-Golay Smoothing and Differentiation Filter
The Savitzky-Golay smoothing/differentiation filter (i.e., the
polynomial smoothing/differentiation filter, or the least-squares
smoothing/differentiation filters) optimally fit a set of data
points to polynomials of different degrees.
See for details in Matlab Documents (help sgolay). The sgolay
function in Matlab can deal with only symmetrical and uniformly
spaced data of even number.
This function presented here is a general implement of the sgolay
function in Matlab. The Savitzky-Golay filter coefficients for even
number, nonsymmetrical and nonuniformly spaced data can be
obtained. And the filter coefficients for the initial point or the
end point can be obtained too. In addition, either numerical
results or symbolical results can be obtained. Lastly, this
function is faster than MATLAB's sgolay.

Usage:
[fc,df] = savitzkyGolay(x,n,dn,x0,flag)
input:
x = the original data point, e.g., -5:5
n = polynomial order
dn = differentation order (0=smoothing), default=0
x0 = estimation point, can be a vector default=0
W = weight vector, can be empty
must have same length as x0 default=identity
flag = numerical(0) or symbolical(1), default=0

output:
fc = filter coefficients obtained (B output of sgolay).
df = differentiation filters (G output of sgolay).

.

.

savitzkyGolayFilt(X,N,DN,F) filters the signal X using a Savitzky-Golay
(polynomial) filter. The polynomial order, N, must be less than the
frame size, F, and F must be odd. DN specifies the differentiation
order (DN=0 is smoothing). For a DN higher than zero, you'll have to
scale the output by 1/T^DN to acquire the DNth smoothed derivative of
input X, where T is the sampling interval. The length of the input X
must be >= F. If X is a matrix, the filtering is done on the columns
of X.

Note that if the polynomial order N equals F-1, no smoothing
will occur.

savitzkyGolayFilt(X,N,DN,F,W) specifies a weighting vector W with
length F containing real, positive valued weights employed during the
least-squares minimization. If not specified, or if specified as
empty, W defaults to an identity matrix.

savitzkyGolayFilt(X,N,DN,F,[],DIM) or savitzkyGolayFilt(X,N,DN,F,W,DIM)
operates along the dimension DIM.

인용 양식

Diederick (2024). Savitzky-Golay smooth/differentiation filters and filter application (https://www.mathworks.com/matlabcentral/fileexchange/30299-savitzky-golay-smooth-differentiation-filters-and-filter-application), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2010b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Smoothing and Denoising에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0