Method for the correction of background signals in a spectrum

10760966 ยท 2020-09-01

Assignee

Inventors

Cpc classification

International classification

Abstract

A method for the determination and correction of background signals in a spectrum, consisting of signals of a plurality of spectral points, characterized by the steps of: Calculating at least three statistic or analytic functions of the signal values of the spectrum, attributing probabilities P.sub.i(band) for the presence of bands to each point in each of the calculated functions: Adding the probabilities P.sub.i(band) up to an overall probability P.sub.i(band) from all calculated functions for each point; calculating a probability P(background) for the presence of background for each point in the spectrum from said overall probability P.sub.i(band) according to P(background)=1P.sub.i(band) wherein negative values are set to zero; and calculating a fit of the signal values at all points of the original spectrum wherein the signal in each point is taken into account in the fit only with the respective probability for the presence of background P(background), and subtraction of the background function determined in such a way from the signal values of the original spectrum in order to generate a background corrected spectrum.

Claims

1. A method for the determination and correction of background signals in a spectrum to generate a background corrected spectrum for use in spectral analysis, comprising: obtaining a spectrum consisting of a plurality of signals, each signal forming a spectral point in said spectrum and having a signal value, some signal values in said spectrum representing background; and removing said signal values representing background to generate a background corrected spectrum, the method for removal of signal values representing background comprising calculating fit values for each of said signals, said fit values being generated by the steps of: (a) calculating function values according to at least three functions of said signal values, wherein said at least three functions are selected from: (A) mean; (B) variance; (C) skewness; (D) kurtosis; (E) moving average with a window width of 3 points; (F) second derivative; (G) median; (H) maximum; (I) minimum; (J) difference between maximum and minimum; (K) quotient of the central signal value and the mean value; (L) quotient (maximum-mean value)/(maximum-minimum); (b) normalizing said calculated function values by division by the mean value of the corresponding function values over all of said spectral points; (c) attributing probabilities P.sub.i(band) for the presence of bands or peaks to each of said spectral points in each of said calculated function values wherein said probabilities P.sub.i(band) are calculated by attributing a probability to each of said spectral points having a normalized value above or below a threshold, in particular above 1.3 and below 0.7, said attributed probability being proportional to the distance of said normalized value from said threshold; (d) adding said probabilities P.sub.i(band) up to an overall probability P.sub.i(band) from all of said calculated function values for each of said spectral points; (e) calculating a probability P(background) for the presence of background for each of said spectral points from said overall probability P.sub.i(band) according to
P(background)=1P.sub.i(band) wherein negative values of P(background) are set to zero; and (f) calculating a fit of said signal values with fit values at all of said spectral points wherein said signal values in each of said spectral points is taken into account in the fit values only with said background probability calculated for said spectral point, and subtracting said fit values from said signal values of said spectrum thereby generating a background corrected spectrum; making said background corrected spectrum available for spectral analysis in place of said spectrum.

2. The method of claim 1, and wherein said probabilities P.sub.i(band) are multiplied by a factor .sub.i before calculating said overall probability in such a way that the following equation applies:
P(background)=1 .sub.iP.sub.i(band).

3. The method of claim 1, and wherein said fit is calculated by means of a fit-function and the method of least squares.

4. The method of claim 3, and wherein several fit functions of different type are used and the one with the smallest deviation of the least squares is selected.

5. The method of claim 1, and wherein a polynomial is used as a fit function for said fit.

6. The method of claim 3, and wherein said method is carried out a plurality of times for at least two different window widths, preferably for window widths having 5, 9, 13 and 17 adjacent spectral points and the one with the smallest deviation of the least squares is selected as a fit function.

7. The method of claim 1, and wherein the following functions are selected: (A) mean (B) variance (E) moving average with a window width of 3 points (F) second derivative (G) median (H) maximum (J) difference between maximum and minimum (K) quotient of the central signal value and the mean value.

8. The method of claim 1, and wherein the following functions are selected: (A) mean (B) variance (E) moving average with a window width of 3 points (F) second derivative (G) median (H) maximum.

