
Chau Chemometrics From Basics to Wavelet Transform
.pdftransformation methods of analytical signals |
39 |
a p value in such a way that
tol = (yi − yˆi )2 (2.24)
i
so as to produce the smoothest spline within an acceptable tolerance for the data.
2.2.TRANSFORMATION METHODS OF ANALYTICAL SIGNALS
Transformation is a very useful technique in pretreatment of analytical signals. Convolution, Hadamard, and Fourier transformation are just examples of this kind. In essence, wavelet analysis is also another kind of transformation technique. In this section the methods of convolution, Hadamard and Fourier transformation will be discussed in some detail.
2.2.1. Physical Meaning of the Convolution Algorithm
Convolution plays a very important role in statistics in treating analytical signals. An example from spectral measurement is now presented to illustrate how convolution works [6].
Suppose that the real spectrum of a sample is the one given by f (x ) in the upper part of Figure 2.5. Now, a spectrometer with a slit is utilized to assist the acquisition of the spectrum. If the slit is infinitely narrow, the spectral signal recorded should be the same as that of f (x ). In practice, any slit has certain width. Let the slit operation be expressed by function h(x ) which is essential a triangular function (see the lower part of Fig. 2.5). From the plot of h(x ), one can see how the slit function (triangular function) affects the intensity distribution of the lightbeam with respect to the location. The highest-intensity location appears at the central point of the slit. Thus, when the light ray passes this slit, the spectrum obtained [as expressed by the function g(x ) in Fig. 2.5] by the spectrophotometer becomes broader than the real one f (x ). The whole procedure as described above is called convolution in the field of signal processing.
From this plot (Fig. 2.5), it can be seen that the slit works somewhat like the Savitsky--Golay filter. The triangular function is essentially a weight function. That is why the Savitsky--Golay filter is originally called the polynomial convolution method. Since the spectrum g(x ) obtained from the spectrophotometer is the convolution result of the original spectrum f (x ) and the triangular function h(x ), the term g(x ) can be expressed

40 one-dimensional signal processing techniques in chemistry
f (x)
|
|
10 |
|
|
|
|
|
-4 |
0 |
+4 |
|
|
|
h(x) |
|
|
|
moving direction |
||
|
|
|
|
|
|
|
g(x) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
x |
Figure 2.5. Illustration of the physical meaning of convolution by the slit function.
mathematically by the following formula:
m
g[x (i )] = |
f (x ) · h[x (i ) − x ] |
(2.25) |
i =−m
This formula is the discrete expression of the convolution operation through which one can see that N = 2m + 1 is the width of the slit. In Equation (2.25), x (i ) represents the intensity of the light of the measured spectrum at the central point. It should be noted that all the elements of the slit function h(x ) outside the moving window have zero values. Thus, the continuous formula of convolution can be expressed as follows:
+∞
g[x (i )] = |
f (x )h(x (i ) − x )dx |
(2.26) |
−∞
Let x (i ) be represented by y . Then we have
+∞
g(y ) = |
f (x )h(y − x )dx |
(2.27) |
−∞
Here g(y ) is usually called the convolution of functions f (y ) and h(y ) and is denoted by f (y ) h(y ).
transformation methods of analytical signals |
41 |
It should be mentioned that the convolution operation can be easily fulfilled by the Fourier transformation. Hence, the convolution operation is essentially a kind of transformation.
2.2.2. Multichannel Advantage in Spectroscopy
and Hadamard Transformation
The major advantage of multichannel measurement in spectroscopic study is illustrated by the following design in an weighting experiment [7]. Suppose that there are four alloy samples to be weighed. The variance of weighting is σ 2 if they are measured one by one in the usual practice. However, the weighting experiment can be designed in another way by putting different combinations of the four samples on the two sides of a balance. From these measurements, the following relationship can be established:
m1 = x1 + x2 + x3 + x4 + e1 |
(2.28) |
||||||||||
|
= |
|
− |
|
− |
|
+ |
|
+ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
x1 |
|
x2 |
|
x3 |
|
x4 |
|
e2 |
|
m2 |
|
|
|
|
|
|
|||||
m4 |
= x1 |
− x2 |
+ x3 |
− x4 |
+ e4 |
|
|||||
m3 |
|
x1 |
|
x2 |
|
x3 |
|
x4 |
|
e3 |
|
|
= |
|
+ |
|
− |
|
− |
|
+ |
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Here mi (i = 1, 2, 3, 4) denotes the weight on the left-hand side of the balance. As for xi (i = 1, 2, 3, 4), it represents the weight of the alloy sample of which the one with the minus sign means that it is placed on the lefthand side of the balance and the one with the positive sign is on the right hand side. From the preceding linear equations, one can easily obtain the estimation of xi . For instance, the estimation of x1 is given by
x1 = |
1 |
(m1 |
+ m2 |
+ m3 + m4) = x1 + |
1 |
ei |
(2.29) |
|
|
|
|
||||||
4 |
4 |
From this result, it can be seen that the error is only one-fourth that from the usual practice, or in another words, the variance for this weighting design is σ 2/16. This example illustrates that a smart design can improve the accuracy of weighing significantly.
Let us elaborate the weighting experiment above in more detail from the mathematical point of view. If the four samples are weighted one by one, the result obtained can be expressed by the following equations (ignoring
the error term) |
|
|
0 1 |
|
0 x2 |
|
||
m2 |
|
0 |
|
|||||
m1 |
|
|
1 |
0 |
0 |
0 x1 |
|
|
|
= |
|
|
|
|
|
||
m3 |
|
0 |
0 |
1 |
0 x3 |
|
(2.30) |
|
m4 |
|
|
0 |
0 |
0 |
1 x4 |
|
|

