function hnstm=sgsdf_even_gram_poly(n,s,t,m)
% Savitzky-Golay Smoothing and Differentiation Filter of Even Length
%
% hnstm=sgsdf_gram_poly(n,s,t,m)
% n: polynomial degree
% s: derivative(differentiation) order (0=smoothing)
% t: evaluation point (commonly,t=0,i.e.,smoothing or differentiation
% at the imaginary central point of the 2*m points)
% 2*m: data point number,i.e., filter length
% hnstm: convoluction coefficients
%
% 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
hnstm=[];
for i=-m+1/2:m-1/2
hnstm=[hnstm hinstm(i,n,s,t,m)];
end