9. A method for improving spectral analysis by generating a background corrected spectrum for use in spectral analysis, comprising: obtaining a spectrum consisting of signals of a plurality of spectral points, said signals represented by signal values of respective points in said spectrum, some signal values in said spectrum representing background; and determining the signal values in said spectrum representing background comprising the steps of: (a) selecting at least three functions to perform on the spectrum, wherein said at least three functions are selected from: (A) mean; (B) variance; (C) skewness; (D) kurtosis; (E) moving average with a window width of 3 points; (F) second derivative; (G) median; (H) maximum; (I) minimum; (J) difference between maximum and minimum; (K) quotient of the central signal value and the mean value; (L) quotient (maximum-mean value)/(maximum-minimum); (b) selecting a window width and calculating function values using the selected window width for the spectrum according to each of the at least three selected functions; (c) normalizing said calculated function values by division by the mean value of the corresponding function values over all of said spectral points; (d) attributing probabilities P.sub.i(band) for the presence of bands or peaks to each of said spectral points in each of said calculated function values wherein said probabilities P.sub.i(band) are calculated by attributing a probability to each of said spectral points having a normalized value above or below a threshold, in particular above 1.3 and below 0.7, said attributed probability being proportional to the distance of said normalized value from said threshold; (e) adding said probabilities P.sub.i(band) up to an overall probability P.sub.i(band) from all of said calculated function values for each of said spectral points; (f) calculating a probability P(background) for the presence of background for each of said spectral points from said overall probability P.sub.i(band) according to
P(background)=1P.sub.i(band) wherein negative values of P(background) are set to zero; and (g) calculating a fit of said signal values with fit values at all of said spectral points wherein said signal values in each of said spectral points is taken into account in the fit values only with said background probability calculated for said spectral point; using the calculated fit values, subtracting said fit values from said signal values of said spectrum thereby removing said signal values representing background from said spectrum to generate a background corrected spectrum; and making said background corrected spectrum available for spectral analysis in place of said spectrum.

10. The method of claim 9, and wherein said probabilities P.sub.i(band) are multiplied by a factor .sub.1 before calculating said overall probability in such a way that the following equation applies:
P(background)=1 .sub.iP.sub.i(band).

11. The method of claim 9, wherein the window width for calculating function values is an odd number of points.

12. The method of claim 11, wherein the window width for calculating function values is chosen from a window width of 5, 9, 13, or 17 points.

Description

BRIEF DESCRIPTION OF THE DRAWINGS

(1) FIG. 1 lists the first four statistic momentums and the formula for their calculation.

(2) FIG. 2 shows an unprocessed spectrum of detected signal values.

(3) FIG. 3 shows a spectrum which is obtained from FIG. 2 with Function (A) moving average.

(4) FIG. 4 shows a spectrum which is obtained from FIG. 2 with Function (B) variance.

(5) FIG. 5 shows a spectrum which is obtained from FIG. 2 with Function (C) skewness.

(6) FIG. 6 shows a spectrum which is obtained from FIG. 2 with Function (D) kurtosis.

(7) FIG. 7 shows a spectrum which is obtained from FIG. 2 with Function (E) moving average with a window width of points.

(8) FIG. 8 shows a spectrum which is obtained front FIG. 2 with Function (F) second derivative.

(9) FIG. 9 shows a spectrum which is obtained from FIG. 2 with Function (G) median.

(10) FIG. 10 shows a spectrum which is obtained from FIG. 2 with Function (H) maximum.

(11) FIG. 11 shows a spectrum which is obtained from FIG. 2 with Function (I) minimum.

(12) FIG. 12 shows a spectrum which is obtained from FIG. 2 with Function (J) difference between maximum and minimum.

(13) FIG. 13 shows a spectrum which is obtained front FIG. 2 with Function (K) quotient of the central signal value and the mean value.

(14) FIG. 14 shows a spectrum which is obtained from FIG. 2 with Function (L) quotient (maximum-mean value)/(maximum-minimum).

(15) FIG. 15 shows a spectrum which is obtained from FIG. 2 with Function (A) moving average after normalizing.

(16) FIG. 16 shows a spectrum which is obtained from FIG. 2 with Function (B) variance after normalizing.

(17) FIG. 17 shows a spectrum which is obtained from FIG. 2 with Function (C) skewness after normalizing.

(18) FIG. 18 shows a spectrum which is obtained from FIG. 2 with Function (D) kurtosis after normalizing.

(19) FIG. 19 shows a spectrum which is obtained from FIG. 2 with Function (E) moving average with a window width of 3 points after normalizing.

(20) FIG. 20 shows a spectrum which is obtained from FIG. 2 with Function (F) second derivative after normalizing.

(21) FIG. 21 shows a spectrum which is obtained from FIG. 2 with Function (G) median after normalizing.

(22) FIG. 22 shows a spectrum which is obtained from FIG. 2 with Function (H) maximum after normalizing.

(23) FIG. 23 shows a spectrum which is obtained from FIG. 2 with Function (I) minimum after normalizing.

(24) FIG. 24 shows a spectrum which is obtained from FIG. 2 with Function (J) difference between maximum and minimum after normalizing.

(25) FIG. 25 shows a spectrum which is obtained from FIG. 2 with Function (K) quotient of the central signal value and the mean value after normalizing.

(26) FIG. 26 shows a spectrum which is obtained from FIG. 2 with Function (L) quotient (maximum-mean value)/(maximum-minimum) after normalizing.