42 one-dimensional signal processing techniques in chemistry
or in matrix form as m = Ax,
x = A−1m = Am
where A is essentially an identity matrix. The calculation procedure is very simple, but every sample is weighted only once. With the use of the smart weighting procedure, the outcomes [Eq. (2.28)] can be expressed as
m2 |
|
1 |
1 |
1 |
|
1 x2 |
|
|||
m1 |
|
|
1 |
1 |
1 |
|
1 |
x1 |
|
|
|
= |
|
− |
−1 |
− |
|
|
|
||
m3 |
|
1 |
−1 |
|
1 x3 |
|
(2.31) |
|||
m4 |
|
|
1 |
1 |
−1 |
−1 x4 |
|
|
or m = Hx. Matrix H is known as the Hadamard matrix. Obviously, the absolute value of every element, Hmn , in H is 1:
|Hmn | = 1 |
(2.32) |
||
In this case, the inverse matrix of H is also very simple: |
|
||
1 |
|
|
|
H−1 = |
|
H |
(2.33) |
N |
The approach of the smart weighting design can be applied to spectral analysis to improve its performance. In traditional spectral measurement, the intensity of each wavelength is measured one at a time to obtain the spectrum. Figure 2.6 depicts the operation of such a single-slit scanning spectrometer. But if the intensities of N different wavelengths are recorded simultaneously, the signal-to-noise ratio can be enhanced significantly. According to the weighting design experiment above, one needs to take only two values, say, +1 and 0. This can be realized easily in spectral measurement. Here the zero value means that there is no light passing through, while 1 means ‘‘Yes.’’ Suppose that one uses a rather wide slit
Slit
Source
Sample
Monochromator
A broadband Detector
Figure 2.6. Schematic diagram of a single-slit scanning spectrometer.
transformation methods of analytical signals |
43 |
compared to the wavelength under study and tries to cover some wavelengths. For instance, the light intensities of seven different wavelengths ψj ( j = 1, 2, . . . , 7) are acquired at one time. The traditional measurement method will take them one by one. Yet, we can also design a spectrophotometer following the preceding smart weighting design by taking several selected wavelengths simultaneously. Let 1 × ψj denote the light ray that can pass through the slit, and assume that 0 × ψj means that it cannot. Then, for a measurement using the design in the series of 1001011, the total light intensity detected is expressed as follows:
ψ= 1 × ψ1 + 0 × ψ2 + 1 × ψ3 + 1 × ψ4 + 0 × ψ5 + 1 × ψ6 + 1 × ψ7 = ψ1 + ψ4 + ψ6 + ψ7
Anyone who is clever enough to design seven independent combinations of spectral measurements can easily obtain the seven individual ψj correctly. One design of this kind is given in the following matrix:
|
|
1 |
0 |
0 |
1 |
0 |
1 |
1 |
|
|
|
1 |
1 |
0 |
0 |
1 |
0 |
1 |
|
|
|
|
|
|
|
|
|
|
|
|
= |
1 |
1 |
1 |
0 |
0 |
1 |
0 |
|
S |
|
1 |
1 |
1 |
0 |
0 |
|
(2.34) |
|
|
0 |
1 |
|||||||
|
|
|
0 |
1 |
1 |
1 |
0 |
|
|
|
|
|
|
|
|||||
|
|
1 |
0 |
|
|||||
|
|
|
1 |
0 |
1 |
1 |
1 |
|
|
|
|
0 |
0 |
|
|||||
|
|
0 |
0 |
1 |
0 |
1 |
1 |
1 |
|
This is called the Sylvester matrix, and it can be derived from the Hadamard matrix. The Sylvester matrix is obtained in the following way. First, set the elements of the first row. Then the second row is finished by moving the last element in the first row of the matrix to become the first element. Afterward, move the remaining six elements sequentially to the right by one position. The elements of the third and other rows are expressed in the same way, based on the previous rows. This kind of measurement, called the Hadamard coding procedure in spectral study, is utilized for Hadamard transformation spectroscopy. A schematic diagram of the Hadamard multichannel spectrometer is shown in Figure 2.7.
It should be mentioned that Hadamard transformation spectroscopy can enhance the signal-to-noise ratio (SNR) by (N + 1)/2N1/2 times. When the value of N is large enough, the increase in SNR can reach N1/2/2 times [8].
This multichannel advantage in spectroscopic analysis by using Hadamard transformation as mentioned above is called the Fellgett advantage. In fact, Hadamard transformation infrared spectroscopy has been found to enhance SNR notably.

