image thumbnail

2-D Savitzky-Golay Smoothing and Differentiation Filter.

version (2.59 KB) by Jianwen Luo
2-D Savitzky-Golay smoothing and differentiation filters, including those for mixed partial ...


Updated 29 Nov 2005

No License

2-D Savitzky-Golay (SG) Smoothing and Differentiation Filter.
The filter coefficients are calculated from the decomposation property of the 2-D SG filters.
In addition, the filter coefficients for mixed partial derivative can be obtained by this function.

x = x data point, e.g., -3:3 (both odd-length and even-lenght
are accepted, symmetry is prefered but not restricted)
y = y data point, e.g., -2:2 (both odd-length and even-lenght
are accepted, symmetry is prefered but not restricted)
nx =x polynomial order default=1
ny =y polynomial order default=1
dx = differentiation order in x direction (0<=d<=nx) default=0
dy = differentiation order in y direction (0<=d<=ny) default=0
flag_coupling = with or without the consideration of the coupling
terms, between x and y. default=0
h = filter coefficients obtained.


Jianwen Luo <>

[1] J. W. Luo, K. Ying, P. He, and J. Bai, "Properties of Savitzky-Golay Digital Differentiators,"
Digital Signal Processing, vol. 15, pp. 122-136, 2005.
[2] 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.
[3] K. L. Ratzlaff and J. T. Johnson, "Computation of Two-Dimensional Polynomial Least-Squares Convolution Smoothing Integers,"
Analytical Chemistry, vol. 61, pp. 1303-1305, 1989.
[4] J. E. Kuo, H. Wang, and S. Pickup, "Multidimensional Least-Squares Smoothing Using Orthogonal Polynomials,"
Analytical Chemistry, vol. 63, pp. 630-635, 1991.
[6] T. A. Sakharuk, "Computation of Weighting Functions for Smoothing 2-Dimensional Data by Local Polynomial-Approximation Techniques,"
Analytica Chimica Acta, vol. 249, pp. 331-336, 1991.
[7] P. Meer and I. Weiss, "Smoothed Differentiation Filters for Images,"
Journal of Visual Communication and Image Representation, vol. 3, pp. 58-72, 1992.
[8] P. Nikitas and A. Pappa-Louisi, "Comments on the two-dimensional smoothing of data,"
Analytica Chimica Acta, vol. 415, pp. 117-125, 2000.

Cite As

Jianwen Luo (2021). 2-D Savitzky-Golay Smoothing and Differentiation Filter. (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R13SP1
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!