(27) FIG. 27 shows a probability spectrum which is obtained by processing the spectrum shown in FIG. 15.

(28) FIG. 28 shows a probability spectrum which is obtained by processing the spectrum shown in FIG. 16.

(29) FIG. 29 shows a probability spectrum which is obtained by processing the spectrum shown in FIG. 19.

(30) FIG. 30 shows a probability spectrum which is obtained by processing the spectrum shown in FIG. 20.

(31) FIG. 31 shows a probability spectrum which is obtained by processing the spectrum shown in FIG. 21.

(32) FIG. 32 shows a probability spectrum which is obtained by processing the spectrum shown in FIG. 22.

(33) FIG. 33 shows a probability spectrum which is obtained by processing the spectrum shown in FIG. 25.

(34) FIG. 34 shows a probability spectrum for the overall probability for the presence of bands or peaks which is obtained by adding up the probabilities of the spectra in FIGS. 27 to 33.

(35) FIG. 35 shows a probability spectrum for the probability for the presence of background which is derived from the spectrum shown in FIG. 34.

(36) FIG. 36 shows an emission spectrum with a peak and background of a real sample and an illustration of the probabilities for a detector element being part of a band or peak or exclusively detecting a background signal.

(37) FIG. 37 shows the emission spectrum of FIG. 36 with a background fit.

DESCRIPTION OF THE EMBODIMENT

(38) FIG. 2 shows a spectrum generally designated with numeral 10. The spectrum 10 shows signal values 12 which are detected, for example, with a line detector with a plurality of linearly arranged detector elements. Accordingly, the abscissa 14 is provided with numbers representing the position of the detector elements in the line. Values representing the signal value are shown on the ordinate 16. Signal values ma he for example, intensities measured with a detector element.

(39) The spectrum 10 is provided with ranges 18 where the signals extend very flat apart from some noise and which are presumably caused by background. A peak 20 can be recognized in the middle range.

(40) It is an object of the automatized processing of this and any other spectrum to quantitatively determine the background and thereby enable a separation of bands (peaks).

(41) In a first step the signal values are statistically analyzed. For this purpose a window width is selected. The present embodiment is carried out with a window width 9. An example with such a window width is illustrated in FIG. 2. The window designated with numeral 22 comprises a center point 12 and four points on either side, respectively, i.e. 9 points altogether.

(42) For calculating the first statistical moment, the average valuedesignated function (A) belowis calculated. The corresponding formula is designated with (1) in FIG. 1. The signal value 12 on point 24 is replaced by the average value of all points in the window 22 around this point 12. This procedure is repeated for all points. The result of such a calculation of the function (A) is represented in FIG. 3. It can be recognized that flat ranges 18 will remain flat furthermore. The peak 20, however, is flatter and wider. Individual spikes are removed.

(43) Further functions are calculated in addition to the moving average of function A the results of which are represented in FIGS. 4 to 14. The calculation of the variance designated as function B is calculated according to the formula represented in FIG. 1 (2). The result is shown in FIG. 4. The calculation of the skewness designated as function C is calculated according to the formula represented in FIG. 1 (3). The result is shown in FIG. 5. The calculation of the kurtosis designated as function D is calculated according to the formula represented in FIG. 1 (4). The result is shown in FIG. 6. In the formulas x designates the position of the point and N the width of the window which is, in the present case. N=9.

(44) Further to the first four statistical momentums further functions are calculated:

(45) Function (E) is the moving average with a window width of 3 points and corresponds to function A apart from the window width. The result of the calculation of function (E) is represented in FIG. 7. It can be recognized that a smaller window width causes less widening of the peak than a larger window width.

(46) Function (F) is the second derivative and describes the distribution of the curvature. The result of the calculation of function (F) is represented in FIG. 8.

(47) Function (G) is the median. It is determined as follows: the signal values in a window are sorted according to their size (value). The 5th-largest value, i.e. the one in the middle of the sorting, is the median at a window width of 9. The result of the calculation of function (G) is represented in FIG. 9.

(48) Function (H) is the maximum of all values in a window. The central value of the window is replaced by the maximum value even if it is at the edge of the window. Accordingly, a very smooth curve without any spikes is obtained. Peaks are broadened very much. The result of the calculation of function (H) is represented in FIG. 10.

(49) Function (I) is the minimum of all values in a window. The calculation is earned out in an analogue way as the calculation of the maximum value. The result of the calculation of function (I) is represented in FIG. 11.

(50) Function (J) is the difference between maximum and minimum of all values in a window. The result of the calculation of function (J) is represented in FIG. 12.

(51) Function (K) is the quotient of the central signal value and the mean value. The result of the calculation of function (K) is represented in FIG. 13.

(52) Function (L) is the quotient (maximum-mean value)/(maximum-minimum) of the values in one window. The result of the calculation of function (L) is represented in FIG. 14.