44 one-dimensional signal processing techniques in chemistry
Window
Source
Sample
Monochromator |
|
|
|
|
Broadband detector |
||
|
|
||
|
Mask |
Figure 2.7. Schematic diagram of the Hadamard multichannel spectrometer.
2.2.3.Fourier Transformation
Fourier transformation is a widely used mathematical technique [9--12] for converting a signal, f (t ), from the time domain into the frequency domain, F (ν). This is because almost all the continuous signals can be expressed by the periodic trigonometric functions, sine and cosine functions, in the form of
∞
f (t ) = a0 + |
= |
an cos (nw0t ) + bn sin (nw0t ) |
(2.35) |
n |
1 |
|
|
|
|
where f (t ) is a function in the time domain and w0 = 2πf0 with f0 = 1/t and a0 represents the so-called direct-current term, which can be deduced by a mean value in a period (T ) of x (t ):
|
1 |
0 |
T |
|
|
a0 = |
f (t )dt |
(2.36) |
|||
T |
The other coefficients, an and bn (n = 1, 2, 3, . . . ), in this expression are represented by the following expressions:
|
2 |
0 |
T |
|
|
|
an = |
f (t ) cos (nw0t )dt |
|
(2.37a) |
|||
|
|
|||||
T |
|
|||||
|
2 |
0 |
T |
|
|
|
bn = |
f (t ) sin (nw0t )dt |
(n = 1, 2, 3, . . . ) |
(2.37b) |
|||
|
||||||
T |
Fourier transformation is essentially a kind of frequency analysis, which is quite similar to the procedure of splitting a lightbeam from a source into different light rays at different wavelengths by a prism or grating.
transformation methods of analytical signals |
45 |
Let cos (2πnf0t ) and sin (2πnf0t ) be expressed in the following way:
cos (2πnf |
0 |
t ) |
= |
|
e j 2πnf0t + e−j 2πnf0t |
(2.38a) |
|||
|
|||||||||
|
|
|
|
|
|
2 |
|
||
sin (2πnf |
0 |
t ) |
= |
|
e j 2πnf0t − e−j 2πnf0t |
(2.38b) |
|||
|
|||||||||
|
|
|
|
|
|
2j |
|
||
Then the Fourier series can be written as |
|
||||||||
|
|
|
|
∞ |
|
|
|
||
f (t ) = n Cn e j 2πnf0t |
(2.39) |
||||||||
|
|
|
|
=−∞ |
|
|
|||
Here Cn are the values taken with |
n as −∞, . . . , −1, 0, 1, 2, . . . , ∞, |
||||||||
respectively |
|
|
|
|
|
|
|
|
|
|
1 |
|
|
T |
|
|
|
||
|
|
|
2 |
|
|
|
|||
Cn = |
|
− T2 |
f (t )e−j 2πnf0t dt |
(2.40) |
|||||
T |
For every n, Cn will essentially give the swing and phase of the homorous wave with a frequency f = nf0.
The formal definition of Fourier transformation is given below. Let a function f (t ) be in the time or space domain. Its expression of Fourier transformation will be
∞
f (f ) = f (t )e−j 2πf0t dt
−∞
The inverse Fourier transformation is defined as follows:
∞
f (t ) = f (f )e j 2πf df
−∞
(2.41)
(2.42)
Thus, f (f ) can be converted back to f (t ) through the preceding formula. This means that the function can be freely exchanged between the time or space domains and the frequency domain through Eqs. (2.41) and (2.42):
f (t ) f (f )
2.2.3.1. Discrete Fourier Transformation and
Spectral Multiplex Advantage
In general, we often use the discrete Fourier transformation to pretreat chemical measurements. Suppose that the time-domain signal f (t ) is sampled at N equally intervals. This is called the discrete Fourier transform

