Method for the correction of background signals in a spectrum
10760966 ยท 2020-09-01
Assignee
Inventors
Cpc classification
H01J49/022
ELECTRICITY
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)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
(13)
(14)
(15)
(16)
(17)
(18)
(19)
(20)
(21)
(22)
(23)
(24)
(25)
(26)
(27)
(28)
(29)
(30)
(31)
(32)
(33)
(34)
(35)
(36)
(37)
DESCRIPTION OF THE EMBODIMENT
(38)
(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
(42) For calculating the first statistical moment, the average valuedesignated function (A) belowis calculated. The corresponding formula is designated with (1) in
(43) Further functions are calculated in addition to the moving average of function A the results of which are represented in
(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
(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
(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
(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
(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
(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
(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
(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
(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
(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
(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
(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.
P(background)=1P.sub.i(band)
(60) Since probabilities are between 0 and 1 all negative values are set to zero. High values in
(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.
(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.