(53) It can be easily recognized that the functions (A) to (L) have different Offsets. Therefore, the values are normalized by dividing them by the average value of all points of the functions. Thereby, it is achieved that the values vary about the value 1. The result is shown in FIGS. 15 to 26 for all functions (A) to (L).

(54) Then, from the normalized values of the functions (A) to (L) probabilities P.sub.i(band) are calculated that the signal value at the respective point belongs to a band or peak. A probability is attributed to each point having a normalized parameter above or below a threshold S which is proportional, to the distance of the parameter from the threshold mentioned above. The threshold S is always in the range or 1 apart from one exception. Such exception relates to the function (F)=y, i.e. the second derivative. In this case S must be selected according to the structure of the bands in the spectrum: fine and narrow bands.fwdarw.S is selected to be a large value, wide or badly resolved bands.fwdarw.S is selected to be a small value. In principle the following applies:
P.sub.i(band)=r.sub.i*(function.sub.normalizedS.sub.i).sup.t,
wherein the proportionality factors r, are suitably selected, In as preferred embodiment of the method r.sub.i and S.sub.i have the following values:

(55) TABLE-US-00001 Function r S t A 1.0 1.2 1 B 0.2 1.0 C 0.0 1.0 1 D 0.0 1.0 1 E 0.5 1.0 F 0.1 50 G 1.0 1.1 1 H 1.0 1.1 I 0.0 1.0 1 J 0.0 1.2 K 0.5 1.2 L 0.0 1.0 1

(56) A value of r=0 indicates that the corresponding function is not considered when calculating a probability and will, therefore, not influence the background function. A value of t= indicates that a root is extracted from the distance (function-S).

(57) It does not make sense for all spectra to use all functions. Therefore, in the present case the functions (C), (D), (I), (J) and (L) were not further processed. The probabilities P.sub.i(band) for the presence of a band or peak calculated from the remaining normalized functions are shown in FIGS. 27 to 33. The peak 20 can be well recognized in all such figures.

(58) In a next step the probability values P.sub.i(band), which are between 0 and 1, point wise added up for each point to an overall probability. It was found that some of the functions generally provide more relevant information than others. Therefore, the probabilities are multiplied with a factor .sub.i before calculating the sum to .sub.iP.sub.i(band). The result is shown in FIG. 34.

(59) The larger the probability P.sub.i(band) that a point is part of a band or peak the smaller is the probability P.sub.i(background) that it shows background. FIG. 35 shows the probability that background is present which is calculated according to
P(background)=1P.sub.i(band)

(60) Since probabilities are between 0 and 1 all negative values are set to zero. High values in FIG. 35 indicate that with a high probability there is only background present. In other words: each point in the spectrum has its own probability that there is only background. Such values are illustrated in FIG. 2 in the form of vertical bars 26. It can be recognized that there are no probabilities in the range of the peak 20 and indeed high probabilities arc calculated for the flat range 18 to be caused by background. Such automatically calculated result, therefore, corresponds to the visual perception.

(61) The described method in the present embodiment is repeated fix several window widths, such as, for example, window widths with 11, 13, 15 and 17 points. It is understood, however, that such values are mentioned by way of example only and that depending on the spectral resolution, the computing capacity and the peak widths entirely different values can be useful.

(62) As a result there are several probabilities for each point of the spectrum which were determined with different window widths. The N probabilities are sorted according to their values. Finally the value in the center is selected which corresponds to the median. Thereby, a very high stability regarding spikes is achieved with the N probabilities. Such spikes would otherwise have strong effects on the final result (calculation of the average, addition of values etc.),

(63) In the following step a fit function is determined for the background. Such a fit function can be determined for the original spectrum. It is also possible to calculate a lit function for a spectrum which is shown in logarithmic form on one or both axes. From this for each selected window width of for example, 9, 13, 17 etc. points four functions can be derived. The fit functions are fitted by the method of least squares. Each point is taken into account only with the corresponding probability. Ranges where there is a peak are consequently not considered at all. The fit function which finally has the smallest error will be used for background correction.

(64) A linear function was used in the present embodiment. It is, however, also possible to use polynomials with higher order or different functional relations. FIG. 36 shows a real spectrum 28 with a peak 30. A probability was attributed to each point of the spectrum according to the above method which is represented by a bar 32, if a probability is present at all. FIG. 37 shows the linear fit function 34 determined in the above described way. If such function 34 is subtracted from the signal values of the spectrum 28 it can be easily seen that apart from some small noise only the interesting peak remains. This can then be quantitatively evaluated.

(65) The described method has the advantage that the background is automatically determined over the entire spectral distribution and not only locally. Thereby, a high reproducibility and accuracy can be achieved.