No BSD License  

Highlights from
Savitzky-Golay smoothing and differentiation filter (closed-formed solutions)

Be the first to rate this file! 8 Downloads (last 30 days) File Size: 4.14 KB File ID: #6047

Savitzky-Golay smoothing and differentiation filter (closed-formed solutions)

by Jianwen Luo

 

14 Oct 2004 (Updated 15 Oct 2004)

explicit (closed-formed) solutions of the Savitzky-Golay smoothing and differentiation filter

| Watch this File

File Information
Description

Obtain the explicit (closed-formed) solutions of the Savitzky-Golay smoothing and differentiation filter using the Gram polynomials.

Here only the filters for the central point (midpoint) are considered. However, the solutions for the initial or end points can be easily obtained by slightly revising the rounte.
 
  Input:
  n: polynomial degree
  s: derivative(differentiation) order (0=smoothing)
 
  Output:
  h: filter coefficients(convoluction weights)
        it is a closed-formed formula with the following parameters:
        i:
        2*m+1: data point number
        i: convolution weight of the i-th point (-m<=i<=m)
 
  Author:
        Jianwen Luo,Ph.D Candidate
        Email:luojw@bme.tsinghua.edu.cn, luojw@ieee.org
        Date: Oct 14,2004
        Department of Biomedical Engineering
        Tsinghua University, Beijing 100084, P. R. China
 
  References:
  [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]P. A. Gorry, "General Least-Squares Smoothing and Differentiation by the Convolution (Savitzky-Golay) Method," Analytical Chemistry, vol. 62, pp. 570-573, 1990.
  [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.
 
  Examples:
  for n=0:5 %Equ. I-II in Ref. [3]
      s=0;
      disp(sprintf('%d-th th polynomial,%d-th derivatie:',n,s));
      sgsdf_explicit(n,s)
      disp('press any key to continue...');
      pause
  end
  
  for n=1:6 %Equ. III-V in Ref. [3]
      s=1;
      disp(sprintf('%d-th th polynomial,%d-th derivatie:',n,s));
      sgsdf_explicit(n,s)
      disp('press any key to continue...');
      pause
  end
  
  for n=2:6 %Equ. VI-VII in Ref. [3]
      s=2;
      disp(sprintf('%d-th th polynomial,%d-th derivatie:',n,s));
      sgsdf_explicit(n,s)
      disp('press any key to continue...');
      pause
  end
  
  for n=3:6 %Equ. VIII-IX in Ref. [3]
      s=3;
      disp(sprintf('%d-th th polynomial,%d-th derivatie:',n,s));
      sgsdf_explicit(n,s)
      disp('press any key to continue...');
      pause
  end
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    Note the typo in Equ. IX of Ref. [3].
    The term -50m should read +50m.
    See http://listserv.umd.edu/cgi-bin/wa?A2=ind0201&L=ics-l&F=&S=&P=2994
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
  for n=4:5 %Equ. X in Ref. [3]
      s=4;
      disp(sprintf('%d-th th polynomial,%d-th derivatie:',n,s));
      sgsdf_explicit(n,s)
      disp('press any key to continue...');
      pause
  end
  
  for n=5:6 %Equ. XI in Ref. [3]
      s=5;
      disp(sprintf('%d-th th polynomial,%d-th derivatie:',n,s));
      sgsdf_explicit(n,s)
      disp('press any key to continue...');
      pause
  end

Acknowledgements
This submission has inspired the following:
z-transform of 1D & 2D Savitzky-Golay Smoothing and Differentiation Filter
MATLAB release MATLAB 7.0.1 (R14SP1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
15 Oct 2004 Jianwen Luo

See all the contributions in MATLAB Central File Exchange at http://www.mathworks.com/matlabcentral/fileexchange/loadFileList.do?objectType=search&criteria=savitzky+or+sgolayfilt&Search=Go

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
filter design Jianwen Luo 22 Oct 2008 07:33:06
filter analysis Jianwen Luo 22 Oct 2008 07:33:06
savitzkygolay Jianwen Luo 22 Oct 2008 07:33:06
smoothing Jianwen Luo 22 Oct 2008 07:33:06
differentiation Jianwen Luo 22 Oct 2008 07:33:06
explicit Jianwen Luo 22 Oct 2008 07:33:06
closedformed Jianwen Luo 22 Oct 2008 07:33:06

Contact us at files@mathworks.com