46 one-dimensional signal processing techniques in chemistry
(DFT):
|
n−1 |
|
|
|
|
||
f (n) |
k |
|
|
−j 2πk (n/N) |
(2.43) |
||
|
= |
|
|
|
|
|
|
|
= |
|
|
|
|
||
|
|
|
0 |
|
|
|
|
For inverse transformation, we have |
|
|
|
||||
|
1 |
N−1 |
|
|
|||
|
|
|
|
|
|
||
f (k ) = |
N |
|
= |
f (n)j 2πk (n/N) |
(2.44) |
||
|
|
|
n |
0 |
|
|
|
|
|
|
|
|
|
It can be easily seen that if one can sample the signals by N equally spaced intervals using a multichannel detector (see Fig. 2.8), then N data points f (tk ) or f (k ) in the time or space domain, where k = 1, 2, . . . , N, can be obtained. For every such data point acquired, one can get the corresponding series of frequency domain amplitudes, say, f (fn ) or f (n), with the help of DFT. Therefore, the spectral multiplex advantage of Hadamard transformation as discussed in the previous section also happens in Fourier transformation. For the Hadamard transformation, we have m = Hx. In the same way, the Fourier transformation matrix F can be employed to accomplish the spectral multiplex advantage: m = Fx. The elements Fmn in
matrix F can be expressed as F = exp(2πjmn/N) = cos(2πmn/N) +
√ mn
j sin(2πmn/N) with j = −1. It is easily seen that |Fmn | = 1. Letting N = 4,
we have |
|
|
1 |
|
|
|
|
|
x2 |
|
|
m2 |
|
|
j |
1 |
|
j |
|
||||
m1 |
|
= |
1 |
|
1 |
1 |
|
1 |
x1 |
|
(2.45) |
m3 |
1 |
− |
1 |
−1 |
− |
1 x 3 |
|||||
|
|
|
|
|
|
|
|
|
|
||
m4 |
|
|
1 −j −1 |
|
j |
x4 |
|
|
It should be noted that only some channels of the spectral signals are utilized in Hadamard transformation while all the spectral signals are considered in DFT (see Figs. 2.7 and 2.8 for comparison). In this way, SNR can be enhanced by N1/2.
Window
Source
Sample |
|
|
|
|
Multichannel |
|
|
|
|
||
Monochromator |
|
|
|
||
|
|
|
detector |
||
|
|
|
|
|
|
|
|
Mask |
Figure 2.8. Schematic diagram of a multichannel-detector-based spectrometer.

