资源简介
采用S-G平滑对所采集的数据进行平滑,去除数据图只的毛躁。
代码片段和文件信息
function fc=sgsdf(xndnx0flag)
%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.
%Usage:
% fc = sgsdf(xndnx0flag)
% x = the original data point e.g. -5:5
% n = polynomial order default=1
% dn = differentation order (0=smoothing) default=0
% x0 = estimation point default=0
% flag = numerical(0) or symbolical(1) default=0
% fc = filter coefficients obtained.
%Notes:
%1. x can be arbitrary e.g. odd number or even numbersymmetrical or nonsymmetrical uniformly spaced
% or nonuniformly spaced etc.
%2. x0 can be arbitrary e.g. the initial pointthe end pointetc.
%3. Either numerical results or symbolical results can be obtained.
%Example:
% sgsdf([-3:3]2000)
% sgsdf([-3:3]2001)
% sgsdf([-3:3]20-31)
% sgsdf([-3:3]2121)
% sgsdf([-2:3]211/21)
% sgsdf([-5:2:5]2101)
% sgsdf([-1:1 2:2:8]2001)
%Author:
% Jianwen Luo 2003-10-05
% Department of Biomedical Engineering Department of Electrical Engineering
% Tsinghua University Beijing 100084 P. R. China
%Reference
%[1]A. Savitzky and M. J. E. Golay “Smoothing and Differentiation of Data by Simplified Least Squares Procedures“
% Analytical Chemistry vol. 36 pp. 1627-1639 1964.
%[2]J. Steinier Y. Termonia and J. Deltour “Comments on Smoothing and Differentiation of Data by Simplified Least Square Procedures“
% Analytical Chemistry vol. 44 pp. 1906-1909 1972.
%[3]H. H. Madden “Comments on Savitzky-Golay Convolution Method for Least-Squares Fit Smoothing and Differentiation of Digital Data“
% Analytical Chemistry vol. 50 pp. 1383-1386 1978.
%[4]R. A. Leach C. A. Carter and J. M. Harris “Least-Squares Polynomial Filters for Initial Point and Slope Estimation“
% Analytical Chemistry vol. 56 pp. 2304-2307 1984.
%[5]P. A. Baedecker “Comments on Least-Square Polynomial Filters for Initial Point and Slope Estimatio
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 122 2008-05-14 18:20 sgsdf\Matlab中文论坛--助努力的人完成毕业设计.url
文件 4126 2005-12-05 12:16 sgsdf\program\sgsdf.m
文件 11530 2003-10-05 20:38 sgsdf\program\test_sgsdf.m
文件 3434 2008-05-15 08:26 sgsdf\使用帮助:新手必看.htm
目录 0 2008-06-03 13:25 sgsdf\program
目录 0 2016-10-17 12:18 sgsdf
----------- --------- ---------- ----- ----
19212 6
- 上一篇:转子临界转速-Matlab
- 下一篇:matlab三体问题
评论
共有 条评论