
Chau Chemometrics From Basics to Wavelet Transform
.pdf18 |
introduction |
MuPAD (http://www.mupad.de/ ). MuPAD is a computer algebra system originally developed by the MuPAD Research Group under the direction of Professor B. Fuchssteiner at the University of Paderborn, Germany. It is free (provided gratis) for personal use.
LastWave (http://www.cmap.polytechnique.fr/ bacry/LastWave/ index.html ). LastWave is a signal processing--oriented command language and is available for download from the Website. It is written in C and runs on X11/Unix, Windows/CygWin, and Macintosh platforms. It has been designed for use by anyone who knows about signal processing and wants to play around with wavelets and wavelet-like techniques. The command-line language employs a MATLAB-like syntax and includes high-level object-oriented graphic elements. It allows the user to deal with high-level structures such as signals, images, wavelet transforms, extrema representation, and short-time Fourier transform. One can add very easily some new commands in LastWave using either the command language itself or the C-language. New commands can be grouped into a package that can be loaded easily later. Several other packages have already been added to LastWave allowing high-level signal processing such as wavelet transforms (1D and 2D), extrema representations of wavelet transforms (1D and 2D), fractal analysis, matching pursuit, and compression.
Minitab (http://www.minitab.com/ ). Minitab is an all-in-one statistical and graphical analysis software package. Statistical tests such as regression analysis, analysis of variance, multivariate analysis, and time-series analysis can be completed easily. The Stat Guide is an extremely helpful tool in interpreting statistical graphs and analyses for users with minimal statistical background.
Extract (http://www.extractinformation.com/ ). Extract is designed for visualization of the structure and quantitative relationships in data. Multivariate statistical methods can then be used to model the data. A trial version of the software can be obtained after completion of a registration form on the Extract Information AB Webpage.
Sirius and Xtricator (http://www.prs.no/ ). Sirus and Xtricator are two pieces of software developed by the Pattern Recognition Systems (PRS), a company founded by Professor Olav M. Kvalheim of Norway. Sirius is a tool for multivariate analysis that covers all the essential chemometrics methods within multivariate exploratory analysis, classification/discrimination, and calibration/response modeling. Experimental design is also supported (please refer to Chapter 3 for an introduction to these methods). Xtricator
references |
19 |
is a software product that is developed for quantitative and qualitative analysis of data from hyphenated analytical instruments such as HPLC-DAD and GC-MS. It is capable of resolving two-way bilinear multicomponent instrumental data into spectra and chromatograms of pure analytes using heuristic evolving latent projection (HELP) techniques as mentioned in Section 3.6.2.3. A trial version of the software can be obtained after filling in a registration form on the PRS Webpage.
REFERENCES
1.T. Hirschfeld, Anal. Chem. 52:297A--303A (1980).
2.R. Upton, ed., ‘‘Dang Gui Root, Angelica sinensis (Oliv.) Diels,’’ in Standards of Analysis, Quality Control, and Therapeutics, American Herbal Pharmacopoeia, Scotts Valley, California, 2003.
3.F. Gong, F. T. Chau, and Y. Z. Liang, unpublished results.
4.S. Wold, ‘‘Chemometrics: What do we mean with it, and what do we want from it?’’ and S. D. Brown, ‘‘Has the ‘chemometrics revolution’ ended? Some views on the past, present and future of chemometrics,’’ Papers on Chemometrics: Philosophy, History and Directions of InCINC ’94, http://www.emsl.pnl.gov:2080/docs/incinc/homepage.html.
5.D. G. Howery and R. F. Hirsch, ‘‘Chemometrics in the chemistry curriculum,’’ J. Chem. Ed. 60:656--659 (1983).
6.CAMO ASA, Olav Tryggvasonsgt. 24, N-7011 Trondheim. Email: camo@ camo.no.
7.PRS, Bergen High-Technology Center, Thormohlensgate 55, N-5008 Bergen, Norway. Email: Info@prs.no.
8.T. Braun, A. Schubert, and G. Schubert, ‘‘The most cited books in analytical chemistry,’’ Anal. Chem. 73:667A--669A (2001).
9.E. R. Malinowski, Factor Analysis in Chemistry, 3rd ed., Wiley, New York, 2002.
10.P. R. Bevington and D. K. Robinson, Data Reduction and Error Analysis for the Physical Sciences, 3rd ed., McGraw-Hill, New York, 2002.
11.N. R. Draper and H. Smith, Applied Regression Analysis, 2nd ed., Wiley, New York, 1981.
12.H. Martens and T. Naes, Multivariate Calibration, Wiley, Chichester, UK, 1989.
13.M. Otto, Chemometrics: Statistics and Computer Applications in Analytical Chemistry, Wiley, New York, 1999.
14.P. Geladi and B. R. Kowalski, ‘‘Partial least-squares regression: A tutorial,’’
Anal. Chim. Acta 185:1--17 (1986).
15.S. Wold, ‘‘Pattern recognition by means of disjoint principal components models,’’ Pattern Recogn. 8:127--139 (1976).
16.E. Vigneau, M. F. Devaux, E. M. Qannari, and P. Robert, ‘‘Principal component regression, ridge regression and ridge principal component regression in spectroscopy calibration,’’ J. Chemometr. 11:239--249 (1997).
20 |
introduction |
17.X. H. Liang, J. E. Andrews, and J. A. Dehaseth, ‘‘Resolution of mixture components by target transformation factor analysis and determinant analysis for the selection of targets,’’ Anal. Chem. 68:378--385 (1996).
18.M. Maeder, ‘‘Evolving factor-analysis for the resolution of overlapping chromatographic peaks,’’ Anal. Chem. 59:527--530 (1987).
19.M. Maeder and A. Zilian, ‘‘Evolving factor-analysis, a new multivariate technique in chromatography,’’ Chemometr. Intell. Lab. Syst. 3:205--213 (1988).
20.C. N. Ho, G. D. Christian, and E. R. Davidson, ‘‘Application of the method of rank annihilation to quantitative analyses of multicomponent fluorescence data from the video fluorometer,’’ Anal. Chem. 50:1108--1113 (1978).
21.E. Sanchez and B. R. Kowalski, ‘‘Generalized rank annihilation factor analysis,’’ Anal. Chem. 58:499--501 (1986).
22.E. R. Malinowski, ‘‘Window factor-analysis---theoretical derivation and application to flow-injection analysis data,’’ J. Chemometr. 6:29--40 (1992).
23.E. R. Malinowski, ‘‘Automatic window factor analysis---a more efficient method for determining concentration profiles from evolutionary spectra,’’ J. Chemometr. 10:273--279 (1996).
24.O. M. Kvalheim and Y. Z. Liang, ‘‘Heuristic evolving latent projections---
resolving 2-way multicomponent data. #1. Selectivity, latent-projective graph, datascope, local rank, and unique resolution,’’ Anal. Chem. 64:936--946 (1992).
25.Y. Z. Liang, O. M. Kvalheim, H. R. Kaller, D. L. Massart, P. Kiechle, and F. Erni, ‘‘Heuristic evolving latent projections---resolving 2-way multicomponent data. #2. Detection and resolution of minor constituents,’’ Anal. Chem. 64:946--953 (1992).
26.J. Zupan and J. Gasteiger, ‘‘Neural networks---a new method for solving chemical problems or just a passing phase,’’ Anal. Chim. Acta 248:1--30 (1991).
27.G. G. Andersson and P. Kaufmann, ‘‘Development of a generalized neural network,’’ Chemometr. Intell. Lab. Syst. 50:101--105 (2000).
28.D. B. Hibbert, ‘‘Genetic algorithms in chemistry,’’ Chemometr. Intell. Lab. Syst. 19:277--293 (1993).
29.C. B. Lucasius and G. Kateman, ‘‘Understanding and using genetic algorithms. #1. Concepts, properties and context,’’ Chemometr. Intell. Lab. Syst. 19:1--33 (1993).
30.C. B. Lucasius and G. Kateman, ‘‘Understanding and using genetic algorithms. #2. Representation, configuration and hybridization,’’ Chemometr. Intell. Lab. Syst. 25:99--145 (1994).
31.J. H. Kalivas, ‘‘Optimization using variations of simulated annealing,’’ Chemometr. Intell. Lab. Syst. 15:1--12 (1992).
32.U. Horchner and J. H. Kalivas, ‘‘Simulated-annealing-based optimization algorithms---fundamentals and wavelength selection applications,’’ J. Chemometr. 9:283--308 (1995).
33.S. G. Mallat, A Wavelet Tour of Signal Processing, Academic Press, London, 1998.
references |
21 |
34.The MathWorks, Inc., MATLAB for Windows, Natick, Massachusetts, USA.
35.Y. Z. Liang, O. M. Kvalheim, and R. Manne, ‘‘White, grey, and black multicomponent systems. A classification of mixture problems and methods for their quantitative analysis,’’ Chemometr. Intell. Lab. Syst. 18:235--250 (1993).
36.K. M. Leung, F. T. Chau, and J. B. Gao, ‘‘Wavelet transform: A novel method for derivative calculation in analytical chemistry,’’ Anal. Chem. 70:5222--5229 (1998).
37.K. M. Leung, F. T. Chau, and J. B. Gao, ‘‘A review on applications of wavelet transform techniques in chemical analysis: 1989--1997,’’ Chemometr. Intell. Lab. Syst. 43:165--184 (1998).
38.X. G. Shao, A. K. M. Leung, and F. T. Chau, ‘‘Wavelet transform,’’ Acc. Chem. Research 36:276--283 (2003).
39.B. K. Alsberg, A. M. Woodward, and D. B. Kell, ‘‘An introduction to wavelet transform for chemometricians: A time-frequency approach,’’ Chemometr. Intell. Lab. Syst. 37:215--239 (1997).

CHAPTER
2
ONE-DIMENSIONAL SIGNAL PROCESSING
TECHNIQUES IN CHEMISTRY
In this chapter, some widely used methods for processing one-dimensional chemical signals are discussed. Chemical signals are usually recorded as chromatograms, spectra, voltammograms, kinetic curves, titration curves, and in other formats. Nowadays, almost all of them are acquired in the digital vector form. In order to denoise, compress, differentiate, and do other things on the signals acquired, it is always necessary to pretreat them first. The signal processing methods discussed in this chapter can be roughly divided into three classes including smoothing methods, transformation methods, and numerical treatment methods. They are described one by one below with illustrative examples.
2.1.DIGITAL SMOOTHING AND FILTERING METHODS
In general, averaging is widely used to improve the signal-to-noise ratio (SNR) for analytical signals. Through this treatment, the influence of noise can be reduced because the signals are often distributed normally on both positive and negative sides. In carrying out the averaging operation on a dataset xi , the mean x¯ can be calculated by
|
|
i |
|
1 |
n |
|
|
x¯ = |
n |
xi |
(2.1) |
|
|
= |
|
|
|
1 |
|
√
Notice that the variance of x¯ is only 1/ n of the original variable xi . Thus, the averaging operation can increase the SNR of analytical signals. This explains why the spectrum of a sample generated from an infrared instrument in your laboratory is often the mean spectrum from several measurements. It should be pointed out here that most methods discussed in the following subsections are based on this principle.
Chemometrics: From Basics To Wavelet Transform. Foo-Tim Chau, Yi-Zeng Liang, Junbin Gao, and Xue-Guang Shao. Chemical Analysis Series, Volume 164. ISBN 0-471-20242-8. Copyright ? 2004 John Wiley & Sons, Inc.
23

24 one-dimensional signal processing techniques in chemistry
2.1.1. Moving-Window Average Smoothing Method
The moving-window average method is the classic and the simplest smoothing method. It can be utilized to enhance the SNR. The principle of this method is illustrated in Figure 2.1. Suppose that we have a raw signal vector, say, x = [x1, x2, . . . , xn−1, xn ]. In practice, a window size of (2m +1) data points has to be specified first before doing any smoothing calculation. Here, an averaging filter of window size of 5(m = 2) is employed to illustrate the computing procedure. At the beginning, the first five data are used to find the first smoothed datum x3 via the following equation with i = 3 and m = 2:
|
1 |
|
|
m |
|
xi = |
|
|
m xi +j |
(2.2) |
|
2m |
1 j |
||||
+ |
|
|
=− |
|
In this equation, xi denotes the smoothed value while xi +j are the original raw data, where i and j are the running indices. It should be noted that the first two data points, x1 and x2, cannot be smoothed in the process. After finding x3 , the next step is to move the window to the right by one datum to evaluate x4 (see Fig. 2.1). Then the procedure is repeated by moving the window successively along the equally spaced data until all the data are exhausted. As the width of the moving window is an important parameter
x2
x1
xn
xn-1
moving window
Figure 2.1. Moving-window-average filter for a window size of 2m + 1 = 5, that is, m = 2. It should be noted that for the extreme points, no smoothed data can be calculated because they are used for computing the first and the last averages. Top plot---the original raw signals; bottom plot---smoothed signals.

digital smoothing and filtering methods |
25 |
in this smoothing process, it has to be defined before any calculation is performed. The guidelines for choosing a right value for this parameter will be discussed in Section 2.3.
2.1.2. Savitsky--Golay Filter
The Savitsky--Golay filter is a smoothing filter based on polynomial regression [1--3]. Instead of simply using the averaging technique as mentioned previously, the Savitsky--Golay filter employs the regression fitting capacity to improve the smoothing results as depicted in Figure 2.2. From the plot, it can be seen that this method should perform better than the movingwindow average method as mentioned in Section 2.1.1 because it takes advantage of the fitting ability of polynomial regression. However, the formulation of the Savitsky--Golay filter is quite similar to that of the averaging filter [Eq. (2.2)]. The major difference between the moving-window average method and the Savitsky--Golay filter is that the latter one is essentially a weighted average method in the form of
|
1 |
|
|
m |
|
xi = |
|
|
m wj xi +j |
(2.3) |
|
2m |
1 j |
||||
+ |
|
|
=− |
|
j=2 |
Five point fitting |
|
|
j=-2 |
|
|
Seven point fitting |
moving window
Figure 2.2. The Savitsky--Golay filter with a window size of 2m + 1 = 5. Instead of averaging the data point in the moving window, it uses the polynomial fitting technique to determine the weights in Equation (2.3). Top plot---the original raw signals; bottom plot---smoothed signals.
26 one-dimensional signal processing techniques in chemistry
The problem now is how to find the correct weights wj in this formula through polynomial regression. In the following example, a five-point Savitsky--Golay filter is utilized to show how this can be done.
The Savitsky--Golay filter uses the following formula to fit the data first (see Fig. 2.2), and then finds all the weights through the least-squares technique by
xji = a0 + a1j + a2j 2 + · · · + ak j k |
|
( j = −m, −m + 1, . . . , m − 1, m; i = 1, . . . , n) |
(2.4) |
If the window size is 5 coupled with a quadratic model, formula (2.4) becomes
xji = a0 + a1j + a2j 2 ( j = −2, −1, 0, 1, 2; i = 1, . . . , n) |
(2.5) |
where the superscript i indicates the numbering of the original chemical data and j is the window size variable. As xji and j are known (see Fig. 2.2), the least-squares technique can be applied to find aR (R = 0, 1, 2). By substituting the right values in Eq. (2.5), the following set of linear equations is obtained:
|
|
|
|
|
|
x−i −22 |
= a0 + a1(−2) + a2(−2)2 |
|
|
|
|
|||||||||||||||||||||
|
|
|
|
|
|
|
|
− |
|
|
= |
|
|
|
+ − |
|
+ |
|
|
|
− |
|
|
|
|
|
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||
|
|
|
|
|
|
|
|
i |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
−1 |
|
|
a |
|
|
|
|
a ( 1) |
|
|
|
|
|
|
|
|
|
|
||||||
|
|
|
|
|
|
x i |
|
|
|
|
|
|
|
|
a ( 1)2 |
|
|
|
|
|||||||||||||
|
|
|
|
|
|
|
|
|
|
1 |
|
|
|
0 |
|
|
1 |
|
|
|
|
|
|
2 |
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ |
|
|
|
|
|
|
|
|
|
|
|
||||||
|
|
|
|
|
|
|
|
|
|
= |
a |
|
+ |
a |
(0) |
a |
|
(0) |
|
|
|
|
|
|
(2.6) |
|||||||
|
|
|
|
|
|
x |
0 |
|
|
0 |
|
|
|
|
|
|
|
|
|
|
|
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
|
2 |
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
x1i +1 = a0 + a1(1) + a2(1)2 |
|
|
|
|
|
|||||||||||||||||||||
|
|
|
|
|
|
|
|
2 |
|
|
= |
|
|
|
+ |
|
|
+ |
|
|
|
|
|
|
|
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|
1 |
|
|
|
digital smoothing and filtering methods |
27 |
|||||||||||||||||
or |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
x = Ma |
|
|
|
|
|
(2.7) |
|||
where |
|
|
x |
|
− |
|
|
|
|
|
|
|
− |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
2 |
4 |
|
|
|
|
|||||
|
|
x−ii −21 |
|
|
|
|
|
|
|
|
|
|
||||||||
|
|
x0 |
2 |
|
|
|
|
1 |
|
|
0 |
|
|
|
a1 |
|||||
x |
|
|
; |
M |
|
|
0 |
; |
a |
|
||||||||||
|
= |
|
|
−1i |
|
|
|
= |
|
1 |
−1 |
1 |
|
|
|
= |
a0 |
|||
|
|
|
|
|
|
|
|
|
|
|
1 |
|
|
|
a2 |
|||||
|
|
x1i +1 |
|
|
|
|
1 |
|
1 |
|
|
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
i |
+ |
2 |
|
|
|
|
1 |
|
2 |
4 |
|
|
|
|
||
|
|
x |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
+2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
Equation (2.7) can be solved by least-squares fitting via |
|
|||||||||||||||||||
|
|
|
|
|
|
|
|
|
a = (Mt M)Mt x |
|
|
|
|
(2.8) |
Substitution of the solution into Equation (2.7) gives the estimated values of xˆ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
xˆ = M(Mt M)Mt x |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(2.9) |
||||||||||||
or in the common form |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||||||
x−i −22 = |
1 |
(31x−i −22 + 9x−i −11 − 3x0i − 5x1i +1 + 3x2i +2) |
|
|
|
|||||||||||||||||||||||||||||||||||||||||
35 |
|
|
|
|||||||||||||||||||||||||||||||||||||||||||
|
− |
|
|
= |
|
|
|
|
|
− |
|
|
+ |
|
|
|
− |
|
|
+ |
|
|
|
+ |
|
|
|
|
|
|
− |
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||||
|
|
|
|
|
|
|
|
1 (9x i −2 |
|
13x i −1 |
|
12x i |
|
6x i +1 |
|
|
5x i +2) |
|
|
|||||||||||||||||||||||||||
x i −1 |
|
|
|
|
|
|
|
|
|
|
||||||||||||||||||||||||||||||||||||
|
|
|
1 |
|
|
35 |
|
|
|
|
2 |
|
|
|
|
|
|
1 |
|
|
|
0 |
|
|
|
1 |
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
||||||
|
|
|
|
|
|
|
− |
+ |
|
|
|
− |
+ |
|
|
+ |
|
|
|
|
|
|
− |
|
|
|
|
|
|
|
||||||||||||||||
|
|
|
= |
|
|
( |
− |
3x |
|
|
12x |
|
|
17x |
|
12x |
|
+ |
|
3x |
|
|
+ |
|
) |
(2.10) |
||||||||||||||||||||
x |
i |
|
|
|
1 |
|
|
i |
− |
2 |
|
i |
− |
1 |
|
i |
|
i |
1 |
|
|
i |
2 |
|||||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||||
|
0 |
|
|
|
35 |
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
1 |
|
|
|
0 |
|
|
|
|
|
1 |
|
|
|
|
|
|
2 |
|
|
|
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
x1i +1 = |
35 |
(−5x−i −22 + 6x−i −11 + 12x0i + 13x1i +1 + 9x2i +2) |
|
|||||||||||||||||||||||||||||||||||||||||||
|
|
|
|
|
= |
|
|
|
|
|
− |
|
|
− |
|
− |
|
|
|
− + |
|
|
|
|
+ |
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ |
|
|
|
|
|
|
(3x |
|
− |
|
|
5x |
|
− |
|
|
|
3x |
|
|
9x |
|
+ |
|
|
|
|
31x |
|
+ |
|
|
) |
|
|
|
||||||||
x |
i |
2 |
|
|
1 |
i |
2 |
|
i |
1 |
|
i |
|
i |
1 |
|
|
|
i |
2 |
|
|
|
|||||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||
|
2 |
|
|
|
|
|
35 |
|
|
|
|
2 |
|
|
|
|
1 |
|
|
|
|
0 |
|
|
1 |
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
It should be mentioned that the Savitsky--Golay filter only utilizes the central point in the moving window to do smoothing. Thus, the weights
[ |
w |
−2 |
w−1 w |
w1 w2] can be determined from |
the coefficients of x i |
of |
||||||
|
3 |
12 |
17 |
12 |
o |
3 |
|
|||||
the equations above, and they have values of [− |
|
35 |
35 |
35 |
− |
|
] |
|||||
35 |
35 |
for using five points in the moving window. One may also employ different window sizes and polynomials of different orders to deduce the weights. Just in this way, Savitsky and Golay collected the numbers with different window sizes in their tables (see Tables 2.1 and 2.2) for convenience in computation.
Example 2.1. An example using the Savitsky--Golay filter to smooth noisy analytical signals is given in Figure 2.3. The four plots in the figure show the original noisy signals and the signals that are smoothed by the Savitsky-- Golay filter of quadratic/cubic polynomials with different window sizes. Four

28 one-dimensional signal processing techniques in chemistry
Table 2.1. Weights of Savitsky--Golay Filter for Smoothing Based on a Quadratic/Cubic Polynomial
Points |
25 |
23 |
21 |
19 |
17 |
15 |
13 |
11 |
9 |
7 |
5 |
|
|
|
|
|
|
|
|
|
|
|
|
−12 |
−253 |
−42 |
|
|
|
|
|
|
|
|
|
−11 |
−138 |
|
|
|
|
|
|
|
|
|
|
−10 |
−33 −21 −171 |
−136 |
|
|
|
|
|
|
|
||
−9 |
62 |
−2 |
−76 |
−21 |
|
|
|
|
|
|
|
−8 |
147 |
15 |
9 |
−51 |
−78 |
|
|
|
|
|
|
−7 |
222 |
30 |
84 |
24 |
−6 |
−11 |
|
|
|
|
|
−6 |
287 |
43 |
149 |
89 |
7 |
−13 |
−36 |
|
|
|
|
−5 |
343 |
54 |
204 |
144 |
18 |
42 |
0 |
−21 |
|
|
|
−4 |
387 |
63 |
249 |
189 |
27 |
87 |
9 |
9 |
−2 |
|
|
−3 |
422 |
70 |
284 |
224 |
34 |
122 |
16 |
44 |
14 |
−3 |
|
−2 |
447 |
75 |
309 |
249 |
39 |
147 |
21 |
69 |
39 |
3 |
|
−1 |
462 |
78 |
324 |
264 |
42 |
162 |
24 |
84 |
54 |
6 |
12 |
0 |
467 |
79 |
329 |
269 |
43 |
167 |
25 |
89 |
59 |
7 |
17 |
1 |
462 |
78 |
324 |
264 |
42 |
162 |
24 |
84 |
54 |
6 |
12 |
2 |
447 |
75 |
309 |
249 |
39 |
147 |
21 |
69 |
39 |
3 |
−3 |
3 |
422 |
70 |
284 |
224 |
34 |
122 |
16 |
44 |
14 |
−2 |
|
4 |
387 |
63 |
249 |
189 |
27 |
87 |
9 |
9 |
−21 |
|
|
5 |
343 |
54 |
204 |
144 |
18 |
42 |
0 |
−36 |
|
|
|
6 |
287 |
43 |
149 |
89 |
7 |
−13 |
−11 |
|
|
|
|
7 |
222 |
30 |
84 |
24 |
−6 |
−78 |
|
|
|
|
|
8 |
147 |
15 |
9 |
−51 |
−21 |
|
|
|
|
|
|
9 |
62 |
−2 |
−76 |
−136 |
|
|
|
|
|
|
|
10−33 −21 −171
11−138 −42
12−253
5,175 |
805 |
3,059 |
2,261 |
323 |
1,105 |
143 |
429 |
231 |
21 |
35 |
|
|
|
|
|
|
|
|
|
|
|
different window sizes were utilized to test the Savitsky--Golay filter. From the plots as given in Figure 2.3, one can see that as the window size increases, the smoothing effect becomes more significant. Yet, the tradeoff is that the distortion of the original signals become more serious. In this example, a window size of 13 seems to give the best result among all. Thus, the choice of window size for Savitsky--Golay filter is important.
To assist the reader in using the Savitsky--Golay filter for smoothing, a MATLAB source code is provided in the following frame:
function [y]=smoothing(x,win_num,poly_order)
%This is a program for smoothing the analytical signals. %x can be a matrix with every column being an analytical %signal vector.