No BSD License  

Highlights from
The Even-length Savitzky-Golay Filter

from The Even-length Savitzky-Golay Filter by Jianwen Luo
The even-length Savitzky-Golay filter with a Gram polynomial approach.

sgsdf_even_closed_form(n,s)
function sgsdf_even_closed_form(n,s)
% Savitzky-Golay Smoothing and Differentiation Filter of Even Length
% (Closed-Form Solution)
%
% n:      polynomial degree
% s:      derivative(differentiation) order (0=smoothing)
%
% Author:
% Jianwen Luo <luojw@ieee.org> 2005-06-12
% Department of Biomedical Engineering
% Tsinghua University, Beijing 100084, P. R. China 
%
% References: 
% [1]	Luo J W, Ying K, Bai J. 
%     Savitzky-Golay Smoothing and Differentiation Filter for Even Number Data, 
%     Signal Process. 2005, 85(7): 1429-1434
% [2]	Luo J W, Bai J. 
%     Savitzky-Golay Smoothing and Differentiation Filter of Even Length: A Gram Polynomial Approach, 
%     Spectroscopy. 2005, in press

i=sym('i');% -m+1<=i<=m
m=sym('m');
t=sym(0); %evaluated at the imaginary central point
subs(factor(hinstm(i,n,s,t,m)),'i','i-1/2')

Contact us at files@mathworks.com