Y. W.
Jia
ab,
S. Y.
Sun
a,
L.
Yang
a and
D.
Wang
c
aSchool of Mechanical Engineering, Tianjin University of Technology, China. E-mail: yunweijia@tjut.edu.cn
bTianjin Key Laboratory of the Design and Intelligent Control of the Advanced Mechatronical System, China
cSchool of Computer Science and Engineering, Tianjin University of Technology, China
First published on 14th May 2018
An algorithm for signal extraction from a contaminated and distorted spectrum is proposed. First, this algorithm combines the salient space of the spectrum and the statistical characteristics of the noise to detect signal regions at different scales. Second, it extracts signals by subtracting the baseline from the spectrum in the signal regions. The baseline is fitted by segmented polynomial functions. This algorithm has been applied to simulated and experimental data, and the results show that this algorithm can accurately and automatically extract signals with varying widths from a contaminated spectrum. This method minimizes the influence of baseline distortion and exhibits good anti-noise capability and high real-time performance.
Many methods have been used to extract signals such as the zero-crossing technique9 (searching for zeros in the first derivative and treating these positions as signal regions), thresholding algorithm6,7 (where only points three times larger than the standard deviation of the spectrum noise are treated as signal points) or wavelet decomposition and integration.10–13 All these methods have significantly contributed to signal extraction. The zero-crossing technique is the simplest method to extract signals, but it is invalid when noises exist.9 Thresholding algorithm is one of the mainstream approaches in signal extraction because of its simplicity and anti-noise capability. However, two issues must be addressed. First, weak signals, having peaks three times smaller than the standard deviation of the spectrum noise, are lost in the spectrum. Second, the accuracy of this approach is adversely affected by the baseline, and this approach may fail because baseline distortions can be significantly larger than peak intensities.6 Wavelet decomposition is widely used to eliminate baseline rolling before the thresholding algorithm or even to directly extract signals.14 However, its accuracy is often influenced by the wavelet base and the number of decompositions, which are often chosen by experience, thereby restricting its applicability.15,16
In several literatures, the baseline is corrected before signal extraction to reduce baseline influence.17 However, baseline correction of the whole spectrum is difficult, and it increases the computational problem. Furthermore, many methods must remove signal regions before baseline correction to acquire a better baseline.6 Thus, baseline correction and signal extraction are typically restricted by each other.18
Algorithms that do not use a model of the baseline or signal shape and that have anti-noise capability are preferred. Many iterative algorithms19–21 and Difference-of-Gaussian (DoG) functions can meet this requirement. Adaptive iteratively reweighted penalized least squares (airPLS) is a well-known iterative algorithm, because it is flexible and valid; however, it needs further optimization. Lowe22,23 proposed DoG for image processing, and it has also been used for signal extraction.24 Furthermore, DoG can automatically extract signals of different widths in the same spectrum, and its accuracy is seldom influenced by baseline and noise. However, applying DoG is time consuming.
Herein, we propose Salient-Space-Detection algorithm (SSD) for signal extraction. SSD has been developed with reference to DoG and noise statistics. SSD has all of the advantages of DoG, and it gives more real-time and accurate results than other algorithms.
We have evaluated our method using simulated spectra, and we have applied it to real measured spectra. The results show that the algorithm is robust, real-time and accurate for signal extractions of different kinds of spectra.
First, the background space of a spectrum is defined as a function, B(x, r), obtained by averaging the offset spectrum, I(x − r) and I(x + r), of the original input spectrum, I(x).
B(x, r) = [I(x − r) + I(x + r)]/2 | (1) |
Here, r is the offset value of the original spectrum, which also represents the scale of the background spectrum. Different values of r produce various background spectra. All background spectra constitute the background space.
Second, the salient space, H(x, r), can be obtained from the difference of the original spectrum and background space.
(2) |
Here, a positive spectrum is a spectrum, such as a Raman spectrum, having peaks larger than the baseline. A negative spectrum is a spectrum, such as an absorption spectrum, having peaks smaller than the baseline.
As shown in Fig. 1a, the half-breadths of the square signal and the sharp Gaussian signal are 8 and 4 points, respectively (the width of a signal was defined as the total number of points having amplitude that is 1% larger than the maximum amplitude of this signal). Salient space, which can be obtained by eqn (2), is shown in Fig. 1b–f. When the scale of the salient space conforms to the half-breadth of the signal, the result of H(x, r) reaches its maximum at the centre of the signal region. Thus, detecting the maximum of H(x, r) can help derive signals with different widths.
Fig. 1 Saliency of typical salient space. The horizontal and vertical axes of (b)–(f) represent position and saliency, respectively. |
Next, the central coordinates of signal regions, Xsc, and the half-breadth of signal regions, Rs, are obtained by detecting the maximum of H.
(3) |
Here, Δr is the difference of two nearby scales.
Noises are neglected in eqn (3). When noises are existed, as shown in Fig. 2, the maximum of H(x, r) is not guaranteed to be at the centre of the signal region even if the scale of salient space conforms to the half-breadth of the signal.
Fig. 2 Noise influence. The maximum saliency of the square signal is not at the centre of the signal and is not obtained when the scale equals half-breadth. |
The most common method to decrease the influence of noise is denoising. However, most denoising methods inevitably weaken the signal intensity and induce spectrum distortion. Thus, we choose to revise eqn (3) instead of denoising the original spectrum before SSD.
First, the absolute mean of the noises, μr, of each scale of the salient space is calculated. All points larger than kμr and the mean value of the d neighbourhoods larger than μr are then treated as candidate points of signal regions.
(4) |
(5) |
Here, Nh is the total number of points in H(x, r), and k and d are constants; their values can be set as 2 and 4, respectively (these values correspond to the confidence level of 99% under normal distribution).
If only signal regions with peaks clearly larger than the noise can be detected, then k can be set at a value larger than 3, and eqn (5) can be simplified as eqn (6).
Xts = {x|H(x, r) > kμr} | (6) |
Next, the start and end coordinates, Xs and Xe, of the signal regions are obtained by eqn (7) and (8), respectively.
Xs = {(x1 − rT)∪(xj − rT)|xj − xj−1 > rT j∈(2, Ns)}, | (7) |
Xe = {(xj + rT)∪(xNs + rT)|xj+1 − xj > rT j∈(1, Ns − 1)}. | (8) |
Here, xj represents the candidate signal points, Ns is the total number of these points, and x1 and xNs are the first and the last candidate signal points, respectively. rT is a threshold, and it should be set at 3Δr to get good results.
First, a certain number of neighbour points of a signal region are chosen. Second, the baseline of this signal region is fitted by a lower-order polynomial function using the chosen points. Finally, signals can be extracted by subtracting the baseline from the spectrum at signal regions.
Simulated spectra were used because their theoretical signal regions and intensities were known; thus, evaluating the accuracy of the algorithm was easy. Real spectra were utilised because they can indicate the effect of an algorithm in real applications.
All simulated spectra can be expressed as follows:
s(x) = a(x) + n(x) + b(x). | (9) |
Here, a(x) is the theoretical signal, n(x) is the Gaussian noise, b(x) is the theoretical baseline and s(x) is the simulated spectrum.
More than 20000 spectra were simulated with various SNRs (signal-to-noise ratios) and SBRs (signal-to-baseline ratios) to evaluate SSD performance. A Gaussian curve was used as the theoretical baseline in these spectra. The Gaussian curve used was typical; it had abundant curvatures in a single line. Four typical signals were constructed to enhance the simulation: one square signal, one sharp Gaussian signal, one broad Gaussian signal and one substantially overlapped signal. Fig. 3 shows the entire process; SNR and SBR used in this example were 30 and 0.2, respectively.
From the HITRAN spectroscopic database,29 we can obtain the absorption intensity coefficient, a(v), of C2H2. We chose the coefficient larger than 0.0059 × 10−19 as pure absorption peak, multiplied it by 5 × 1019 and designed each peak as Gaussian distribution. Thus, we derived the pure absorption spectrum, a(x). The spectrum length was designed as 7200 sample points, mimicking that of the C2H2 experimental spectra. Noise was then added to the pure absorption spectrum. Finally, the spectrum with noise was added to the theoretical baseline. The theoretical baseline, b(x), was set as a slash connected with a Gaussian curve. This kind of baseline has abundant curvature, and it is more typical than a Gaussian curve.
The simulated NMR spectrum was extracted from the real NMR spectrum offered by Qingjia Bao.7 First, we used DoG to detect the signal regions of real spectrum. Second, we fitted the baseline based on segmented lower-order polynomial fitting and segmented kernel smoothing.22 Third, we extracted the signals as theoretical spectrum by subtracting the baseline from the real spectrum at signal regions. Finally, we added the noise and theoretical spectrum to the theoretical baseline, with its theoretical baseline, b(x), set as a slash connected with a Gaussian curve.
We utilised the amplified absorption intensity coefficient, a(v), as the theoretical intensity in the experiments.
P1 | P2 | P3 | P4 | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0.2 | 0.3 | 0.5 | 0.75 | 1 | 0.2 | 0.3 | 0.5 | 0.75 | 1 | 0.2 | 0.3 | 0.5 | 0.75 | 1 | 0.2 | 0.3 | 0.5 | 0.75 | 1 | ||
20 | mean | Non | Non | Non | −2.1 | −0.1 | Non | Non | Non | −1.3 | −0.6 | Non | Non | Non | −0.7 | −1.1 | Non | Non | Non | −2.1 | 0.7 |
Std | Non | Non | Non | 12.1 | 9.0 | Non | Non | Non | 12.2 | 9.5 | Non | Non | Non | 11.0 | 8.9 | Non | Non | Non | 12.8 | 9.3 | |
30 | mean | −0.6 | −0.6 | 0.1 | −0.9 | 0.2 | −1.0 | 0.2 | 0.4 | −0.6 | −0.2 | −1.0 | 0.6 | −0.4 | −0.1 | −0.3 | 0.4 | 0.8 | 0.4 | 0.0 | −0.1 |
Std | 15.0 | 9.3 | 6.4 | 4.1 | 3.3 | 13.7 | 10.3 | 6.7 | 4.1 | 3.2 | 14.8 | 10.7 | 6.2 | 4.0 | 3.3 | 13.5 | 10.6 | 5.9 | 4.0 | 3.3 | |
50 | mean | 1.0 | 0.7 | 0.4 | 0.1 | 0.0 | 1.1 | 0.5 | 0.3 | 0.1 | 0.1 | 1.1 | 0.6 | 0.3 | 0.1 | 0.1 | 1.0 | 0.6 | 0.3 | 0.1 | 0.0 |
Std | 3.3 | 2.2 | 1.4 | 1.0 | 0.0 | 3.3 | 2.2 | 1.4 | 1.0 | 0.0 | 3.3 | 2.2 | 1.0 | 1.0 | 0.0 | 3.3 | 2.2 | 1.0 | 1.0 | 0.0 | |
75 | mean | 1.1 | 0.6 | 0.3 | 0.1 | 0.1 | 1.1 | 0.6 | 0.3 | 0.1 | 0.1 | 1.1 | 0.6 | 0.3 | 0.1 | 0.1 | 1.1 | 0.6 | 0.3 | 0.1 | 0.1 |
Std | 3.0 | 2.0 | 1.0 | 0.0 | 0.0 | 3.0 | 2.0 | 1.0 | 0.0 | 0.0 | 3.0 | 2.0 | 1.0 | 0.0 | 0.0 | 3.0 | 2.0 | 1.0 | 0.0 | 0.0 | |
100 | mean | 1.1 | 0.6 | 0.3 | 0.1 | 0.1 | 1.1 | 0.6 | 0.3 | 0.1 | 0.1 | 1.1 | 0.6 | 0.3 | 0.1 | 0.1 | 1.1 | 0.6 | 0.3 | 0.1 | 0.1 |
Std | 3.0 | 2.0 | 1.0 | 0.0 | 0.0 | 3.0 | 2.0 | 1.0 | 0.0 | 0.0 | 3.0 | 2.0 | 1.0 | 0.0 | 0.0 | 3.0 | 2.0 | 1.0 | 0.0 | 0.0 |
The statements (1), (2) and (3) indicate that SSD has strong anti-noise and anti-baseline-distortion capability; however, its accuracy and stability are still influenced by noise and baseline distortion. Thus, SSD cannot be used only when both SNR and SBR are too small. The statements (2), (3) and (4) indicate that the influence of SNR is larger than that of SBR and thus, improving the denoising performance may be important for future studies.
SBR and power error are defined as follows:
(10) |
(11) |
Here, n is the number of extracted signal points, aE(xi) is the intensity of the extracted signal and a(xi) is the intensity of the theoretical signal.
DoG and airPLS were used to compare with SSD in the next experiments because they are more accurate than 3ST and WLD.
Fig. 6 Simulated data of C2H2 absorption spectrum: (a) theoretical spectrum, (b) signal region detection and (c) signal extraction. |
DoG has denoising capability because it obtains its scale space by convolution, as shown in eqn (12). Convolution, like a smooth filter, is influenced by the convolution radius. When the radius is too small, it cannot eliminate the noise, and some noise points, such as those at about 1526.1 and 1533.6 nm, may be treated as signal points, as shown in Fig. 6b. If the radius is too large, some signal points, such as that at about 1526.7 nm, are reduced and treated as baseline points, as shown in Fig. 6b.
D(x, σ) = (G(x, kσ) − G(x, σ)) * I(x). | (12) |
Here, G(x, kσ) and G(x, σ) are the variable-scale Gaussian functions, σ is in proportion to the convolution radius, I(x) is the original input spectrum and D(x, σ) is the Difference-of-Gaussian. By detecting the maximum or minimum of D(x, σ) in various scale spaces, we can detect signals with various widths.
SSD uses noise statistics, as shown in eqn (4) and (5), to decrease the influence of noise. Additionally, SSD is not affected by the baseline or scale of salient space, and its confidence level is larger than 99%. Thus, SSD is more accurate than DoG.
AirPLS can correct the spectrum, but neither its signal region detection nor intensity accuracy is as good as those of SSD or DoG, as shown in Fig. 6b and c; this is because airPLS does not have strong anti-noise capacity, and the anti-baseline-distortion capability is not as good as is supposed.
Fig. 7 presents the results of a simulated NMR spectrum. The analysis is omitted here for briefness because the phenomena of Fig. 7 are the same as those of Fig. 6. Thus, we can conclude that SSD is more accurate than DoG, and DoG is more accurate than airPLS.
Fig. 8 Experimental data of C2H2 absorption spectrum: (a) signal region detection and (b) signal extraction. |
Many factors, such as existing noise and inaccurately extracted baseline, can induce the intensity difference between the theoretical and extracted spectra. However, the most important reason is that the spectrum is obtained by the intracavity fibre ring laser gas sensing system. In this system, the absorption length, L, is not absolutely identical because of the difference in the laser's settling time at various wavelengths (the larger the settling time, the longer the absorption length). Although the concentration, c, is a constant, the product of c × L differs at various wavelengths. Thus, the proportions of the real absorption intensity, K, and absorption intensity coefficient, a(v), are not the same by Lambert–Beer law as follows:
c = K/(a(v) × L) ⇒ c × L = K/a(v). | (13) |
Using the same intracavity fibre ring laser gas sensing system, the settling time, ts, of large absorption peaks is found to be shorter than that of the small absorption peaks of both sides. The settling time of large absorption peaks near 1530 nm is the shortest and then, it increases slightly as the wavelength increases. Considering L = v × ts, we can say that the proportion, K/a(v), of large absorption peaks should be smaller than that of the small absorption peaks of both sides. The proportion, K/a(v), of large absorption peaks near 1530 nm should be the smallest, and it should increase slightly with the increase in the distance between the wavelength of the peak and 1530 nm. Fig. 8 shows this deduction.
From Fig. 8 and the analysis mentioned above, we can see that SSD can extract signals from real absorption data, and the result of SSD is better than that of DoG or airPLS.
The raw spectra of fluorliddicoatite and abelsonite are even more complex than the adamite spectrum, and identifying where baseline and signals are located, even manually, is difficult. The fluorliddicoatite result obtained by SSD almost concurs with the database result, and it is more accurate than the results obtained by DoG and airPLS. The abelsonite result is not as good as the adamite or fluorliddicoatite result; however, it is better than the result obtained by DoG or airPLS. Fig. 11b shows that the intensity data near 750 and 1210 cm−1 obtained by SSD are less accurate than the results obtained by airPLS; however, the results of SSD are better than those of airPLS or similar with those of airPLS at other wavenumber s. The results obtained by DoG are the least accurate for the abelsonite spectrum. Thus, SSD is the most effective method for the signal extraction of Raman spectra.
SSD is more accurate than DoG and airPLS due to the same reasons mentioned in section 4.2. AirPLS does not have strong anti-noise capability, and the anti-baseline-distortion capability is not as good as is supposed. DoG has strong anti-noise and anti-baseline-distortion capability; however, its convolution radius may influence the signal region detection.
Fig. 9–11 also illustrate that the overlapping of the signals may influence the accuracy of the intensity of the extracted signals, but Table 1 does not show this phenomena. When many signals overlap with each other and combine to form a signal that is too broad, such as the signal near 200 cm−1 of Fig. 9 and the signal near 750 cm−1 of Fig. 11, some signal points may be treated as baseline points. Thus, the accuracy of the fitted baseline declines and ultimately influences the accuracy of the intensity of these signals. Apart from that, the intensity of the extracted signals is accurate and is not influenced by the signal and baseline shapes.
The authors thank Juntao Liu and Bingqiang Liu for their support on the Raman data.
This journal is © The Royal Society of Chemistry 2018 |