An infrared spectral data preprocessing method for detecting gaseous hydrocarbon components
By acquiring and correcting the baseline of the infrared spectrum, decomposing and compensating the high and low frequency parts, the problem of noise interference in infrared spectrum analysis is solved, and the quantitative analysis accuracy of hydrocarbon gas detection is improved.
Patent Information
- Application Number
- CN202111612589.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-27
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2041-12-27
AI Technical Summary
In oil and gas exploration, during infrared spectroscopy, the spectrum is disturbed by multiple background noises, especially the molecular structures of the same molecular groups of hydrocarbon gases are similar, resulting in insufficient quantitative analysis accuracy and serious impact on baseline drift.
By obtaining the baseline of the smoothed spectral sequence, and using the smoothed spectral sequence for correction, decomposing it into low-frequency and high-frequency parts, removing the high-frequency part data and interpolation and filling, obtaining the baseline of the smoothed spectral sequence, and finally correcting.
There is no need to set high and low frequency decomposition thresholds in artificially, effectively retain the original spectral characteristic information, reduce additional noise interference, and improve the accuracy of spectral analysis.
Smart Images

Figure CN114739937B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of hydrocarbon gas detection in oil and gas exploration, and particularly relates to an infrared spectrum data preprocessing method for detecting gaseous hydrocarbon components. Background Technique
[0002] In oil and gas exploration, applying hydrocarbon gas detection technology to conduct real-time analysis and evaluation of hydrocarbon gases, complete the geological steering function, accurately determine the oil and gas content and type of the drilled interval, and timely discover and interpret the downhole formation oil and gas conditions have important guiding significance. Due to the continuous improvement of drilling speed, the advantages of high-precision and rapid data acquisition, multi-index fine interpretation, and multi-information comprehensive evaluation of infrared spectroscopy logging technology have gradually emerged. However, online quantitative analysis of multi-component mixtures, especially substances with the same molecular groups and similar molecular structures such as hydrocarbons, is one of the current research difficulties.
[0003] When performing infrared spectrum analysis, the spectrum of the measured object is often interfered by various background noises. These background noises may include the noise of the light source, the dark current of the detector, the interference of molecular scattering, and the infrared spectra of other substances. In addition, as the detection time increases, the spectrum may also show baseline drift. These interferences will affect the accuracy of the spectrum during quantitative analysis. Therefore, before performing spectrum analysis, it is often necessary to find a suitable method to preprocess the original spectrum data measured by the spectrometer. Summary of the Invention
[0004] The purpose of the present invention is to provide an infrared spectrum data preprocessing method for detecting gaseous hydrocarbon components, by obtaining the baseline of the smoothed spectrum sequence and using the baseline of the smoothed spectrum sequence to correct the smoothed spectrum sequence; this method does not require artificial setting of the thresholds for high-frequency and low-frequency decomposition, can effectively retain the characteristic information of the original spectrum, and overcomes the disadvantage of easily introducing additional noise when directly subtracting the low-frequency components.
[0005] The technical solution provided by the present invention is as follows:
[0006] An infrared spectrum data preprocessing method for detecting gaseous hydrocarbon components, comprising the following steps:
[0007] Step 1: Obtain the original spectrum sequence of the sample;
[0008] Step 2: Perform smoothing denoising processing on the original spectrum sequence to obtain a smoothed spectrum sequence;
[0009] Step 3: Decompose the smoothed spectrum sequence into a low-frequency part and a high-frequency part;
[0010] Step 4: Obtain the low-frequency part baseline according to the spectral sequence data of the low-frequency part;
[0011] Step 5: Eliminate the data in the high-frequency part from the smoothed spectral sequence, and then perform interpolation to supplement the data points at the eliminated positions to obtain the high-frequency part baseline;
[0012] Step 6: Obtain the baseline of the smoothed spectral sequence according to the low-frequency part baseline and the high-frequency part baseline;
[0013] Step 7: Use the baseline of the smoothed spectral sequence to correct the smoothed spectral sequence to obtain the preprocessed spectral sequence.
[0014] Preferably, in Step 1, obtaining the original spectral sequence of the sample includes the following steps:
[0015] Step 1: Obtain the sample infrared spectrum Is and the background infrared spectrum Ib respectively;
[0016] Among them, the measured background spectrum Ib has the same band range and resolution as the sample infrared spectrum Is;
[0017] Step 2: Differentiate the sample infrared spectrum Is and the background infrared spectrum Ib, and use the obtained differential spectrum as the original spectrum;
[0018] Step 3: Number the data of the original spectrum in descending order of wavenumber to obtain the original spectral sequence.
[0019] Preferably, the background infrared spectrum is:
[0020]
[0021] Among them, Ib0 represents the background spectrum monitoring value, σ represents the frequency of the background spectrum, σ max 、σ min represent the maximum and minimum values of the set measurement band range respectively, δ is an empirical correction coefficient, and a, b, and c are constant parameters respectively.
[0022] Preferably, in Step 1, the band range for measuring the spectrum is 6000 cm -1 ~2000 cm -1 , and the resolution is 1 cm -1 .
[0023] Preferably, in Step 2, the wavelet denoising method is used to perform smoothing denoising processing on the original spectral sequence;
[0024] Among them, the wavelet function used is the db function, and the decomposition level is 5 layers.
[0025] Preferably, in the third step, wavelet packet is used to decompose the smoothed spectral sequence;
[0026] Among them, when performing wavelet packet decomposition, the sampling frequency is 1024Hz and the decomposition level is 4 layers.
[0027] Preferably, in the fourth step, polynomial fitting is used for the spectral sequence data of the low-frequency part to obtain the baseline of the low-frequency part.
[0028] Preferably, in the sixth step, the baseline of the low-frequency part and the baseline of the high-frequency part are averaged to obtain the baseline of the smoothed spectral sequence;
[0029] Among them, weighted average is used when calculating the average of the baselines. Among them, the weights of the high-frequency part and the low-frequency part are respectively:
[0030]
[0031]
[0032] Among them, W H is the weight of the high-frequency part, E H is the energy value of the high-frequency part, W L is the weight of the low-frequency part, E L is the energy value of the low-frequency part, α is the high-frequency correction parameter, and β is the low-frequency correction parameter.
[0033] Preferably, in the seventh step, the smoothed spectral sequence is subtracted from the baseline of the smoothed spectral sequence to obtain the preprocessed spectral sequence.
[0034] The beneficial effects of the present invention are:
[0035] The infrared spectral data preprocessing method for detecting gaseous hydrocarbon components provided by the present invention does not require artificial setting of the thresholds for high-frequency and low-frequency decomposition, can effectively retain the characteristic information of the original spectrum, and overcomes the disadvantage of easily introducing additional noise when directly subtracting the low-frequency components. Description of the Drawings
[0036] Figure 1 is the flowchart of the infrared spectral data preprocessing method for detecting gaseous hydrocarbon components according to the present invention.
[0037] Figure 2 is the original spectrogram after number processing in the embodiment of the present invention.
[0038] Figure 3 is the spectral sequence after denoising in the embodiment of the present invention.
[0039] Figure 4This is the baseline of the smoothed spectral sequence obtained in the embodiments of the present invention.
[0040] Figure 5 This is the spectrum after baseline correction obtained in the embodiments of the present invention. Detailed implementation manners
[0041] The following further elaborates on the present invention with reference to the accompanying drawings, so that those skilled in the art can implement it according to the description in the specification.
[0042] As Figure 1 shown, the present invention provides an infrared spectral data preprocessing method for detecting gaseous hydrocarbon components, and the specific implementation process is as follows:
[0043] (1) Obtain the sample infrared spectrum Is and the background infrared spectrum Ib
[0044] Before adding the sample to be measured, use an infrared spectrometer to measure and obtain the spectrum as the background spectrum monitoring value Ib0. In this embodiment, the calculation method of the background infrared spectrum Ib is:
[0045]
[0046] In the formula, Ib0 represents the background spectrum monitoring value, σ represents the frequency of the background spectrum, σ max , σ min respectively represent the maximum and minimum values of the set measurement band range, δ is an empirical correction coefficient, and a, b, and c are constant parameters respectively. Among them, the value range of δ is 0.98 to 1.05; the value range of a is: 0.6 to 1.2; the value range of b is 0.085 to 0.1; the value range of c is 0.9 to 1.1.
[0047] After adding the sample, use the infrared spectrometer to obtain the sample infrared spectrum Is again; the band range and resolution of the measured background spectrum Ib0 and the sample spectrum Is should be the same. Preferably, the wavenumber (frequency) range of the measured spectrum is set to 6000 cm -1 ~2000 cm -1 , and the resolution is 1 cm -1 .
[0048] By correcting the background infrared spectrum, the influence of background noise and baseline drift on spectral measurement can be reduced, which provides a guarantee for the accuracy of subsequent spectral qualitative and quantitative analysis.
[0049] (2) Subtract the background spectrum Ib from the sample spectrum Is, and use the obtained difference spectrum I as the original spectrum. The spectral data includes successively decreasing wavenumber values and the absorbance values corresponding to each wavenumber.
[0050] (3) Number the wavenumbers in descending order of natural numbers, and form a spectral sequence with the absorbance values corresponding to each wavenumber, that is, obtain the original spectral sequence of the sample;
[0051] (4) Perform smoothing and denoising on the original spectral sequence. The denoising method uses moving window smoothing or Savitzky-Golay smoothing or wavelet denoising to obtain the smoothed spectral sequence Im.
[0052] As a further preference, in this embodiment, wavelet denoising is used to smooth and denoise the original spectrum; the wavelet function used is db, and the decomposition level is 5 layers. Through wavelet smoothing and denoising processing, the signal-to-noise ratio can be improved, and the deviation of the signal value caused by high-frequency noise can be eliminated.
[0053] (5) Perform frequency-domain segmentation processing on the spectral sequence Im obtained in step (4). Using wavelet packet decomposition, decompose the smoothed spectral sequence into a high-frequency part and a low-frequency part, and reconstruct it back into a time-domain signal. Among them, when performing wavelet packet decomposition, the input sampling frequency is 1024 Hz, and the decomposition level is 4 layers; as a further preference, the wavelet packet coefficients used in the 4th layer are [42.0035, 44.3324, 2.6513, 4.9862, 0.3172, 0.3594, 1.4396, 0.5266].
[0054] (6) Use polynomial fitting for the spectral data of the low-frequency part to obtain the low-frequency part baseline to eliminate the interference of low-frequency noise such as fluorescence background that is relatively flat as a whole.
[0055] (7) The smoothed original spectral sequence is decomposed by wavelet packet decomposition to obtain the split low-frequency part spectral data and high-frequency part spectral data. Directly delete the data points included in the high-frequency spectrum in the smoothed spectral sequence, and supplement the missing data points using the interpolation method. The interpolation method uses third-order Hermite interpolation or cubic spline interpolation;
[0056] (8) Take the average of the baseline obtained from the low-frequency part and the baseline obtained from the high-frequency part to obtain the baseline of the smoothed spectral sequence Im;
[0057] When calculating the average of the baselines, weighted average is used. Among them, the weights of the high-frequency part and the weights of the low-frequency part are respectively:
[0058]
[0059]
[0060] Among them, W H is the weight of the high-frequency part, E H is the energy value of the high-frequency part, W L is the weight of the low-frequency part, EL is the energy value of the low-frequency part, α is the high-frequency correction parameter, and the value range of α is: 0.5 to 0.8; β is the low-frequency correction parameter, and the value range of β is 1.0 to 1.5.
[0061] The baseline of the entire spectrum is obtained by weighted averaging the high-frequency baseline and the low-frequency baseline, and the weight values are obtained from the above formula.
[0062] The weighted average formula for obtaining the baseline of the entire spectrum is:
[0063]
[0064] where b i is the i-th point of the final baseline, b Hi is the i-th point of the high-frequency baseline, and b Li is the i-th point of the low-frequency baseline.
[0065] (9) Subtract the baseline obtained in (8) from the original smoothed spectrum sequence Im, that is, complete the baseline correction to obtain the baseline-corrected spectrum sequence Ir.
[0066] (10) Perform dimensionality reduction on Ir to extract the main features. The dimensionality reduction method uses the SPA successive projection algorithm, and the number of spectral data points after dimensionality reduction using the SPA method is 50 points.
[0067] Example
[0068] In this example, a Bruker Alpha II type infrared spectrometer is used to collect infrared spectral data, and the wavenumber (frequency) range of the measured spectrum is set to 6000 cm -1 ~2000 cm -1 , and the resolution is 1 cm -1 .
[0069] Obtain the sample infrared spectrum Is and the background infrared spectrum Ib. Among them, Ib is calculated by the following formula:
[0070]
[0071] In the formula, Ib0 represents the background spectrum monitoring value, σ represents the frequency of the background spectrum, and σ max , σ min represent the maximum and minimum values of the set measurement band range respectively, and the parameter values are: δ = 1.01, a = 0.9, b = 0.094; c = 1.0.
[0072] Differentiate the sample spectrum Is and the background spectrum Ib, and use the obtained differential spectrum I as the original spectrum. The spectral data includes sequentially decreasing wavenumber values and the absorbance values corresponding to each wavenumber.
[0073] The wavenumbers are numbered in descending order as natural numbers, and the absorbance values corresponding to each wavenumber form a spectral sequence, that is, the original spectral sequence of the sample is obtained. Figure 2 It is a spectral sequence diagram after numbering, which contains a drifting baseline and high-frequency spike noise.
[0074] The spectral sequence is smoothed and denoised. In this embodiment, the wavelet denoising method of db5 is adopted, which can well remove the spike noise. Figure 3 It is the spectral sequence Im after denoising.
[0075] The obtained spectral sequence Im is processed by frequency-domain segmentation. Wavelet packet decomposition is used to decompose the smoothed spectral sequence into a high-frequency part and a low-frequency part, and then reconstructed back into a time-domain signal. Among them, when performing wavelet packet decomposition, the input sampling frequency is 1024 Hz, and the decomposition level is 4 layers; in this embodiment, the wavelet packet coefficients used in the fourth layer are [42.0035, 44.3324, 2.6513, 4.9862, 0.3172, 0.3594, 1.4396, 0.5266].
[0076] The baseline of the low-frequency part is obtained by polynomial fitting of the spectral data of the low-frequency part; the original spectral sequence after smoothing is decomposed by wavelet packet decomposition to obtain the split spectral data of the low-frequency part and the high-frequency part. The data points included in the high-frequency spectrum are directly deleted in the smoothed spectral sequence, and the missing data points are supplemented by interpolation method to obtain the baseline of the high-frequency part.
[0077] The baseline of the whole spectrum is obtained by taking the weighted average of the baseline obtained from the low-frequency part and the baseline obtained from the high-frequency part. Among them, the weights of the high-frequency part and the weights of the low-frequency part are calculated by the following formulas respectively:
[0078]
[0079]
[0080] Among them, W H is the weight of the high-frequency part, E H is the energy value of the high-frequency part, W L is the weight of the low-frequency part, E L is the energy value of the low-frequency part, α is the high-frequency correction parameter, α = 0.6; β is the low-frequency correction parameter, β = 1.2. Figure 4 It is the spectral baseline obtained in this embodiment.
[0081] Subtract the baseline of the whole spectrum from the original smoothed spectrum, that is, complete the baseline correction. Figure 5 It is the spectral diagram after baseline correction in this embodiment.
[0082] After that, the principal components of the spectral data are extracted for subsequent quantitative analysis.
[0083] The present invention obtains the baseline of the smoothed spectral sequence and corrects the smoothed spectral sequence by using the baseline of the smoothed spectral sequence; this method does not require artificial setting of the threshold for high and low frequency decomposition, can effectively retain the characteristic information of the original spectrum, and overcomes the disadvantage of easily introducing additional noise when directly subtracting the low frequency component.
[0084] Although the embodiments of the present invention have been disclosed as above, it is not limited to the applications listed in the specification and embodiments. It can be fully applied to various fields suitable for the present invention. For those familiar with the field, additional modifications can be easily made. Therefore, without departing from the general concept defined by the claims and the equivalent scope, the present invention is not limited to the specific details and the illustrated and described examples here.
Claims
1. An infrared spectral data preprocessing method for detecting gaseous hydrocarbon components, characterized in that, It includes the following steps: Step 1: Obtain the original spectral sequence of the sample; Step 2: Perform smoothing and denoising processing on the original spectral sequence to obtain the smoothed spectral sequence; Step 3: Decompose the smoothed spectral sequence into a low-frequency part and a high-frequency part; Step 4: Obtain the low-frequency part baseline according to the spectral sequence data of the low-frequency part; Step 5: Eliminate the data of the high-frequency part in the smoothed spectral sequence, and then perform interpolation to supplement the data points at the eliminated positions to obtain the high-frequency part baseline; Step 6: Obtain the baseline of the smoothed spectral sequence according to the low-frequency part baseline and the high-frequency part baseline; Step 7: Use the baseline of the smoothed spectral sequence to correct the smoothed spectral sequence to obtain the preprocessed spectral sequence; In Step 1, obtaining the original spectral sequence of the sample includes the following steps: Step 1: Respectively obtain the sample infrared spectrum Is and the background infrared spectrum Ib; Among them, the measured background spectrum Ib has the same band range and resolution as the sample infrared spectrum Is; Step 2: Perform difference between the sample infrared spectrum Is and the background infrared spectrum Ib, and use the obtained difference spectrum as the original spectrum; Step 3: Number the data of the original spectrum in descending order of wavenumber to obtain the original spectral sequence; The background infrared spectrum is: Among them, Ib0 represents the background spectrum monitoring value, σ represents the frequency of the background spectrum, σ max , σ min respectively represent the maximum and minimum values of the set measurement band range, δ is the empirical correction coefficient, and a, b, and c are constant parameters respectively.
2. The infrared spectral data preprocessing method for detecting gaseous hydrocarbon components according to claim 1, wherein, In the step 1, the band range of the measured spectrum is 6000 cm -1 ~2000 cm -1 , and the resolution is 1 cm -1 .
3. The infrared spectral data preprocessing method for detecting gaseous hydrocarbon components according to claim 2, wherein In Step 2, the wavelet denoising method is used to perform smoothing and denoising processing on the original spectral sequence; Among them, the wavelet function used is the db function, and the decomposition level is 5 layers.
4. The infrared spectral data preprocessing method for detecting gaseous hydrocarbon components according to claim 2 or 3, characterized in that, In Step 3, the wavelet packet is used to decompose the smoothed spectral sequence; Among them, when performing wavelet packet decomposition, the sampling frequency is 1024Hz, and the decomposition level is 4 layers.
5. The infrared spectrum data preprocessing method for detecting gaseous hydrocarbon components according to claim 4, characterized in that, In Step 4, polynomial fitting is used for the spectral sequence data of the low-frequency part to obtain the low-frequency part baseline.
6. The infrared spectral data preprocessing method for detecting gaseous hydrocarbon components according to claim 5, characterized in that, In Step 6, the low-frequency part baseline and the high-frequency part baseline are averaged to obtain the baseline of the smoothed spectral sequence; Among them, weighted average is used when calculating the average of the baseline, where the weights of the high-frequency part and the low-frequency part are respectively: Among them, W H is the weight of the high-frequency part, E H is the energy value of the high-frequency part, W L is the weight of the low-frequency part, E L is the energy value of the low-frequency part, α is the high-frequency correction parameter, and β is the low-frequency correction parameter.
7. The infrared spectral data preprocessing method for detecting gaseous hydrocarbon components according to claim 6, characterized in that In Step 7, the smoothed spectral sequence is subtracted from the baseline of the smoothed spectral sequence to obtain the preprocessed spectral sequence.
Citation Information
Patent Citations
Automatic And Continuous Quantitative Analysis Method And Apparatus For Multiple Components
US20090242770A1
Single device for gas and flame detection, imaging and measurement, and drift correction method thereof
US20180045567A1