transformation methods of analytical signals |
47 |
Base function of Hadamard transformation |
Base function of Fourier transformation |
|||||
1 |
|
|
1 |
|
|
|
0 |
|
|
0 |
|
|
|
-1 |
|
|
-1 |
|
|
|
0 |
0.5 |
1 |
0 |
2 |
4 |
6 |
1 |
|
|
1 |
|
|
|
0 |
|
|
0 |
|
|
|
-1 |
|
|
-1 |
|
|
|
0 |
0.5 |
1 |
0 |
2 |
4 |
6 |
1 |
|
|
1 |
|
|
|
0 |
|
|
0 |
|
|
|
-1 |
|
|
-1 |
|
|
|
0 |
0.5 |
1 |
0 |
2 |
4 |
6 |
1 |
|
|
1 |
|
|
|
0 |
|
|
0 |
|
|
|
-1 |
|
|
-1 |
|
|
|
0 |
0.5 |
1 |
0 |
2 |
4 |
6 |
Figure 2.9. Base function of Hadamard (left part) and Fourier transformation (right part). |
Hadamard transformation and Fourier transformation differ from each other in the base function. Hadamard transformation is based on the Walsh function, in contrast to the sine and cosine functions in Fourier transformation. This is illustrated in Figure 2.9.
Example 2.2. A signal in the time domain can be represented by a combination of periodic sine and cosine functions. Usually, any timedependent or continuous signal can be considered as a combination of sine and cosine functions. This explains why Fourier transformation has wide application.
Figure 2.10 illustrates how Fourier transformation works. The plot shown in Figure 2.10a is the sum of three trigonometric functions (Fig. 2.10c) with two sine functions with the periods of 1π and 2π as well as one cosine function with the period of 3π. Through applying Fourier transformation to the plot, the dependence of the intensity on frequency from the calculation is depicted in Figure 2.10b. It can be seen from the figure that the three component functions are definitely identified.

48 one-dimensional signal processing techniques in chemistry
|
6 |
|
|
|
|
800 |
|
|
|
|
|
|
(a) |
|
|
|
|
(b) |
|
|
|
|
|
|
|
|
|
||
|
4 |
|
|
|
|
600 |
|
|
|
f(t) |
|
|
|
|
amplitude |
|
|
|
|
2 |
|
|
|
400 |
|
|
|
||
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
0 |
|
|
|
|
|
|
|
|
|
-2 |
|
|
|
|
200 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-4 |
2 |
4 |
6 |
|
0 |
0.5 |
1 |
1.5 |
|
0 |
|
0 |
||||||
|
|
|
time |
|
|
|
Frequency (Hz) |
|
|
|
2 |
|
|
(c) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
|
|
|
|
|
|
|
f(t) |
0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-1 |
|
|
|
|
|
|
|
|
|
-2 |
|
|
|
|
|
|
|
|
|
0 |
2 |
4 |
6 |
|
|
|
|
|
|
|
|
Time |
|
|
|
|
|
|
Figure 2.10. Fourier transformation: the composite signal (a) contains two sine functions with the periods of 1π and 2π and one cosine function with the period of 3π (b); the dependence of intensity on frequency after Fourier transformation (c).
2.2.3.2. Fast Fourier Transformation
In this section we briefly describe how the fast Fourier transformation can be used to carry out inverse Fourier transformation. For more detail, readers can refer to Brigham’s treatise [11]. Here a simple case of N = 4 is considered. Let us define w to be a complex number
w = e−2πj /4 |
(2.46) |
Then, the expression of DFT can be written as
N−1
f (n) = f (k )w nk |
(2.47) |
k =0
The basic idea of fast Fourier transform (FFT) is to decompose this formula so as to reduce the calculation burden. When N is equal to a power of 2, that is, N = 2a where a is an integer, the computation is very simple. Now, N = 22 = 4 is utilized as an example to illustrate the FFT decomposition