In-situ nitrogen and sulfur measurement method and system based on differential ultraviolet spectroscopy
By screening the approximate absorption peak area in the spectral curve, evaluating the merging ability of the data segments, and calculating the optimal average window size, the problem of poor denoising effect in the existing technology is solved and more accurate nitrogen and sulfur concentration measurements are achieved.
Patent Information
- Application Number
- CN202410392046.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-02
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-04-02
AI Technical Summary
In the existing technology, the moving average algorithm cannot effectively remove noise while retaining peak information due to poor setting of the average window size when denoising spectral curves, resulting in errors in the detected nitrogen and sulfur concentrations.
By obtaining the local reflection intensity change trend within the data segment of the spectral curve, filter out the approximate absorption peak area, evaluate the merging ability between data segments, determine the merging neighborhood range, calculate the optimal average window size, and compare the spectral curve based on this Perform denoising processing.
A more accurate denoising effect is achieved, the signal-to-noise ratio of spectral data is improved, and the accuracy and sensitivity of nitrogen and sulfur concentration measurements are ensured.
Smart Images

Figure CN118032695B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data denoising processing, and in particular to a nitrogen and sulfur in-situ measurement method and system based on differential ultraviolet spectroscopy technology. Background Art
[0002] Differential UV spectroscopy is a method that uses the absorption characteristics of materials in the UV band to analyze. It is particularly suitable for monitoring chemical substances with specific UV absorption characteristics, such as nitrogen and sulfur. Differential spectroscopy is used to improve the signal-to-noise ratio. In view of the complexity of differential UV spectroscopy data, accurate nitrogen and sulfur concentration information is extracted through data processing algorithms to avoid interference and errors. Therefore, denoising the nitrogen and sulfur curves is a key step to improve detection accuracy and sensitivity.
[0003] In the prior art, a moving average algorithm is used to remove noise from the spectral curve; however, when the averaging window is too large, the peak information of the spectral curve will be lost, resulting in errors in the sample concentration measurement obtained based on the peak information; on the contrary, when the averaging window is too small, some noise will remain; therefore, poor setting of the averaging window size results in poor denoising effect, resulting in errors in the detected nitrogen and sulfur concentrations. Summary of the invention
[0004] In order to solve the technical problem that the average window size is not set well, resulting in poor denoising effect and errors in the detected sample concentration, the purpose of the present invention is to provide a nitrogen and sulfur in-situ measurement method and system based on differential ultraviolet spectroscopy technology. The technical solution adopted is as follows:
[0005] The present invention proposes a nitrogen and sulfur in-situ measurement method based on differential ultraviolet spectroscopy technology, the method comprising:
[0006] Obtaining a spectrum curve of a nitrogen and sulfur sample; the spectrum curve includes reflection intensities corresponding to different wavelengths;
[0007] Discretize the spectral curve to obtain data points on the spectral curve; obtain multiple data segments of the spectral curve, and obtain the curve volatility in each data segment according to the change trend of the local reflection intensity between adjacent data points in each data segment; and screen out the absorption peak approximate area according to the curve volatility in each data segment;
[0008] Select any absorption peak approximate region as a target data segment; obtain the merging ability within different preset neighborhood ranges according to the difference in curve volatility between the target data segment and other data segments within the corresponding different preset neighborhood ranges; determine the merging neighborhood range of the target data segment according to the merging ability; change the target data segment to obtain multiple merging neighborhood ranges;
[0009] According to the fluctuation characteristics of the reflection intensity corresponding to the data points in different merged neighborhood ranges and the wavelength range of the merged neighborhood range, an optimal average window size is obtained; according to the optimal average window size, a spectral curve is denoised to obtain a denoised spectral curve;
[0010] The nitrogen and sulfur are measured in situ according to the de-noised spectral curve.
[0011] Furthermore, the method for obtaining the data points includes:
[0012] The Nyquist sampling theorem is used to obtain the minimum sampling frequency of the spectral curve; the reciprocal of the minimum sampling frequency is calculated and taken as an integer as the sampling step; the spectral curve is discretized with the sampling step as an interval to obtain the data points on the spectral curve.
[0013] Furthermore, the method for obtaining the curve volatility includes:
[0014] On the spectrum curve, data points in a preset wavelength range are sequentially acquired to form a data segment;
[0015] Obtain the fitting function of the spectral curve;
[0016] In each data segment, the integral of the fitting function between adjacent data points is calculated as the local reflection intensity between adjacent data points;
[0017] Calculate the difference between two adjacent local reflection intensities as a first difference;
[0018] The average of the first differences between all adjacent local reflection intensities in each data segment is calculated and normalized to obtain the curve fluctuation of each data segment.
[0019] Furthermore, the method for obtaining the absorption peak approximate region includes:
[0020] If the curve volatility of a data segment is within a preset volatility threshold, the corresponding data segment is used as an absorption peak approximation region.
[0021] Furthermore, the method for obtaining the mergeability includes:
[0022] In each preset neighborhood range of the target data segment, the ratio of the target data segment to each other data segment in the preset neighborhood range is calculated as the first ratio; the difference between the first ratio and a preset constant between the target data segment and each other data segment in the preset neighborhood range is calculated as the first difference; the average of the first differences between the target data segment and all other data segments in the preset neighborhood range is calculated as the mergeability within each preset neighborhood range.
[0023] Furthermore, the method for obtaining the merged neighborhood range includes:
[0024] If the merging capability within the preset neighborhood range is not within the preset merging threshold range, the previous preset neighborhood range is determined to be a merged neighborhood range.
[0025] Furthermore, the method for obtaining the optimal average window size includes:
[0026] Calculate the difference between the maximum wavelength and the minimum wavelength in the merged neighborhood range as the wavelength range of the merged neighborhood range;
[0027] The optimal average window size is obtained according to the optimal average window size acquisition formula. The optimal average window size acquisition formula is:
[0028] ;in, represents the optimal average window size; Indicates The wavelength range of the merged neighborhood range; Indicates Data points within the merged neighborhood; Indicates The corresponding reflection intensity of the data points within the merged neighborhood; Indicates The variance of the reflection intensity corresponding to the data points within the merged neighborhood; Indicates the number of merged neighborhood ranges; Represents the normalization function.
[0029] Furthermore, the method for obtaining the denoised spectrum curve includes:
[0030] Based on the optimal average window size, the spectral curve is denoised by using a moving average algorithm to obtain a denoised spectral curve.
[0031] Furthermore, the preset fluctuation threshold range is .
[0032] The present invention also proposes a nitrogen and sulfur in-situ measurement system based on differential ultraviolet spectroscopy technology, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements any one of the steps of the nitrogen and sulfur in-situ measurement method based on differential ultraviolet spectroscopy technology.
[0033] The present invention has the following beneficial effects:
[0034] In order to simplify the data processing process and retain sufficient information at the same time, the present invention discretizes the spectral curve to obtain data points on the spectral curve; obtains multiple data segments of the spectral curve, and obtains the curve volatility in each data segment according to the changing trend of the local reflection intensity between adjacent data points in each data segment, which is helpful to more finely analyze the local characteristics in each data segment and describe the structural characteristics of the spectral curve; according to the curve volatility in each data segment, the absorption peak approximate area is screened out, and the area containing key feature information is focused on to improve the pertinence of the spectral analysis; any absorption peak approximate area is selected as the target data segment; in order to make the absorption peak shape clearer and more accurate, different absorption peaks are obtained according to the difference in curve volatility between the target data segment and other data segments corresponding to different preset neighborhoods. The similarity and mergeability between data segments are evaluated based on the mergeability within the preset neighborhood range; the merged neighborhood range of the target data segment is determined based on the mergeability to better reflect the spectral characteristics of the substance, describe the complete morphological characteristics of the absorption peak, and make the spectral data more interpretable; the target data segment is changed to obtain multiple merged neighborhood ranges; according to the fluctuation characteristics of the reflection intensity corresponding to the data points in different merged neighborhood ranges, and the corresponding wavelength range, the optimal average window size is obtained, which can maximize the retention of useful information of the spectral curve, while effectively removing noise and interference; the spectral curve is denoised according to the optimal average window size to obtain a denoised spectral curve, more accurately remove the noise components in the spectral curve, and improve the signal-to-noise ratio of the spectral data; the nitrogen and sulfur samples are measured in situ. The present invention obtains a suitable average window size in the denoising process of the spectral curve, optimizes the denoising effect, and accurately measures the concentration. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 A flow chart of a nitrogen and sulfur in-situ measurement method based on differential ultraviolet spectroscopy technology provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0037] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the nitrogen and sulfur in-situ measurement method and system based on differential ultraviolet spectroscopy technology proposed by the present invention, its specific implementation method, structure, characteristics and effects, in conjunction with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0038] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0039] The specific scheme of the nitrogen and sulfur in-situ measurement method and system based on differential ultraviolet spectroscopy technology provided by the present invention is described in detail below with reference to the accompanying drawings.
[0040] See also Figure 1 , which shows a flow chart of a nitrogen and sulfur in-situ measurement method based on differential ultraviolet spectroscopy technology provided by an embodiment of the present invention, and the specific method includes:
[0041] Step S1: obtaining a spectrum curve of a nitrogen and sulfur sample; the spectrum curve includes reflection intensities corresponding to different wavelengths.
[0042] In an embodiment of the present invention, in the process of performing nitrogen and sulfur analysis on a sample containing ultraviolet light absorption characteristics such as nitrogen and sulfur by using differential ultraviolet spectroscopy technology, first, a spectral curve of the nitrogen and sulfur sample is obtained by using differential ultraviolet spectroscopy technology, and the spectral curve includes reflection intensities corresponding to different wavelengths; wherein the horizontal axis is the wavelength of ultraviolet light, in nanometers (nm); and the vertical axis is the reflection intensities corresponding to different wavelengths, and there is no dimension.
[0043] Step S2: discretize the spectral curve to obtain data points on the spectral curve; obtain multiple data segments of the spectral curve, and obtain the curve volatility in each data segment based on the change trend of the local reflection intensity between adjacent data points in each data segment; and filter out the approximate area of the absorption peak based on the curve volatility in each data segment.
[0044] A continuous spectral curve contains an infinite number of data points. Through discretization, a continuous spectral curve can be converted into a finite number of data points, which reduces the amount of calculation and makes it easier to extract and analyze features. Appropriate discretization can eliminate or reduce small fluctuations caused by measurement equipment or environmental noise, thereby improving the accuracy of spectral analysis. Therefore, the spectral curve is discretized to obtain data points on the spectral curve.
[0045] Preferably, in one embodiment of the present invention, the discretization acquisition method includes:
[0046] In order to retain the characteristics of the original data after the spectral curve is discretized; the Nyquist sampling theorem is used to obtain the minimum sampling frequency of the spectral curve; the reciprocal of the minimum sampling frequency is calculated and taken as an integer as the sampling step; by selecting a suitable sampling step, the key features in the spectral curve can be highlighted; the spectral curve is discretized with the sampling step as an interval to obtain data points on the spectral curve. The specific Nyquist sampling theorem is a technical means well known to those skilled in the art and will not be described in detail here.
[0047] The data points are divided into multiple data segments to more accurately capture the local features in each data segment. The spectral curves in different data segments may have different volatility and changing trends. The changing trend of the local reflection intensity between adjacent data points can show the rising, falling and fluctuating trends in the spectral curve, which helps to understand the structure and characteristics of the spectral curve. The greater the difference between the local reflection intensities, the more fluctuating the spectral curve at the data segment, and the greater the volatility of the curve. Therefore, multiple data segments of the spectral curve are obtained, and the curve volatility in each data segment is obtained according to the changing trend of the local reflection intensity between adjacent data points in each data segment.
[0048] Preferably, in one embodiment of the present invention, the method for obtaining the curve volatility includes:
[0049] On the spectrum curve, data points of a preset wavelength range are obtained in sequence to form a data segment; a fitting function of the spectrum curve is obtained; since the spectrum curve is a continuous curve, in order to maximize the original data value of the curve during the analysis process and more accurately reflect the local reflection intensity characteristics of the spectrum curve within a specific wavelength range, an integral method is selected, and in each data segment, the integral of the fitting function between adjacent data points is calculated as the local reflection intensity between adjacent data points; the difference between two adjacent local reflection intensities is calculated as the first difference; the mean of the first differences between all adjacent local reflection intensities in each data segment is calculated and normalized as the curve volatility of each data segment. In one embodiment of the present invention, the formula for curve volatility is expressed as:
[0050] ;
[0051] in, Indicates The volatility of the curve for each data segment; Indicates The sequence number of the data point in a data segment; Indicates data points; Indicates data points; represents the fitting function of the spectral curve; Indicates The number of data points in a data segment; Indicates that the fitting function is The data point and the adjacent The integral function between data points; Represents the normalization function.
[0052] In the formula for curve volatility, It represents the first difference between adjacent local reflection intensities. The larger the first difference, the greater the difference between the local reflection intensities, the greater the volatility of the curve, and the more characteristic information it contains.
[0053] It should be noted that, in one embodiment of the present invention, the preset wavelength range is 30 nm; in other embodiments of the present invention, the size of the preset wavelength range can be set according to specific circumstances, and is not limited or elaborated herein.
[0054] It should be noted that, in one embodiment of the present invention, the fitting function can be obtained by the least squares method; in other embodiments of the present invention, the fitting function can also be obtained by fitting methods such as polynomial fitting and spline interpolation. The fitting method is a technical means well known to those skilled in the art and will not be elaborated here.
[0055] The nitrogen and sulfur compounds in the sample have different absorption characteristics, and the positions and intensities of the absorption peaks in the spectrum are different. The absorption peak of nitrogen is usually concentrated in the lower wavelength area of the spectral curve, while sulfur is mainly concentrated in the middle wavelength area of the spectral curve, resulting in absorption peaks at multiple wavelengths of the spectral curve. The absorption peak refers to the area in the spectrum where the reflection intensity is significantly reduced within a specific wavelength range, and its volatility is significantly greater than other non-absorption areas. The greater the curve volatility, the more likely it is to be an approximate absorption peak area. Therefore, the approximate absorption peak area is screened out based on the curve volatility in each data segment.
[0056] Preferably, in one embodiment of the present invention, the method for obtaining the absorption peak approximate region includes:
[0057] If the curve volatility of a data segment is within a preset volatility threshold, the corresponding data segment is used as an absorption peak approximation region.
[0058] It should be noted that, in one embodiment of the present invention, the preset fluctuation threshold range is In other embodiments of the present invention, the size of the preset fluctuation threshold range can be set according to the specific circumstances, and is not limited or elaborated here.
[0059] Step S3: select any absorption peak approximate area as the target data segment; obtain the merging feasibility within different preset neighborhood ranges according to the difference in curve volatility between the target data segment and other data segments within the corresponding different preset neighborhood ranges; determine the merging neighborhood range of the target data segment according to the merging feasibility; change the target data segment to obtain multiple merging neighborhood ranges.
[0060] Since some absorption peaks may occupy multiple data segments in the process of dividing data segments, it is necessary to analyze the complete absorption peak area; in order to obtain results faster and discover key information, any absorption peak approximate area is selected as the target data segment; the difference in curve volatility reflects the similarities and differences between data segments, and the smaller the difference, the more likely the data segment within the neighborhood range is to be a mergeable area; therefore, based on the difference in curve volatility between the target data segment and other data segments within the corresponding different preset neighborhood ranges, the mergeability within different preset neighborhood ranges is obtained.
[0061] Preferably, in one embodiment of the present invention, the method for obtaining the mergeability includes:
[0062] In each preset neighborhood range of the target data segment, the ratio of the target data segment to each other data segment in the preset neighborhood range is calculated as the first ratio; the difference between the first ratio and the preset constant between the target data segment and each other data segment in the preset neighborhood range is calculated as the first difference; the average of the first differences between the target data segment and all other data segments in the preset neighborhood range is calculated as the mergibility within each preset neighborhood range. In one embodiment of the present invention, the formula for mergibility is expressed as:
[0063] ;
[0064] in, Indicates The serial number of the preset neighborhood range of the target data segment; Indicates The first target data segment The mergibility of preset neighborhood ranges; Indicates Curve volatility of target data segments; Indicates The data segment corresponds to the first The volatility of the curves of other data segments; Indicates the number of other data segments within the neighborhood; Represents a preset constant, and its empirical value is 1.
[0065] In the formula for mergeability, Indicates The target data segment corresponds to the first The ratio of the volatility of the curve between other data segments. If the ratio is close to 1, The closer it is to 0, the closer the curve fluctuations between data segments are, and the more likely the preset neighborhood range is to be the absorption peak area.
[0066] It should be noted that, in one embodiment of the present invention, a method for obtaining different preset neighborhood ranges includes: taking the target data segment as the center, expanding outward a preset number of data segments in sequence and iterating to form a preset neighborhood range with the target data segment; the preset number is 2; an example is given: the first time, 2 adjacent data segments are selected to form a neighborhood range with the target data segment; the second time, 2 data segments are expanded outward again, and with the first iteration, 4 adjacent data segments are selected to form a neighborhood range with the target data segment; the third iteration, 2 data segments are expanded outward again, and with the second iteration, 6 adjacent data segments and the target data segment are selected to form a neighborhood range; different preset neighborhood ranges are obtained in sequence.
[0067] Through the merging of data segments within the neighborhood range, we can determine which data segments have similar features, thereby determining the merging neighborhood range; extracting more representative spectral features, and more accurately identifying the components in the sample. Therefore, the merging neighborhood range of the target data segment is determined based on the merging ability.
[0068] Preferably, in one embodiment of the present invention, the method for obtaining the merged neighborhood range includes:
[0069] If the merging feasibility within the preset neighborhood range is not within the preset merging threshold range, the corresponding previous preset neighborhood range will be determined as the merged neighborhood range.
[0070] It should be noted that, in one embodiment of the present invention, the preset merging threshold range is In one embodiment of the present invention, the size of the preset merging threshold range can be set according to the specific situation, and is not limited or elaborated here.
[0071] There are multiple different characteristic regions in the spectral curve, each of which may represent different components or structures in the sample; by changing the target data segment, these different characteristic regions can be explored and identified, thereby gaining a more comprehensive understanding of the spectral characteristics of the sample. Therefore, the target data segment is changed to obtain multiple merged neighborhood ranges.
[0072] Step S4: according to the fluctuation characteristics of the reflection intensity corresponding to the data points in different merged neighborhood ranges and the wavelength range of the merged neighborhood range, the optimal average window size is obtained; according to the optimal average window size, the spectral curve is denoised to obtain a denoised spectral curve.
[0073] The fluctuation characteristics of the reflection intensity corresponding to the data points within the merged neighborhood range can reflect the characteristics of the spectral data. The larger the fluctuation characteristics, the more characteristic information exists in the corresponding band range, the more likely it is an absorption peak area, and the more it needs to amplify the characteristics. The original band range can directly reflect the true reflection or emission characteristics of the sample within these bands, thereby more accurately revealing the composition and structural information of the sample. Based on the wavelength range corresponding to the merged neighborhood range, the characteristics of the data points are comprehensively considered to ensure that useful characteristic information is fully considered and utilized. Therefore, the optimal average window size is obtained according to the fluctuation characteristics of the reflection intensity corresponding to the data points in different merged neighborhood ranges, as well as the corresponding wavelength ranges.
[0074] Preferably, in one embodiment of the present invention, the method for obtaining the optimal average window size includes:
[0075] Calculate the difference between the maximum wavelength and the minimum wavelength in the merged neighborhood range as the wavelength range of the merged neighborhood range;
[0076] The optimal average window size is obtained according to the optimal average window size acquisition formula. The optimal average window size acquisition formula is:
[0077] ;
[0078] in, represents the optimal average window size; Indicates The wavelength range of the merged neighborhood range; Indicates Data points within the merged neighborhood; Indicates The corresponding reflection intensity of the data points within the merged neighborhood; Indicates The variance of the reflection intensity corresponding to the data points within the merged neighborhood; Indicates the number of merged neighborhood ranges; Represents the normalization function.
[0079] In the formula for obtaining the optimal average window size, Indicates The ratio of the variance of the reflection intensity of the merged neighborhood data point to the variance of the reflection intensity of all merged neighborhood data points. The larger the ratio, the The larger the variance of the reflection intensity of the data points in the merged neighborhood, the The greater the difference between the reflection intensities of the data points in the merged neighborhood range, the greater the volatility within the merged neighborhood range, the more likely it is an absorption peak area, and the more it is necessary to increase the weight ratio of the wavelength range; the larger the wavelength range, the greater the weight ratio, the larger the optimal average window, and the more characteristic information is retained.
[0080] Due to factors such as instrument errors and environmental noise, the spectral curve may contain noise components and needs to be denoised. However, although a smaller window size can better retain the details of the spectral curve, some noise remains; and although a larger window size can more effectively remove noise, it leads to the loss of the peak information of the spectral curve, resulting in errors in the sample concentration measurement based on the peak information; the optimal average window size can ensure that while removing noise, the main characteristic information of the spectral curve is retained as much as possible, making the data more accurate; therefore, the spectral curve is denoised according to the optimal average window size to obtain a denoised spectral curve.
[0081] Preferably, in one embodiment of the present invention, the method for obtaining a denoised spectrum curve includes:
[0082] Based on the optimal average window size, the spectral curve is denoised using a moving average algorithm to obtain a denoised spectral curve.
[0083] It should be noted that after obtaining the optimal average window size, in other embodiments of the present invention, in the process of performing the moving average algorithm on the spectral curve, weights can be assigned to each data according to whether the data in the optimal average window is in the absorption peak region, so that the data weight in the absorption peak region is higher than that in other regions, more main feature information can be retained, and the denoising effect is more accurate; the specific moving average algorithm is a technical means well known to those skilled in the art and will not be elaborated here.
[0084] Step S5: Perform in-situ measurement of nitrogen and sulfur based on the denoised spectrum curve.
[0085] The denoised spectral curve more accurately reflects the spectral characteristics of nitrogen and sulfur in the sample, avoiding measurement errors that may be caused by sample damage or contamination, and helps to accurately evaluate the nitrogen and sulfur content in the sample. Therefore, nitrogen and sulfur are measured in situ based on the denoised spectral curve.
[0086] It should be noted that, in one embodiment of the present invention, the reflection intensity of the absorption peak of the spectral curve can reflect the concentration, and the Beer-Lambert law is used to calculate the ratio of the reflection intensity to the nitrogen and sulfur concentration for the denoised spectral curve to obtain the nitrogen and sulfur concentration. The specific Beer-Lambert law is a technical means well known to those skilled in the art and will not be described in detail here.
[0087] In summary, the present invention discretizes the spectral curve to obtain data points on the spectral curve; obtains multiple data segments of the spectral curve, and obtains the curve volatility in each data segment according to the change trend of the local reflection intensity between adjacent data points in each data segment; screens out the absorption peak approximate area; selects any absorption peak approximate area as the target data segment; obtains the mergeability within different preset neighborhood ranges according to the difference in curve volatility between the target data segment and other data segments within the corresponding different preset neighborhood ranges; determines the merged neighborhood range of the target data segment; changes the target data segment to obtain multiple merged neighborhood ranges; obtains the optimal average window size according to the fluctuation characteristics of the corresponding reflection intensity of data points within different merged neighborhood ranges, and the corresponding wavelength range; denoises the spectral curve to obtain a denoised spectral curve; and performs in-situ measurement on nitrogen and sulfur samples. The present invention obtains a suitable average window size in the denoising process of the spectral curve, optimizes the denoising effect, and accurately measures the concentration.
[0088] The present invention also proposes a nitrogen and sulfur in-situ measurement system based on differential ultraviolet spectroscopy technology, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements any step of a nitrogen and sulfur in-situ measurement method based on differential ultraviolet spectroscopy technology.
[0089] An embodiment of a nitrogen and sulfur curve denoising method based on differential ultraviolet spectroscopy technology:
[0090] In the prior art, a moving average algorithm is used to remove noise from a spectral curve; however, when the average window is too large, the peak information of the spectral curve will be lost, resulting in errors in the sample concentration measurement obtained based on the peak information; on the contrary, when the average window is too small, some noise will remain; therefore, the average window size is not set well, resulting in a technical problem of poor denoising effect. In order to solve this technical problem, this embodiment provides a nitrogen and sulfur curve denoising method based on differential ultraviolet spectroscopy technology, including:
[0091] Step S1: Obtain a spectrum curve of a nitrogen and sulfur sample; the spectrum curve includes reflection intensities corresponding to different wavelengths.
[0092] Step S2: discretize the spectral curve to obtain data points on the spectral curve; obtain multiple data segments of the spectral curve, and obtain the curve volatility in each data segment based on the change trend of the local reflection intensity between adjacent data points in each data segment; and filter out the approximate area of the absorption peak based on the curve volatility in each data segment.
[0093] Step S3: select any absorption peak approximate area as the target data segment; obtain the merging feasibility within different preset neighborhood ranges according to the difference in curve volatility between the target data segment and other data segments within the corresponding different preset neighborhood ranges; determine the merging neighborhood range of the target data segment according to the merging feasibility; change the target data segment to obtain multiple merging neighborhood ranges.
[0094] Step S4: according to the fluctuation characteristics of the reflection intensity corresponding to the data points in different merged neighborhood ranges and the wavelength range of the merged neighborhood range, the optimal average window size is obtained; according to the optimal average window size, the spectral curve is denoised to obtain a denoised spectral curve.
[0095] Since the specific implementation process of steps S1 to S4 has been described in detail in the above-mentioned nitrogen and sulfur in-situ measurement method based on differential ultraviolet spectroscopy technology, it will not be repeated here.
[0096] The technical effects of this embodiment are as follows:
[0097] This embodiment discretizes the spectral curve to obtain data points on the spectral curve; obtains multiple data segments of the spectral curve, and obtains the curve volatility in each data segment according to the changing trend of the local reflection intensity between adjacent data points in each data segment; screens out the absorption peak approximate area; selects any absorption peak approximate area as the target data segment; obtains the mergeability within different preset neighborhood ranges according to the difference in curve volatility between the target data segment and other data segments within the corresponding different preset neighborhood ranges; determines the merged neighborhood range of the target data segment; changes the target data segment to obtain multiple merged neighborhood ranges; obtains the optimal average window size according to the fluctuation characteristics of the corresponding reflection intensity of data points within different merged neighborhood ranges, and the corresponding wavelength range; denoises the spectral curve to obtain a denoised spectral curve; and performs in-situ measurement on nitrogen and sulfur samples. The present invention obtains a suitable average window size in the denoising process of the spectral curve and optimizes the denoising effect.
[0098] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0099] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. A nitrogen and sulfur in-situ measurement method based on differential ultraviolet spectroscopy technology, characterized in that: The method comprises: Obtaining a spectrum curve of a nitrogen and sulfur sample; the spectrum curve includes reflection intensities corresponding to different wavelengths; Discretize the spectral curve to obtain data points on the spectral curve; obtain multiple data segments of the spectral curve, and obtain the curve volatility in each data segment according to the change trend of the local reflection intensity between adjacent data points in each data segment; and screen out the absorption peak approximate area according to the curve volatility in each data segment; Select any absorption peak approximate region as a target data segment; obtain the merging ability within different preset neighborhood ranges according to the difference in curve volatility between the target data segment and other data segments within the corresponding different preset neighborhood ranges; determine the merging neighborhood range of the target data segment according to the merging ability; change the target data segment to obtain multiple merging neighborhood ranges; According to the fluctuation characteristics of the reflection intensity corresponding to the data points in different merged neighborhood ranges and the wavelength range of the merged neighborhood range, an optimal average window size is obtained; according to the optimal average window size, a spectral curve is denoised to obtain a denoised spectral curve; Performing in-situ measurement of nitrogen and sulfur according to the de-noised spectral curve; The method for obtaining the optimal average window size includes: Calculate the difference between the maximum wavelength and the minimum wavelength in the merged neighborhood range as the wavelength range of the merged neighborhood range; The optimal average window size is obtained according to the optimal average window size acquisition formula. The optimal average window size acquisition formula is: ;in, represents the optimal average window size; Indicates The wavelength range of the merged neighborhood range; Indicates Data points within the merged neighborhood; Indicates The corresponding reflection intensity of the data points within the merged neighborhood; Indicates The variance of the reflection intensity corresponding to the data points within the merged neighborhood; Indicates the number of merged neighborhood ranges; Represents the normalization function.
2. The nitrogen and sulfur in-situ measurement method based on differential ultraviolet spectroscopy technology according to claim 1 is characterized in that: The method for obtaining the data points comprises: The Nyquist sampling theorem is used to obtain the minimum sampling frequency of the spectral curve; the reciprocal of the minimum sampling frequency is calculated and taken as an integer as the sampling step; the spectral curve is discretized with the sampling step as an interval to obtain the data points on the spectral curve.
3. The nitrogen and sulfur in-situ measurement method based on differential ultraviolet spectroscopy technology according to claim 1 is characterized in that: The method for obtaining the curve volatility includes: On the spectrum curve, data points in a preset wavelength range are sequentially acquired to form a data segment; Obtain the fitting function of the spectral curve; In each data segment, the integral of the fitting function between adjacent data points is calculated as the local reflection intensity between adjacent data points; Calculate the difference between two adjacent local reflection intensities as a first difference; The average of the first differences between all adjacent local reflection intensities in each data segment is calculated and normalized to obtain the curve fluctuation of each data segment.
4. The nitrogen and sulfur in-situ measurement method based on differential ultraviolet spectroscopy technology according to claim 1 is characterized in that: The method for obtaining the absorption peak approximate region comprises: If the curve volatility of a data segment is within a preset volatility threshold, the corresponding data segment is used as an absorption peak approximation region.
5. The nitrogen and sulfur in-situ measurement method based on differential ultraviolet spectroscopy technology according to claim 1 is characterized in that: The method for obtaining the mergeability includes: In each preset neighborhood range of the target data segment, the ratio of the target data segment to each other data segment in the preset neighborhood range is calculated as the first ratio; the difference between the first ratio and a preset constant between the target data segment and each other data segment in the preset neighborhood range is calculated as the first difference; the average of the first differences between the target data segment and all other data segments in the preset neighborhood range is calculated as the mergeability within each preset neighborhood range.
6. The nitrogen and sulfur in-situ measurement method based on differential ultraviolet spectroscopy technology according to claim 1 is characterized in that: The method for obtaining the merged neighborhood range includes: If the merging capability within the preset neighborhood range is not within the preset merging threshold range, the previous preset neighborhood range is determined to be a merged neighborhood range.
7. The nitrogen and sulfur in-situ measurement method based on differential ultraviolet spectroscopy technology according to claim 1 is characterized in that: The method for obtaining the denoised spectrum curve comprises: Based on the optimal average window size, the spectral curve is denoised by using a moving average algorithm to obtain a denoised spectral curve.
8. The nitrogen and sulfur in-situ measurement method based on differential ultraviolet spectroscopy technology according to claim 4 is characterized in that: The preset fluctuation threshold range is .
9. A nitrogen and sulfur in-situ measurement system based on differential ultraviolet spectroscopy technology, the system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the nitrogen and sulfur in-situ measurement method based on differential ultraviolet spectroscopy technology as described in any one of claims 1 to 8 are implemented.
