A spectrum analysis method, device and medium based on X-ray fluorescence spectrometer
By combining the linear method and peak stripping method, the actual measured spectra and pure element spectrum of the X-ray fluorescence spectrometer are background subtracted, which solves the problem that the peak stripping method requires a lot of iteration, and improves the background subtraction efficiency and the accuracy of element content prediction.
Patent Information
- Application Number
- CN202411844838.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-12-16
AI Technical Summary
In existing spectrum analysis, background deduction by peak stripping method requires a large amount of iteration process, resulting in high time complexity of the algorithm.
Combined with the linear method and peak stripping method, the actual spectral pattern and pure element spectrum are deducted background, and the spectral background is quickly peeled off by the linear method, reducing the number of iterations of peak stripping method, and improving the background deduction efficiency.
The number of iterations of the peak stripping method is significantly reduced, the efficiency of background deduction is improved, the net strength of each element is obtained, and the accuracy of element content prediction is improved.
Smart Images

Figure CN119310119B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic measurement and testing, and in particular to a spectrum analysis method, equipment and medium based on an X-ray fluorescence spectrometer. Background Art
[0002] X-ray fluorescence spectrometer is an instrument that uses the principle of interaction between X-rays and matter for analysis. When X-rays irradiate the surface of a substance, the atoms in the substance absorb the energy of the X-rays and undergo energy level transitions. Subsequently, when the atoms return from a high energy state to a low energy state, they release fluorescent X-rays with specific energy. The energy and intensity of these fluorescent X-rays are closely related to the elemental composition and content of the substance being measured, so the composition and properties of the substance can be analyzed by measuring the characteristics of the fluorescent X-rays.
[0003] When analyzing the composition of a substance using an X-ray fluorescence spectrometer, the presence of the background spectrum will affect the peak position, peak width, and peak intensity of the characteristic peaks in the spectrum, reducing the interpretability and robustness of the spectrum analysis. Therefore, it is necessary to subtract the background spectrum of the spectrum line to eliminate the influence of the sample background noise on the spectrum and make the data more accurate.
[0004] The peak stripping method is based on the principle of removing fast-changing features from the spectrum. It compares the data of a certain channel on the spectrum with the data of its adjacent channel, selects the smaller data, and repeats the process to achieve the purpose of removing the spectrum background. The peak stripping method can achieve good accuracy without relying on complex mathematical models, but it requires a large number of iterative processes to achieve effective background subtraction, and the time complexity of the algorithm is relatively large. Summary of the invention
[0005] The present invention provides a spectrum analysis method, device and medium based on X-ray fluorescence spectrometer, which are used to solve the technical problems that background subtraction by peak stripping method in existing spectrum analysis requires a large number of iterative processes to achieve effective background subtraction and the time complexity of the algorithm is relatively large.
[0006] In a first aspect, the present invention provides a spectrum analysis method based on an X-ray fluorescence spectrometer, comprising:
[0007] Obtain the measured spectrum of the sample to be tested and the pure element spectrum corresponding to the target element through an X-ray fluorescence spectrometer;
[0008] Combining the straight line method and the peak stripping method, the background in the measured spectrum and the background in the pure element spectrum are respectively subtracted;
[0009] Determine the proportion of the pure element spectrum of the target element in the target spectrum to obtain a fitted target spectrum, wherein the residual between the target spectrum and the measured spectrum is less than a preset residual threshold;
[0010] The content of the target element in the sample to be tested is determined based on the proportion of the pure element spectrum of the target element in the target spectrum.
[0011] In a feasible implementation, after obtaining the measured spectrum of the sample to be tested and the pure element spectrum corresponding to the target element by an X-ray fluorescence spectrometer, the method further includes:
[0012] Based on wavelet transform, smooth filtering is performed on the measured spectrum and the pure element spectrum.
[0013] In a feasible implementation, the background in the measured spectrum and the background in the pure element spectrum are respectively subtracted by combining the straight line method and the peak stripping method, including:
[0014] Based on the formula , respectively remove the spectral lines from the left boundary to the right boundary of the characteristic peak in the measured spectrum and the spectral lines from the left boundary to the right boundary of the characteristic peak in the pure element spectrum, wherein, y i For spectrum i The intensity value of the spectrum a is the left boundary of the characteristic peak, and the spectral line b is the right boundary of the characteristic peak;
[0015] Based on the formula , calculate the 2 adjacent to any spectral line in the measured spectrum d The average value of the intensity of the spectral line , if the intensity value of any spectral line y i is less than the average value, then the intensity value of any spectral line is updated to the average value, wherein, d is a positive integer;
[0016] Based on the formula , calculate the 2 adjacent to any spectral line in the pure element spectrum d The average value of the intensity of the spectral line , if the intensity value of any spectral line y i If the value is smaller than the average value, the intensity value of any spectral line is updated to the average value.
[0017] In a feasible implementation manner, determining the proportion of the pure element spectrum of the target element in the target spectrum includes:
[0018] Determine the intensity value of the pure element spectrum of the target element in the target channel address interval and the proportion in the target channel address interval of the target spectrum, wherein the target channel address interval is the channel address interval corresponding to the characteristic peak of the target element.
[0019] In a feasible implementation manner, determining the proportion of the pure element spectrum of the target element in the target spectrum includes:
[0020] By using a search-based optimization algorithm, the proportion with the smallest fitness value in the search space is determined as the optimal proportion, and the fitness value is the value of the fitness function;
[0021] The optimal proportion is determined as the proportion of the pure element spectrum of the target element in the target spectrum.
[0022] In a feasible implementation manner, before determining the proportion with the smallest fitness value in the search space as the optimal proportion through the search-based optimization algorithm, the method further includes:
[0023] Determine the maximum number of channels for the peak drift of the X-ray fluorescence spectrometer m ;
[0024] Based on the maximum number of channels of the spectrum peak drift, determine the fitness function in the optimization algorithm ,in, w is the number of spectral lines in the measured spectrum, Y i is the spectral line in the measured spectrum i The strength value of n is the number of target elements in the target spectrum, A j The target element j The proportion of the pure element spectrum in the target spectrum, P j,i The target element j Spectral lines in the pure element spectrum i The intensity value of .
[0025] In a feasible implementation, the proportion with the smallest fitness function in the search space is determined as the optimal proportion through a search-based optimization algorithm, including:
[0026] Based on the whale optimization algorithm, when the number of iterations reaches a preset threshold, the whale individual with the smallest fitness value in the whale population is determined as the best whale individual, and the proportion corresponding to the best whale individual is determined as the optimal proportion.
[0027] In a feasible implementation manner, determining the content of the target element in the sample to be tested based on the proportion of the pure element spectrum of the target element in the target spectrum includes:
[0028] Calculating the pure element intensity value of the target element in the pure element spectrum;
[0029] Determining a measured intensity value of the target element in the target spectrum based on a pure element spectrum of the target element and a proportion of the pure element spectrum in the target spectrum;
[0030] The ratio of the measured intensity value to the pure element intensity value is determined as the relative intensity of the target element;
[0031] Based on the formula , determine the target element in the sample to be tested i Content C i ,in, R i is the relative intensity of the target element, n is the number of target elements in the target spectrum.
[0032] In a feasible embodiment, when determining the target element in the sample to be tested, i Content C i Afterwards, the method further comprises:
[0033] Based on the fundamental parameter method, the target element is calculated i The relative strength ;
[0034] Based on the formula , calculate the target element i Corrected value of content ;
[0035] If the correction value With the content C i If the difference between the two is less than or equal to the preset difference threshold, the target element i Content C i Update to the corrected value ;
[0036] If the correction value With the content C i If the difference between the two is greater than the preset difference threshold, the target element i Content C i Update to the corrected value Then, the above process is repeated until the difference is less than or equal to the preset difference threshold.
[0037] In a second aspect, the present invention provides a spectral analysis device based on an X-ray fluorescence spectrometer, the device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor so that the at least one processor can execute a spectral analysis method based on an X-ray fluorescence spectrometer as described in any of the above embodiments.
[0038] In a third aspect, the present invention provides a non-volatile computer storage medium, which is a non-volatile computer-readable storage medium, and the non-volatile computer-readable storage medium stores at least one program, each of which includes instructions, and when the instructions are executed by a terminal, the terminal executes a spectral analysis method based on an X-ray fluorescence spectrometer as described in any of the above embodiments.
[0039] The spectrum analysis method, device and medium based on X-ray fluorescence spectrometer provided by the present invention have the following beneficial technical effects compared with the prior art:
[0040] (1) The present invention combines the straight line method with the peak stripping method, which can significantly reduce the number of iterations required by the peak stripping method, thereby accelerating the efficiency of the peak stripping method in the process of spectrum background subtraction and efficiently subtracting the spectral line background.
[0041] (2) The present invention first processes the measured spectrum and pure element spectrum by the straight line method, and then processes the measured spectrum and pure element spectrum after the straight line method by the peak stripping method. The straight line method can quickly strip off the background of the spectrum line to ensure that the background on both sides of the spectrum peak is smoother. On the basis of the straight line method, the peak stripping method further accurately deducts the background of the spectrum line. The application of the straight line method can significantly reduce the number of iterations required by the peak stripping method, thereby speeding up the efficiency of the peak stripping method in the process of spectrum background subtraction. Combining the straight line method with the peak stripping method can efficiently deduct the background of the spectrum line, more accurately obtain the net intensity of each element, and improve the accuracy of the prediction of the content of each element.
[0042] (3) When fitting the target spectrum, the present invention divides the spectrum line into intervals according to the characteristic peak position of the target element, thereby speeding up the speed of spectrum line fitting and reducing the time cost of element content detection.
[0043] (4) When the present invention determines the proportion of the pure element spectrum of the target element in the target spectrum through the optimization algorithm, the fitness function adopted takes into account the spectral peak drift that may occur in the actual test of the X-ray fluorescence spectrometer, so that the fitted target spectrum is more consistent with the measured spectrum, thereby improving the accuracy of determining the content of each target element through the target spectrum. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0045] Figure 1 A flow chart of a spectrum analysis method based on an X-ray fluorescence spectrometer provided by the present invention;
[0046] Figure 2 A flowchart of a whale optimization algorithm provided by the present invention;
[0047] Figure 3 A schematic structural diagram of a spectrum analysis device based on an X-ray fluorescence spectrometer provided by the present invention. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the specific embodiments of the present invention and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0049] The technical solution proposed by the present invention is described in detail below with reference to the accompanying drawings.
[0050] Figure 1 The present invention provides a flow chart of a spectrum analysis method based on an X-ray fluorescence spectrometer. Figure 1 As shown, the method includes the following execution steps:
[0051] S101. Obtain the measured spectrum of the sample to be tested and the pure element spectrum corresponding to the target element through an X-ray fluorescence spectrometer.
[0052] The present invention determines the content of the target element in the sample to be tested by comparing the measured spectrum of the sample to be tested and the pure element spectrum corresponding to the target element.
[0053] In order to eliminate the error caused by the X-ray fluorescence spectrometer, the measured spectrum of the sample to be tested and the pure element spectrum corresponding to the target element are obtained using the same X-ray fluorescence spectrometer.
[0054] In some embodiments, the pure element spectrum corresponding to the target element can be obtained through pure substances corresponding to the target element. For example, if the target element is gold, the pure element spectrum of the gold element can be obtained through pure gold substances.
[0055] As a possible implementation method, in order to smooth and reduce noise on the measured spectrum, after obtaining the measured spectrum of the sample to be tested and the pure element spectrum corresponding to the target element through an X-ray fluorescence spectrometer in S101, the method also includes: performing smoothing filtering on the measured spectrum and the pure element spectrum based on wavelet transform.
[0056] In order to maintain the consistency between the measured spectrum and the pure element spectrum, the same wavelet transform method can be used to perform smooth filtering on the measured spectrum and the pure element spectrum respectively.
[0057] In some embodiments, the coif3 wavelet function can be used to decompose the spectrum lines in the measured spectrum into three layers, and the ddencmp function can be used to obtain the default threshold value to process the high-frequency coefficients of each layer after decomposition; the coefficients after decomposition and threshold processing are reconstructed to obtain smooth and noise-reduced spectrum lines. The same method is used for the smooth filtering of pure element spectra.
[0058] S102. Combining the straight line method and the peak stripping method, the background in the measured spectrum and the background in the pure element spectrum are respectively subtracted.
[0059] The commonly used background subtraction methods in existing spectrum analysis include the straight line method and the peak stripping method.
[0060] The straight line method connects the two peaks and valleys of the characteristic peak with a straight line, and uses this straight line as the baseline, and the part below the baseline as the background. The straight line method is simple to calculate the background, but when the characteristic peaks overlap, irregular scattered rays enter the background, causing the calculated background signal to be larger than the actual one.
[0061] The peak stripping method is based on the principle of removing fast-changing features from the spectrum. It compares the data of a certain channel on the spectrum with the data of its adjacent channel, selects the smaller data, and repeats the process to achieve the purpose of removing the spectrum background. The peak stripping method can achieve good accuracy without relying on complex mathematical models, but it requires a large number of iterative processes to achieve effective background subtraction, which will also increase the time complexity of the algorithm.
[0062] The present invention combines the straight line method with the peak stripping method, which can effectively deduct the spectral line background, more accurately obtain the net intensity of each element, and improve the accuracy of the prediction of the content of each element.
[0063] As a possible implementation method, S102 combines the straight line method and the peak stripping method to deduct the background in the measured spectrum and the background in the pure element spectrum, including:
[0064] First, based on the formula , the spectral lines from the left edge to the right edge of the characteristic peak in the measured spectrum and the spectral lines from the left edge to the right edge of the characteristic peak in the pure element spectrum are removed by the straight line method, where: yi For spectrum i The intensity value of the spectrum a is the left edge of the characteristic peak, the spectral line b is the right boundary of the characteristic peak.
[0065] After the measured spectrum and pure element spectrum are processed by the above straight line method, the background in the spectrum is further subtracted by the peak stripping method. Specifically, for the measured spectrum of the sample to be tested, based on the formula , calculate the 2 adjacent to any spectral line in the measured spectrum d The average value of the intensity of the spectral line , if the intensity value of any spectral line y i If it is less than the average value, the intensity value of any spectral line is updated to the average value, where d Is a positive integer.
[0066] Similarly, for pure element spectra, based on the formula , calculate the 2 adjacent to any spectral line in the spectrum of a pure element d The average value of the intensity of the spectral line , if the intensity value of any spectral line y i If it is less than the average value, the intensity value of any spectral line is updated to the average value.
[0067] Understandably, d The larger the value of is, the fewer the number of iterations of the peak stripping method is, but d If the value of is too large, the accuracy of background subtraction will be reduced. In order to reduce the number of iterations of the peak stripping method while ensuring the accuracy of background subtraction, it is necessary to select an appropriate value of d.
[0068] After experimental verification, it was determined d The preferred value of is 10, that is, comparing the intensity value of any spectral line y i The average value of the 20 adjacent spectral line data is ,if Use Alternative , transform all spectral lines, and by setting 50 cycles experimentally, relatively ideal results can be obtained.
[0069] In this way, the measured spectrum and pure element spectrum are first processed by the straight line method, and then the measured spectrum and pure element spectrum processed by the straight line method are processed by the peak stripping method. The straight line method can quickly strip off the background of the spectrum line to ensure that the background on both sides of the spectrum peak is smoother. On the basis of the straight line method, the peak stripping method further accurately deducts the background of the spectrum line. The application of the straight line method can significantly reduce the number of iterations required by the peak stripping method, thereby speeding up the efficiency of the peak stripping method in the process of spectrum background subtraction. Combining the straight line method with the peak stripping method can efficiently deduct the background of the spectrum line, more accurately obtain the net intensity of each element, and improve the accuracy of the prediction of the content of each element.
[0070] S103, determining the proportion of the pure element spectrum of the target element in the target spectrum, obtaining a fitted target spectrum, and the residual between the target spectrum and the measured spectrum is less than a preset residual threshold.
[0071] In the present invention, pure elements are used to strip and fit the target spectrum, thereby obtaining the measured intensity value of each target element.
[0072] The target spectrum is given by The pure element spectra of the target elements are superimposed according to the corresponding ratios, that is, ,in, For example, the instrument parameters i Set to 1-4096 or 1-1024; The target spectrum after fitting is at the address The strength value of The target element j The proportion of the pure element spectrum in the target spectrum; The target element j The pure element spectrum is at the address The intensity value of .
[0073] Target spectrum after fitting y i Measured spectrum The residual .
[0074] In some embodiments, the complete trace of the pure element spectrum of the target element may be fitted.
[0075] As a possible implementation method, in order to improve the fitting efficiency of the target spectrum, fitting can be performed on the channel address interval corresponding to the characteristic peak of the target element to determine the proportion of the pure element spectrum of the target element in the target spectrum, including: determining the intensity value of the pure element spectrum of the target element in the target channel address interval and its proportion in the target channel address interval of the target spectrum.
[0076] The target channel address interval is the channel address interval corresponding to the characteristic peak of the target element.
[0077] Correspondingly, the target spectrum after fitting y i Measured spectrum The residual is as follows:
[0078]
[0079] in, D is the channel address interval corresponding to the characteristic peak of the target element.
[0080] Exemplarily, the channel addresses are 1-4096, and the target elements are gold, silver, copper, zinc and nickel. Assuming that the characteristic peak of the gold element is located at channel addresses 800-860, the characteristic peak of the silver element is located at channel addresses 2000-2200, the characteristic peak of the copper element is located at channel addresses 500-560, the characteristic peak of the zinc element is located at channel addresses 200-260, and the characteristic peak of the nickel element is located at channel addresses 700-780, it is only necessary to fit the pure element spectra of the target elements in the above five channel address intervals to obtain the target spectra in the above five channel address intervals.
[0081] Target spectrum after fitting y i Measured spectrum The residual is as follows:
[0082]
[0083] in, D ={[200, 260], [500, 560], [700, 780], [800, 860], [2000, 2200]}
[0084] After background subtraction, fitting and deconstructing the spectrum is a necessary step to obtain the net intensity of each element and then calculate the element content. However, when the sample composition is complex or the spectrum lines overlap severely, the traditional pure element spectrum line stripping method often produces large errors in the fitting and deconstruction process. In contrast, the method of fitting and deconstructing the spectrum using a combination of Gaussian function and optimization algorithm can significantly improve the accuracy and reduce the error. However, the optimization efficiency of this method in the fitting and deconstruction process is relatively low, which increases the time cost.
[0085] The present invention combines the optimization algorithm with the pure element spectrum stripping method to achieve high-precision fitting and spectrum interpretation, reduce errors, divide the spectrum lines into intervals according to the characteristic peak positions of different elements, speed up the spectrum line fitting, and reduce the time cost of element content detection.
[0086] As a possible implementation method, in order to obtain more accurate intensities of each element, a method combining an optimization algorithm with pure element stripping is used, and an optimization algorithm is used to determine the proportion of each pure element spectrum in the fitted target spectrum, so that the residual value between the fitted target spectrum and the measured spectrum is minimized. Determining the proportion of the pure element spectrum of the target element in the target spectrum includes: determining the proportion with the smallest fitness value in the search space as the optimal proportion through a search-based optimization algorithm, and the fitness value is the value of the fitness function; determining the optimal proportion as the proportion of the pure element spectrum of the target element in the target spectrum.
[0087] In some embodiments, in order to improve the optimization efficiency, a search-based optimization algorithm can be used to divide the target spectrum into intervals based on the position of the characteristic peak of the target element, determine the intensity value of the pure element spectrum of the target element in the target address interval, and determine the optimal proportion in the target address interval of the target spectrum.
[0088] The fitness function in the optimization algorithm is determined as .
[0089] in, D is the channel address interval corresponding to the characteristic peak of the target element.
[0090] As a possible implementation, before determining the proportion with the smallest fitness value in the search space as the optimal proportion by using a search-based optimization algorithm, the method further includes: determining the maximum channel number of the peak drift of the X-ray fluorescence spectrometer m ; Determine the fitness function in the optimization algorithm based on the maximum number of channels of spectral peak drift ,in, w is the number of spectral lines in the measured spectrum, Y i The measured spectrum line i The strength value of n is the number of target elements in the target spectrum, A j The target element j The proportion of the pure element spectrum in the target spectrum, P j,i The target element j Spectral lines in the pure element spectrum i The intensity value of .
[0091] In actual tests, the influence of the instrument will cause the peak position to drift. Therefore, when using the optimization algorithm for fitting, the peak drift is taken into consideration in the fitness function, so that the fitted target spectrum is more consistent with the measured spectrum.
[0092] Maximum number of channels for peak drift of X-ray fluorescence spectrometer m, that is, the number of channels with the maximum peak drift that may occur when measuring with this spectrometer. For example, if the peak position may drift 1-3 channels (spectral lines) to the left or right when measuring with this spectrometer, you can set m The value of is determined to be 3, and the fitness function .
[0093] As a possible implementation method, through a search-based optimization algorithm, the proportion with the smallest fitness function in the search space is determined as the optimal proportion, including: based on the whale optimization algorithm, when the number of iterations reaches a preset threshold, the whale individual with the smallest fitness value in the whale population is determined as the best whale individual, and the proportion corresponding to the best whale individual is determined as the optimal proportion.
[0094] Specifically, Figure 2 A flowchart of a whale optimization algorithm provided by the present invention is as follows: Figure 2 As shown, determining the optimal weight based on the whale optimization algorithm includes the following steps.
[0095] S301. Initialize algorithm parameters and whale population size and the maximum number of iterations .
[0096] S302, initialize the whale population, randomly generate the initial solution of the whale population, set the number of iterations t=1, calculate the fitness value of each whale individual in the whale population, and save the best whale individual.
[0097] S303: Update parameters , B , C , l , p .
[0098]
[0099]
[0100]
[0101] in, , and is a random number between 0 and 1. is a random number between -1 and 1. is the current iteration number.
[0102] S304, according to the random number The value of determines the search method of the algorithm. , then execute step S305; if , then update the individual position of the whale according to formula (1).
[0103] Formula (1):
[0104] in, It is Iteration No. The individual whale locations, It is The best whale individual of the iteration, Indicates The distance between an individual and the optimal individual, is a constant.
[0105] S305, judging parameters B The size of , then update the individual position of the whale according to formula (2); if , then update the individual positions of whales according to formula (3).
[0106] Formula (2):
[0107] Formula (3):
[0108] In the formula It is a whale individual randomly selected from the whale population.
[0109] S306, calculate the fitness value of the individual whales, and update the current optimal solution, that is, the individual whale with the smallest fitness value. The fitness function calculation is shown in the following formula (4).
[0110] Formula (4):
[0111]
[0112] S307, determine whether the termination condition is met, if so, output the optimal solution, that is, the weight corresponding to the optimal whale individual, otherwise return to S303 to continue executing the algorithm. The termination condition is t Greater than or equal to t max , that is, the maximum number of iterations is reached.
[0113] S104. Determine the content of the target element in the sample to be tested based on the proportion of the pure element spectrum of the target element in the target spectrum.
[0114] As a possible implementation method, the content of the target element in the sample to be tested is determined based on the proportion of the pure element spectrum of the target element in the target spectrum, including: calculating the pure element intensity value of the target element in the pure element spectrum; determining the measured intensity value of the target element in the target spectrum based on the pure element spectrum of the target element and the proportion of the pure element spectrum in the target spectrum; based on the formula , the target element i The measured strength value and the pure element strength value The ratio of the target element is determined as the relative intensity of R i ; Based on the formula , determine the target elements in the sample to be tested i Content C i , n is the number of target elements in the target spectrum.
[0115] As a possible implementation method, in determining the target element in the sample to be tested i Content C i Afterwards, the method also includes:
[0116] The target element i Content C i Substitute into the basic parameter method and calculate the target element i The relative strength .
[0117]
[0118]
[0119]
[0120]
[0121]
[0122]
[0123] In the formula, For elements The computational intensity of For pure elements The computational intensity of For elements Content; is the minimum wavelength of the incident X-ray; For elements The critical excitation wavelength of is the wavelength of incident X-rays; For elements Characteristic X-ray wavelength; For elements Characteristic X-ray wavelength; is the excitation source intensity at a given wavelength; For elements The absorption step coefficient of For elements The fluorescence yield of For elements The spectral line fraction of is the angle of incidence; is the exit angle; ; ; For elements At a given wavelength The mass absorption coefficient under For elements At a given wavelength The mass absorption coefficient under The incident wavelength is The effective mass absorption coefficient of the sample to be tested is: The emission wavelength is The effective mass absorption coefficient of the sample to be tested is: The wavelength is The mass absorption coefficient of the sample to be tested is: At the incident wavelength element The value is 1 when the excitation edge wavelength is , and 0 in other cases; At the incident wavelength element The value is 1 when the excitation edge wavelength is , and 0 in other cases; For elements At wavelength The mass absorption coefficient when For elements At wavelength The mass absorption coefficient of For elements At wavelength The mass absorption coefficient of Take 0.002nm; For analysis of elements Content; For analysis of elements In wavelength The mass absorption coefficient of For analysis of elements In wavelength The mass absorption coefficient.
[0124] Based on the formula , calculate the target element i Corrected value of content If the correction value and content C i If the difference between them is less than or equal to the preset difference threshold, the target element i Content C i Update to correct value If the correction value and content C i If the difference between the two is greater than the preset difference threshold, the target element i Content C i Update to correct value Then, the above process is repeated until the difference is less than or equal to the preset difference threshold.
[0125] For example, the preset difference threshold can be , if satisfied , output As target element i otherwise Normalize and make , repeat the above process.
[0126] Corresponding to the above embodiment, the present invention also provides a spectrum analysis device based on an X-ray fluorescence spectrometer. Figure 3 A structural schematic diagram of a spectrum analysis device based on an X-ray fluorescence spectrometer provided in an embodiment of the present invention, the device may include: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, so that the at least one processor can execute a spectrum analysis method based on an X-ray fluorescence spectrometer as described in the above embodiment.
[0127] In a possible implementation of the present invention, the at least one processor is capable of executing the following steps: obtaining, through an X-ray fluorescence spectrometer, a measured spectrum of the sample to be tested and a pure element spectrum corresponding to the target element; subtracting the background in the measured spectrum and the background in the pure element spectrum respectively by combining the straight line method and the peak stripping method; determining the proportion of the pure element spectrum of the target element in the target spectrum to obtain a fitted target spectrum, wherein the residual between the target spectrum and the measured spectrum is less than a preset residual threshold; and determining the content of the target element in the sample to be tested based on the proportion of the pure element spectrum of the target element in the target spectrum.
[0128] In a specific implementation, the present invention can also be provided as a non-volatile computer storage medium, wherein the storage medium is a non-volatile computer-readable storage medium, and the non-volatile computer-readable storage medium stores at least one program, each program includes instructions, and when the instructions are executed by a terminal, the terminal executes a spectrum analysis method based on an X-ray fluorescence spectrometer as described in the above embodiment.
[0129] In a possible implementation of the present invention, the aforementioned terminal executes, through an X-ray fluorescence spectrometer, to obtain a measured spectrum of the sample to be tested and a pure element spectrum corresponding to the target element; combining the straight line method and the peak stripping method, respectively subtracting the background in the measured spectrum and the background in the pure element spectrum; determining the proportion of the pure element spectrum of the target element in the target spectrum to obtain a fitted target spectrum, and the residual between the target spectrum and the measured spectrum is less than a preset residual threshold; based on the proportion of the pure element spectrum of the target element in the target spectrum, determining the content of the target element in the sample to be tested.
[0130] The various embodiments of the present invention are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0131] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0132] The above description is only an embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A spectrum analysis method based on X-ray fluorescence spectrometer, characterized in that: The method comprises: Obtain the measured spectrum of the sample to be tested and the pure element spectrum corresponding to the target element through an X-ray fluorescence spectrometer; Combining the straight line method and the peak stripping method, the background in the measured spectrum and the background in the pure element spectrum are respectively subtracted; Determine the proportion of the pure element spectrum of the target element in the target spectrum to obtain the fitted target spectrum, including: determining the proportion with the smallest fitness value in the search space as the optimal proportion through a search-based optimization algorithm, the fitness value is the value of a fitness function, determining the optimal proportion as the proportion of the pure element spectrum of the target element in the target spectrum, the fitness function is the residual between the fitted target spectrum and the measured spectrum, and the residual between the target spectrum and the measured spectrum is less than a preset residual threshold; The content of the target element in the sample to be tested is determined based on the proportion of the pure element spectrum of the target element in the target spectrum.
2. The spectrum analysis method based on X-ray fluorescence spectrometer according to claim 1, characterized in that: Combining the straight line method and the peak stripping method, the background in the measured spectrum and the background in the pure element spectrum are respectively subtracted, including: Based on the formula , respectively remove the spectral lines from the left boundary to the right boundary of the characteristic peak in the measured spectrum, and the spectral lines from the left boundary to the right boundary of the characteristic peak in the pure element spectrum, wherein, y i For spectrum i The intensity value of the spectrum a is the left boundary of the characteristic peak, and the spectral line b is the right boundary of the characteristic peak; Based on the formula , calculate the 2 adjacent to any spectral line in the measured spectrum d The average value of the intensity of the spectral line , if the intensity value of any spectral line y i is less than the average value, then the intensity value of any spectral line is updated to the average value, wherein, d is a positive integer; Based on the formula , calculate the 2 adjacent to any spectral line in the pure element spectrum d The average value of the intensity of the spectral line , if the intensity value of any spectral line y i If the value is smaller than the average value, the intensity value of any spectral line is updated to the average value.
3. The spectrum analysis method based on X-ray fluorescence spectrometer according to claim 1, characterized in that: Before determining the proportion with the smallest fitness value in the search space as the optimal proportion by using the search-based optimization algorithm, the method further includes: Determine the maximum number of channels for the peak drift of the X-ray fluorescence spectrometer m ; Based on the maximum number of channels of the spectrum peak drift, determine the fitness function in the optimization algorithm ,in, w is the number of spectral lines in the measured spectrum, Y i is the spectral line in the measured spectrum i The strength value of n is the number of target elements in the target spectrum, A j The target element j The proportion of the pure element spectrum in the target spectrum, P j,i The target element j Spectral lines in the pure element spectrum i The intensity value of .
4. The spectrum analysis method based on X-ray fluorescence spectrometer according to claim 1, characterized in that: Through the search-based optimization algorithm, the proportion with the smallest fitness value in the search space is determined as the optimal proportion, including: Based on the whale optimization algorithm, when the number of iterations reaches a preset threshold, the whale individual with the smallest fitness value in the whale population is determined as the best whale individual, and the proportion corresponding to the best whale individual is determined as the optimal proportion.
5. The spectrum analysis method based on X-ray fluorescence spectrometer according to claim 1, characterized in that: Determining the content of the target element in the sample to be tested based on the proportion of the pure element spectrum of the target element in the target spectrum, comprising: Calculating the pure element intensity value of the target element in the pure element spectrum; Determining a measured intensity value of the target element in the target spectrum based on a pure element spectrum of the target element and a proportion of the pure element spectrum in the target spectrum; The ratio of the measured intensity value to the pure element intensity value is determined as the relative intensity of the target element; Based on the formula , determine the target element in the sample to be tested i Content C i ,in, R i is the relative intensity of the target element, n is the number of target elements in the target spectrum.
6. The spectrum analysis method based on X-ray fluorescence spectrometer according to claim 5, characterized in that: In determining the target element in the sample to be tested i Content C i Afterwards, the method further comprises: Based on the fundamental parameter method, the target element is calculated i The relative strength ; Based on the formula , calculate the target element i Corrected value of content ; If the correction value With the content C i If the difference between the two is less than or equal to the preset difference threshold, the target element i Content C i Update to the corrected value ; If the correction value With the content C i If the difference between the two is greater than the preset difference threshold, the target element i Content C i Update to the corrected value Then, the above process is repeated until the difference is less than or equal to the preset difference threshold.
7. A spectrum analysis device based on an X-ray fluorescence spectrometer, characterized in that: The device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, so that the at least one processor can execute a spectrum analysis method based on an X-ray fluorescence spectrometer according to any one of claims 1-6.
8. A non-volatile computer storage medium, characterized in that: The storage medium is a non-volatile computer-readable storage medium, which stores at least one program, each of which includes instructions, and when the instructions are executed by the terminal, the terminal executes a spectrum analysis method based on an X-ray fluorescence spectrometer according to any one of claims 1-6.