CN116933056B - Method and system for determining peak area of characteristic peak of Raman spectrum without subtracting Raman background - Google Patents
Method and system for determining peak area of characteristic peak of Raman spectrum without subtracting Raman background Download PDFInfo
- Publication number
- CN116933056B CN116933056B CN202310908925.5A CN202310908925A CN116933056B CN 116933056 B CN116933056 B CN 116933056B CN 202310908925 A CN202310908925 A CN 202310908925A CN 116933056 B CN116933056 B CN 116933056B
- Authority
- CN
- China
- Prior art keywords
- index
- raman
- peak
- characteristic peak
- points
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000001069 Raman spectroscopy Methods 0.000 title claims abstract description 233
- 238000001237 Raman spectrum Methods 0.000 title claims abstract description 86
- 238000000034 method Methods 0.000 title claims abstract description 80
- 238000004364 calculation method Methods 0.000 claims description 9
- 230000003595 spectral effect Effects 0.000 claims description 6
- 238000001514 detection method Methods 0.000 abstract description 19
- 238000001228 spectrum Methods 0.000 abstract description 8
- 238000004422 calculation algorithm Methods 0.000 abstract description 4
- 230000000694 effects Effects 0.000 abstract description 3
- 238000000605 extraction Methods 0.000 abstract description 2
- 230000006870 function Effects 0.000 description 58
- 238000002474 experimental method Methods 0.000 description 18
- 230000007423 decrease Effects 0.000 description 8
- 238000012360 testing method Methods 0.000 description 8
- 238000003491 array Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 238000006073 displacement reaction Methods 0.000 description 4
- 230000009286 beneficial effect Effects 0.000 description 3
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 2
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 2
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 2
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 2
- 239000000126 substance Substances 0.000 description 2
- 238000011410 subtraction method Methods 0.000 description 2
- 230000003044 adaptive effect Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 239000003344 environmental pollutant Substances 0.000 description 1
- 229910001385 heavy metal Inorganic materials 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000000447 pesticide residue Substances 0.000 description 1
- 231100000719 pollutant Toxicity 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000004445 quantitative analysis Methods 0.000 description 1
- 230000035945 sensitivity Effects 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 1
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N21/00—Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
- G01N21/62—Systems in which the material investigated is excited whereby it emits light or causes a change in wavelength of the incident light
- G01N21/63—Systems in which the material investigated is excited whereby it emits light or causes a change in wavelength of the incident light optically excited
- G01N21/65—Raman scattering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/213—Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N2201/00—Features of devices classified in G01N21/00
- G01N2201/12—Circuits of general importance; Signal processing
- G01N2201/129—Using chemometrical methods
Landscapes
- Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Data Mining & Analysis (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Health & Medical Sciences (AREA)
- Pathology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- General Health & Medical Sciences (AREA)
- Biochemistry (AREA)
- Analytical Chemistry (AREA)
- Chemical & Material Sciences (AREA)
- Artificial Intelligence (AREA)
- Immunology (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
- Spectrometry And Color Measurement (AREA)
Abstract
Description
技术领域Technical Field
本发明属于拉曼光谱检测及光谱数据特征提取技术领域,具体涉及一种无需扣除拉曼光谱背景干扰的特征峰峰面积计算方法及系统。The invention belongs to the technical field of Raman spectrum detection and spectrum data feature extraction, and in particular relates to a method and system for calculating the peak area of a characteristic peak without deducting the background interference of the Raman spectrum.
背景技术Background technique
拉曼光谱技术具有极高的检测灵敏度、简单快捷的检测流程、较低的检测成本、能够提供待测物质“指纹图谱”等优势,已经成为众多检测分析仪器的首选技术方案。拉曼光谱仪器已经在食品农药残留检测、水环境重金属离子检测、环境生物污染物检测等众多领域广泛应用。Raman spectroscopy has the advantages of extremely high detection sensitivity, simple and fast detection process, low detection cost, and the ability to provide a "fingerprint" of the substance to be tested. It has become the preferred technical solution for many detection and analysis instruments. Raman spectroscopy instruments have been widely used in many fields such as food pesticide residue detection, water environment heavy metal ion detection, and environmental biological pollutant detection.
拉曼光谱数据中包含待测物的指纹图谱信息,通过拉曼方法实现待测物的定性检测相对轻松;但实际检测需求不仅需要确认待测物的种类,更需要实现待测物的定量检测,这就需要从拉曼光谱中获取到与待测物浓度相关联的特征信息。现阶段,通过拉曼光谱技术实现待测物的定量检测,主要通过建立待测物拉曼光谱特征峰峰面积与物质浓度间的对应关系来实现。计算峰面积需要避免拉曼光谱的背景干扰,但实际获取的拉曼光谱均包含不可预测的背景信息,现有方法均无法直接计算拉曼光谱特征峰峰面积。目前计算拉曼光谱特征峰峰面积都是先通过各种方式扣除拉曼光谱的背景干扰,如多项式拟合、惩罚自适应偏最小二乘拟合等算法自动扣除光谱的背景信息或手动扣除光谱的背景信息,然后计算特征峰峰面积以实现定量检测。Raman spectroscopy data contains fingerprint information of the object to be tested, and it is relatively easy to achieve qualitative detection of the object to be tested by Raman method; however, the actual detection needs not only need to confirm the type of the object to be tested, but also need to achieve quantitative detection of the object to be tested, which requires obtaining characteristic information associated with the concentration of the object to be tested from the Raman spectrum. At present, the quantitative detection of the object to be tested by Raman spectroscopy technology is mainly achieved by establishing a corresponding relationship between the peak area of the characteristic peak of the Raman spectrum of the object to be tested and the concentration of the substance. The calculation of the peak area needs to avoid the background interference of the Raman spectrum, but the Raman spectrum actually obtained contains unpredictable background information, and the existing methods cannot directly calculate the peak area of the characteristic peak of the Raman spectrum. At present, the calculation of the peak area of the characteristic peak of the Raman spectrum is to first deduct the background interference of the Raman spectrum by various methods, such as polynomial fitting, penalized adaptive partial least squares fitting and other algorithms to automatically deduct the background information of the spectrum or manually deduct the background information of the spectrum, and then calculate the peak area of the characteristic peak to achieve quantitative detection.
但是,自动扣除背景干扰方法的效果差异较大、有时对于同一背景干扰采取的拟合参数却不一致;而手动扣除背景干扰方法受实验人员的主观因素影响太大,现有计算拉曼光谱特征峰峰面积的方法并不完全合理。因此,开发出一种不受拉曼光谱背景信息干扰、无需扣除背景即可计算特征峰峰面积的方法,对于提升拉曼光谱定量检测系统的稳定性和可靠性具有重要促进作用。However, the effects of the automatic background interference subtraction method vary greatly, and sometimes the fitting parameters for the same background interference are inconsistent; the manual background interference subtraction method is greatly affected by the subjective factors of the experimenter, and the existing method for calculating the peak area of the characteristic peak of the Raman spectrum is not completely reasonable. Therefore, the development of a method that is not interfered by the background information of the Raman spectrum and can calculate the peak area of the characteristic peak without subtracting the background is of great significance to improving the stability and reliability of the Raman spectroscopy quantitative detection system.
发明内容Summary of the invention
本发明的目的是解决现有基于拉曼方法定量检测系统中计算光谱特征峰峰面积时自动扣除背景算法效果存在差异大、参数不统一的问题,以及手动扣除背景主观因素影响大的问题,进而导致了结果准确性差的问题。The purpose of the present invention is to solve the problem that the automatic background subtraction algorithm has large differences and inconsistent parameters when calculating the peak area of spectral characteristic peaks in the existing Raman method-based quantitative detection system, and the manual background subtraction is greatly influenced by subjective factors, which leads to poor result accuracy.
无扣除拉曼背景确定拉曼光谱特征峰峰面积的方法,包括以下步骤:The method for determining the peak area of a characteristic peak of a Raman spectrum without subtracting the Raman background comprises the following steps:
步骤S1、计算特征峰的准确中心峰位信息:Step S1, calculating the accurate central peak position information of the characteristic peak:
首先,读取整条拉曼光谱数据,将raman shift和intensity分别存储在数组x、y中;raman shift即拉曼位移,intensity即拉曼强度;First, read the entire Raman spectrum data and store the raman shift and intensity in arrays x and y respectively; raman shift refers to Raman displacement and intensity refers to Raman intensity;
然后基于待提取特征峰拉曼频移、中心峰位寻找范围,确定中心峰位寻找范围序列长度内的拉曼强度最大值,作为待提取特征峰准确中心峰位,对应的索引值为中心峰位索引值center_peak_raman_shift_index;Then, based on the Raman frequency shift of the characteristic peak to be extracted and the center peak search range, the maximum Raman intensity within the center peak search range sequence length is determined as the accurate center peak position of the characteristic peak to be extracted, and the corresponding index value is the center peak index value center_peak_raman_shift_index;
步骤S2、基于设定的置信峰位比p值,计算特征峰两侧交点的准确坐标,所述交点为基于置信峰位比p值确定的参考点;计算特征峰两侧交点准确坐标的过程包括以下步骤:Step S2, based on the set confidence peak position ratio p value, calculate the exact coordinates of the intersection points on both sides of the characteristic peak, wherein the intersection points are reference points determined based on the confidence peak position ratio p value; the process of calculating the exact coordinates of the intersection points on both sides of the characteristic peak includes the following steps:
步骤S21、获取特征峰左右交点范围,即寻峰范围search_peak_length;Step S21, obtaining the left and right intersection range of the characteristic peak, that is, the peak search range search_peak_length;
步骤S22、设置左、右两交点索引值xlnum_index、xrnum_index的起始值等于步骤S1中确定的准确中心峰位索引值;Step S22, setting the starting values of the left and right intersection index values xlnum_index and xrnum_index to be equal to the accurate center peak index value determined in step S1;
步骤S23、基于中心峰位,分别向左、向右计算左右两交点的索引值:Step S23: Based on the center peak position, the index values of the left and right intersections are calculated respectively:
步骤S231、寻找左侧交点的序列长度为search_peak_length/2;Step S231, the length of the sequence for finding the left intersection point is search_peak_length/2;
当y[xlnum_index]>(1-p)*y[center_peak_raman_shift_index]时,左交点x[xlnum_index]每向左移动一个步长,即索引值减1,判断此时的x[xlnum_index]是否在左侧交点的序列长度范围内,如在范围内,则继续向左移动寻找交点;When y[xlnum_index]>(1-p)*y[center_peak_raman_shift_index], the left intersection point x[xlnum_index] moves one step to the left, that is, the index value decreases by 1, and it is determined whether x[xlnum_index] is within the sequence length range of the left intersection point. If it is within the range, it continues to move to the left to find the intersection point;
其中,x[xlnum_index]表示索引xlnum_index处对应的拉曼频移,y[xlnum_index]表示索引xlnum_index处对应的拉曼强度,y[center_peak_raman_shift_index]表示索引center_peak_raman_shift_index处对应的拉曼强度;Among them, x[xlnum_index] represents the Raman frequency shift corresponding to the index xlnum_index, y[xlnum_index] represents the Raman intensity corresponding to the index xlnum_index, and y[center_peak_raman_shift_index] represents the Raman intensity corresponding to the index center_peak_raman_shift_index;
当y[xlnum_index]<=(1-p)*y[center_peak_raman_shift_index]或此刻的x[xlnum_index]已经超过左侧交点的序列长度范围,则停止,此时的xlnum_index为左交点索引值;When y[xlnum_index]<=(1-p)*y[center_peak_raman_shift_index] or x[xlnum_index] at this moment has exceeded the sequence length range of the left intersection, stop, and xlnum_index at this moment is the index value of the left intersection;
步骤S232、寻找右侧交点的序列长度为search_peak_length/2;Step S232, the length of the sequence for finding the right intersection point is search_peak_length/2;
当y[xrnum_index]>(1-p)*y[center_peak_raman_shift_index]时,右交点x[xrnum_index]每向右移动一个步长,即索引值加1,判断此时的x[xrnum_index]是否在右侧交点的序列长度范围内,如在范围内,则继续向右移动寻找交点;When y[xrnum_index]>(1-p)*y[center_peak_raman_shift_index], the right intersection point x[xrnum_index] moves one step to the right, that is, the index value is increased by 1, and it is judged whether x[xrnum_index] at this time is within the sequence length range of the right intersection point. If it is within the range, it continues to move to the right to find the intersection point;
当y[xrnum_index]<=(1-p)*y[center_peak_raman_shift_index]或此刻的x[xrnum_index]已经超过右侧交点的序列长度范围,则停止,此时的xrnum_index为右交点的索引值;When y[xrnum_index]<=(1-p)*y[center_peak_raman_shift_index] or x[xrnum_index] at this moment has exceeded the sequence length range of the right intersection, stop, and xrnum_index at this moment is the index value of the right intersection;
步骤S3、基于特征峰两侧交点计算特征峰两侧切点的准确坐标,具体过程包括以下步骤:Step S3, calculating the accurate coordinates of the tangent points on both sides of the characteristic peak based on the intersection points on both sides of the characteristic peak, the specific process includes the following steps:
步骤S31、计算中心峰位与两交点间的水平距离△xL、△xR;Step S31, calculating the horizontal distances △x L and △x R between the central peak and the two intersection points;
步骤S32、左、右切点坐标索引值xllnum_index、xrrnum_index的起始值分别等于xlnum_index、xrnum_index;左、右切点为计算拉曼光谱特征峰峰面积的左右端点;Step S32, the starting values of the left and right tangent point coordinate index values xllnum_index and xrrnum_index are respectively equal to xlnum_index and xrnum_index; the left and right tangent points are the left and right endpoints for calculating the peak area of the characteristic peak of the Raman spectrum;
步骤S33、左切点x[xllnum_index]每次向左移动一个步长,即索引值减1,当x[xllnum_index]=x[center_peak_raman_shift_index]-(1/p)*△xL时,找到特征峰左侧切点索引值xllnum_index;Step S33, the left tangent point x[xllnum_index] moves to the left by one step each time, that is, the index value decreases by 1, and when x[xllnum_index]=x[center_peak_raman_shift_index]-(1/p)*△x L , the index value xllnum_index of the left tangent point of the characteristic peak is found;
步骤S34、右切点x[xrrnum_index]每次向右移动一个步长,即索引值加1,当x[xrrnum_index]=x[center_peak_raman_shift_index]+(1/p)*△xR时,找到特征峰右侧切点索引值xrrnum_index;Step S34, the right tangent point x[xrrnum_index] moves rightward by one step each time, that is, the index value is increased by 1, and when x[xrrnum_index]=x[center_peak_raman_shift_index]+(1/p)*△x R , the right tangent point index value xrrnum_index of the characteristic peak is found;
步骤S35、左右两切点的坐标分别为(x[xllnum_index],y[xllnum_index]),(x[xrrnum_index],y[xrrnum_index]);Step S35, the coordinates of the left and right tangent points are (x[xllnum_index], y[xllnum_index]), (x[xrrnum_index], y[xrrnum_index]);
步骤S4、基于左右两切点的坐标计算拉曼特征峰与两切点连线围成区域的面积。Step S4: Calculate the area of the region enclosed by the Raman characteristic peak and the line connecting the two tangent points based on the coordinates of the left and right tangent points.
进一步地,确定中心峰位寻找范围序列长度内拉曼强度最大值的过程包括以下步骤:Further, the process of determining the central peak position and finding the maximum Raman intensity within the range sequence length includes the following steps:
首先,获取raman shift的步长divis,然后按照步长divis在中心峰位寻找范围序列长度内确定拉曼强度最大值,作为待提取特征峰准确中心峰位。First, the step length divis of the Raman shift is obtained, and then the maximum Raman intensity is determined within the sequence length of the central peak position search range according to the step length divis, which is used as the accurate central peak position of the characteristic peak to be extracted.
进一步地,基于左右两切点的坐标计算拉曼特征峰与两切点连线围成区域的面积的过程包括以下步骤:Furthermore, the process of calculating the area of the region enclosed by the Raman characteristic peak and the line connecting the two tangent points based on the coordinates of the left and right tangent points includes the following steps:
步骤S41、以特征峰左切点为起点,相邻两点的拉曼强度值y[xllnum_index]、y[xllnum_index+1]为上下底,以拉曼步长为高,计算每个小梯形的面积,直至到达右切点截止,小梯形的面积和记为S总;Step S41, taking the left tangent point of the characteristic peak as the starting point, the Raman intensity values y[xllnum_index] and y[xllnum_index+1] of two adjacent points as the upper and lower bases, and the Raman step length as the height, calculate the area of each small trapezoid until the right tangent point is reached, and the sum of the areas of the small trapezoids is recorded as Stotal;
步骤S42、基于特征峰左右两切点确定拉曼背景的面积S背;Step S42, determining the area Sback of the Raman background based on the left and right tangent points of the characteristic peak;
步骤S43、S总减去S背得到的面积,即为拉曼特征峰的峰面积。Step S43, the area obtained by subtracting Sback from Stotal is the peak area of the Raman characteristic peak.
进一步地,基于特征峰左右两切点确定拉曼背景的面积S背的过程包括以下步骤:Further, the process of determining the area Sback of the Raman background based on the left and right tangent points of the characteristic peak includes the following steps:
以特征峰左右两切点的拉曼强度值y[xllnum_index]、y[xrrnum_index]为上下底,两切点的水平距离为高,计算梯形的面积记为S背,也就是拉曼背景的面积。Taking the Raman intensity values y[xllnum_index] and y[xrrnum_index] of the left and right tangent points of the characteristic peak as the upper and lower bases, and the horizontal distance between the two tangent points as the height, the area of the trapezoid is calculated and recorded as Sback , which is the area of the Raman background.
无扣除拉曼背景确定拉曼光谱特征峰峰面积的系统,包括:A system for determining the peak area of characteristic peaks in Raman spectra without subtracting Raman background, including:
中心峰位信息确定单元:用于计算特征峰的准确中心峰位信息,具体过程包括以下步骤:Central peak position information determination unit: used to calculate the accurate central peak position information of the characteristic peak, the specific process includes the following steps:
首先,读取整条拉曼光谱数据,将raman shift和intensity分别存储在数组x、y中;raman shift即拉曼位移,intensity即拉曼强度;First, read the entire Raman spectrum data and store the raman shift and intensity in arrays x and y respectively; raman shift refers to Raman displacement and intensity refers to Raman intensity;
然后基于待提取特征峰拉曼频移、中心峰位寻找范围,确定中心峰位寻找范围序列长度内的拉曼强度最大值,作为待提取特征峰准确中心峰位,对应的索引值为中心峰位索引值center_peak_raman_shift_index;Then, based on the Raman frequency shift of the characteristic peak to be extracted and the center peak search range, the maximum Raman intensity within the center peak search range sequence length is determined as the accurate center peak position of the characteristic peak to be extracted, and the corresponding index value is the center peak index value center_peak_raman_shift_index;
特征峰两侧交点确定单元:基于设定的置信峰位比p值,计算特征峰两侧交点的准确坐标,所述交点为基于置信峰位比p值确定的参考点;计算特征峰两侧交点准确坐标的过程包括以下步骤:The intersection point determination unit on both sides of the characteristic peak: based on the set confidence peak position ratio p value, calculates the accurate coordinates of the intersection points on both sides of the characteristic peak, wherein the intersection points are reference points determined based on the confidence peak position ratio p value; the process of calculating the accurate coordinates of the intersection points on both sides of the characteristic peak includes the following steps:
步骤S21、获取特征峰左右交点范围,即寻峰范围search_peak_length;Step S21, obtaining the left and right intersection range of the characteristic peak, that is, the peak search range search_peak_length;
步骤S22、设置左、右两交点索引值xlnum_index、xrnum_index的起始值等于准确中心峰位索引值;Step S22, setting the starting values of the left and right intersection index values xlnum_index and xrnum_index to be equal to the accurate center peak index value;
步骤S23、基于中心峰位,分别向左、向右计算左右两交点的索引值:Step S23: Based on the center peak position, the index values of the left and right intersections are calculated respectively:
步骤S231、寻找左侧交点的序列长度为search_peak_length/2;Step S231, the length of the sequence for finding the left intersection point is search_peak_length/2;
当y[xlnum_index]>(1-p)*y[center_peak_raman_shift_index]时,左交点x[xlnum_index]每向左移动一个步长,即索引值减1,判断此时的x[xlnum_index]是否在左侧交点的序列长度范围内,如在范围内,则继续向左移动寻找交点;When y[xlnum_index]>(1-p)*y[center_peak_raman_shift_index], the left intersection point x[xlnum_index] moves one step to the left, that is, the index value decreases by 1, and it is determined whether x[xlnum_index] is within the sequence length range of the left intersection point. If it is within the range, it continues to move to the left to find the intersection point;
其中,x[xlnum_index]表示索引xlnum_index处对应的拉曼频移,y[xlnum_index]表示索引xlnum_index处对应的拉曼强度,y[center_peak_raman_shift_index]表示索引center_peak_raman_shift_index处对应的拉曼强度;Among them, x[xlnum_index] represents the Raman frequency shift corresponding to the index xlnum_index, y[xlnum_index] represents the Raman intensity corresponding to the index xlnum_index, and y[center_peak_raman_shift_index] represents the Raman intensity corresponding to the index center_peak_raman_shift_index;
当y[xlnum_index]<=(1-p)*y[center_peak_raman_shift_index]或此刻的x[xlnum_index]已经超过左侧交点的序列长度范围,则停止,此时的xlnum_index为左交点索引值;When y[xlnum_index]<=(1-p)*y[center_peak_raman_shift_index] or x[xlnum_index] at this moment has exceeded the sequence length range of the left intersection, stop, and xlnum_index at this moment is the index value of the left intersection;
步骤S232、寻找右侧交点的序列长度为search_peak_length/2;Step S232, the length of the sequence for finding the right intersection point is search_peak_length/2;
当y[xrnum_index]>(1-p)*y[center_peak_raman_shift_index]时,右交点x[xrnum_index]每向右移动一个步长,即索引值加1,判断此时的x[xrnum_index]是否在右侧交点的序列长度范围内,如在范围内,则继续向右移动寻找交点;When y[xrnum_index]>(1-p)*y[center_peak_raman_shift_index], the right intersection point x[xrnum_index] moves one step to the right, that is, the index value is increased by 1, and it is judged whether x[xrnum_index] at this time is within the sequence length range of the right intersection point. If it is within the range, it continues to move to the right to find the intersection point;
当y[xrnum_index]<=(1-p)*y[center_peak_raman_shift_index]或此刻的x[xrnum_index]已经超过右侧交点的序列长度范围,则停止,此时的xrnum_index为右交点的索引值;When y[xrnum_index]<=(1-p)*y[center_peak_raman_shift_index] or x[xrnum_index] at this moment has exceeded the sequence length range of the right intersection, stop, and xrnum_index at this moment is the index value of the right intersection;
特征峰两侧切点确定单元:基于特征峰两侧交点计算特征峰两侧切点的准确坐标,具体过程包括以下步骤:Characteristic peak two-side tangent point determination unit: based on the intersection points on both sides of the characteristic peak, the accurate coordinates of the tangent points on both sides of the characteristic peak are calculated. The specific process includes the following steps:
步骤S31、计算中心峰位与两交点间的水平距离△xL、△xR;Step S31, calculating the horizontal distances △x L and △x R between the central peak and the two intersection points;
步骤S32、左、右切点坐标索引值xllnum_index、xrrnum_index的起始值分别等于xlnum_index、xrnum_index;左、右切点为计算拉曼光谱特征峰峰面积的左右端点;Step S32, the starting values of the left and right tangent point coordinate index values xllnum_index and xrrnum_index are respectively equal to xlnum_index and xrnum_index; the left and right tangent points are the left and right endpoints for calculating the peak area of the characteristic peak of the Raman spectrum;
步骤S33、左切点x[xllnum_index]每次向左移动一个步长,即索引值减1,当x[xllnum_index]=x[center_peak_raman_shift_index]-(1/p)*△xL时,找到特征峰左侧切点索引值xllnum_index;Step S33, the left tangent point x[xllnum_index] moves to the left by one step each time, that is, the index value decreases by 1, and when x[xllnum_index]=x[center_peak_raman_shift_index]-(1/p)*△x L , the index value xllnum_index of the left tangent point of the characteristic peak is found;
步骤S34、右切点x[xrrnum_index]每次向右移动一个步长,即索引值加1,当x[xrrnum_index]=x[center_peak_raman_shift_index]+(1/p)*△xR时,找到特征峰右侧切点索引值xrrnum_index;Step S34, the right tangent point x[xrrnum_index] moves rightward by one step each time, that is, the index value is increased by 1, and when x[xrrnum_index]=x[center_peak_raman_shift_index]+(1/p)*△x R , the right tangent point index value xrrnum_index of the characteristic peak is found;
步骤S35、左右两切点的坐标分别为(x[xllnum_index],y[xllnum_index]),(x[xrrnum_index],y[xrrnum_index]);Step S35, the coordinates of the left and right tangent points are (x[xllnum_index], y[xllnum_index]), (x[xrrnum_index], y[xrrnum_index]);
拉曼特征峰峰面积计算单元:基于左右两切点的坐标计算拉曼特征峰与两切点连线围成区域的面积。Raman characteristic peak area calculation unit: calculates the area of the region enclosed by the Raman characteristic peak and the line connecting the two tangent points based on the coordinates of the left and right tangent points.
进一步地,确定中心峰位寻找范围序列长度内拉曼强度最大值的过程包括以下步骤:Further, the process of determining the central peak position and finding the maximum Raman intensity within the range sequence length includes the following steps:
首先,获取raman shift的步长divis,然后按照步长divis在中心峰位寻找范围序列长度内确定拉曼强度最大值,作为待提取特征峰准确中心峰位。First, the step length divis of the Raman shift is obtained, and then the maximum Raman intensity is determined within the sequence length of the central peak position search range according to the step length divis, which is used as the accurate central peak position of the characteristic peak to be extracted.
进一步地,基于左右两切点的坐标计算拉曼特征峰与两切点连线围成区域的面积的过程包括以下步骤:Furthermore, the process of calculating the area of the region enclosed by the Raman characteristic peak and the line connecting the two tangent points based on the coordinates of the left and right tangent points includes the following steps:
步骤S41、以特征峰左切点为起点,相邻两点的拉曼强度值y[xllnum_index]、y[xllnum_index+1]为上下底,以拉曼步长为高,计算每个小梯形的面积,直至到达右切点截止,小梯形的面积和记为S总;Step S41, taking the left tangent point of the characteristic peak as the starting point, the Raman intensity values y[xllnum_index] and y[xllnum_index+1] of two adjacent points as the upper and lower bases, and the Raman step length as the height, calculate the area of each small trapezoid until the right tangent point is reached, and the sum of the areas of the small trapezoids is recorded as Stotal;
步骤S42、基于特征峰左右两切点确定拉曼背景的面积S背;Step S42, determining the area Sback of the Raman background based on the left and right tangent points of the characteristic peak;
步骤S43、S总减去S背得到的面积,即为拉曼特征峰的峰面积。Step S43, the area obtained by subtracting Sback from Stotal is the peak area of the Raman characteristic peak.
进一步地,基于特征峰左右两切点确定拉曼背景的面积S背的过程包括以下步骤:Further, the process of determining the area Sback of the Raman background based on the left and right tangent points of the characteristic peak includes the following steps:
以特征峰左右两切点的拉曼强度值y[xllnum_index]、y[xrrnum_index]为上下底,两切点的水平距离为高,计算梯形的面积记为S背,也就是拉曼背景的面积。Taking the Raman intensity values y[xllnum_index] and y[xrrnum_index] of the left and right tangent points of the characteristic peak as the upper and lower bases, and the horizontal distance between the two tangent points as the height, the area of the trapezoid is calculated and recorded as Sback , which is the area of the Raman background.
一种计算机存储介质,所述存储介质中存储有至少一条指令,所述至少一条指令由处理器加载并执行以实现所述的无扣除拉曼背景确定拉曼光谱特征峰峰面积的方法。A computer storage medium stores at least one instruction, which is loaded and executed by a processor to implement the method for determining the peak area of a characteristic peak of a Raman spectrum without subtracting the Raman background.
一种无扣除拉曼背景确定拉曼光谱特征峰峰面积的设备,所述设备包括处理器和存储器,所述存储器中存储有至少一条指令,所述至少一条指令由处理器加载并执行以实现所述的无扣除拉曼背景确定拉曼光谱特征峰峰面积的方法。A device for determining the peak area of a characteristic peak of a Raman spectrum without subtracting the Raman background, the device comprising a processor and a memory, the memory storing at least one instruction, the at least one instruction being loaded and executed by the processor to implement the method for determining the peak area of a characteristic peak of a Raman spectrum without subtracting the Raman background.
本发明的有益效果:Beneficial effects of the present invention:
一、本发明方法在自动计算拉曼光谱特征峰峰面积的过程中,无需扣除拉曼光谱的背景信息。与现有计算拉曼特征峰峰面积方法相比,避免了自动扣除背景算法效果差异大、参数不统一,手动扣除背景主观因素影响大的问题。1. In the process of automatically calculating the peak area of the characteristic peak of the Raman spectrum, the method of the present invention does not need to deduct the background information of the Raman spectrum. Compared with the existing method for calculating the peak area of the characteristic peak of the Raman spectrum, it avoids the problems of large differences in the effect of the automatic background deduction algorithm, inconsistent parameters, and large influence of subjective factors on manual background deduction.
二、本发明方法引入置信峰位比和交点范围两个可优化参数,保证了计算拉曼峰面积的精确性。在不同背景函数参数、不同背景函数组合的干扰下,对于不同半峰宽、不同强度的拉曼特征峰,计算得到的有背景与无背景特征面积比变化低于5%。Second, the method of the present invention introduces two optimizable parameters, namely, the confidence peak position ratio and the intersection range, to ensure the accuracy of calculating the Raman peak area. Under the interference of different background function parameters and different background function combinations, for Raman characteristic peaks of different half-peak widths and different intensities, the calculated characteristic area ratio with background and without background changes less than 5%.
三、本发明方法可在不改变拉曼仪器的基础上,提高拉曼检测系统定量分析的稳定性和可靠性。3. The method of the present invention can improve the stability and reliability of quantitative analysis of the Raman detection system without changing the Raman instrument.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为无扣除拉曼背景确定拉曼光谱特征峰峰面积的方法示意图。FIG. 1 is a schematic diagram of a method for determining the peak area of a characteristic peak of a Raman spectrum without subtracting the Raman background.
图2为本发明试验一背景强度小于拉曼信号强度的情况下,无背景模拟拉曼光谱谱图及Gaussian函数、Sigmoid函数、Exponential函数、Ploynomial函数四种背景同时叠加的模拟拉曼光谱谱图;图中圆点为本发明计算得到的特征峰准确中心峰位、两侧交点、两侧切点位置。FIG2 is a simulated Raman spectrum without background and a simulated Raman spectrum with four backgrounds, namely, Gaussian function, Sigmoid function, Exponential function and Ploynomial function, superimposed simultaneously, in the case where the background intensity is less than the Raman signal intensity in the first experiment of the present invention; the dots in the figure are the accurate central peak position, intersection points on both sides and tangent points on both sides of the characteristic peak calculated by the present invention.
图3为本发明试验二背景强度大于拉曼信号强度的情况下,无背景模拟拉曼光谱谱图及Gaussian函数、Sigmoid函数、Exponential函数、Ploynomial函数四种背景同时叠加的模拟拉曼光谱谱图;图中圆点为本发明计算得到的特征峰准确中心峰位、两侧交点、两侧切点位置。FIG3 is a simulated Raman spectrum without background and a simulated Raman spectrum with four backgrounds, namely, Gaussian function, Sigmoid function, Exponential function and Ploynomial function, superimposed simultaneously, when the background intensity is greater than the Raman signal intensity in Experiment 2 of the present invention; the dots in the figure are the accurate central peak position, intersection points on both sides and tangent points on both sides of the characteristic peak calculated by the present invention.
图4为本发明试验三背景强度与部分拉曼信号强度相当且大于其余部分拉曼信号强度的情况下,无背景模拟拉曼光谱谱图及Gaussian函数、Sigmoid函数、Exponential函数、Ploynomial函数四种背景同时叠加的模拟拉曼光谱谱图;图中圆点为本发明计算得到的特征峰准确中心峰位、两侧交点、两侧切点位置。FIG4 shows a simulated Raman spectrum without background and a simulated Raman spectrum with four backgrounds, namely, Gaussian function, Sigmoid function, Exponential function and Ploynomial function, superimposed simultaneously, when the background intensity of Experiment 3 of the present invention is equivalent to the intensity of some Raman signals and greater than the intensity of the remaining Raman signals; the dots in the figure are the accurate central peak position, intersection points on both sides and tangent points on both sides of the characteristic peak calculated by the present invention.
具体实施方式Detailed ways
本发明首先根据输入的待提取特征峰峰位,计算待提取特征峰的准确中心峰位坐标;然后根据输入的置信峰位比、左右交点寻找范围序列长度参数,计算得到左右交点坐标值;进一步地,计算得到待提取特征峰左右两切点坐标;最后,计算两切点连线与拉曼特征峰围成区域的面积,即完成了特征峰峰面积的计算。The present invention first calculates the accurate central peak position coordinates of the characteristic peak to be extracted according to the input peak position of the characteristic peak to be extracted; then calculates the coordinate values of the left and right intersections according to the input confidence peak position ratio and the left and right intersection search range sequence length parameters; further, calculates the coordinates of the left and right tangent points of the characteristic peak to be extracted; finally, calculates the area of the region enclosed by the line connecting the two tangent points and the Raman characteristic peak, thereby completing the calculation of the peak area of the characteristic peak.
经过验证,本发明方法对于不同类型、不同参数背景组合干扰的拉曼光谱信号,提取到的有背景与无背景特征面积比变化低于5%。It has been verified that for Raman spectral signals with different types and different parameter background combinations, the ratio of feature areas with and without background extracted by the method of the present invention varies by less than 5%.
下面结合附图和具体实施方式对本发明作进一步说明,以下实施例用于说明本发明,但不用于限制本发明的范围。The present invention will be further described below in conjunction with the accompanying drawings and specific implementation methods. The following examples are used to illustrate the present invention but are not used to limit the scope of the present invention.
具体实施方式一:结合图1说明本实施方式,Specific implementation method 1: This implementation method is described in conjunction with Figure 1.
本实施方式为无扣除拉曼背景确定拉曼光谱特征峰峰面积的方法,包括以下步骤:This embodiment is a method for determining the peak area of a characteristic peak of a Raman spectrum without subtracting the Raman background, comprising the following steps:
步骤S1、计算特征峰的准确中心峰位信息:Step S1, calculating the accurate central peak position information of the characteristic peak:
步骤S11、读取整条拉曼光谱数据,将raman shift和intensity分别存储在数组x、y中;raman shift即拉曼位移,intensity即拉曼强度;Step S11, read the entire Raman spectrum data, and store the raman shift and intensity in arrays x and y respectively; raman shift refers to the Raman displacement, and intensity refers to the Raman intensity;
步骤S12、确定待提取特征峰拉曼频移、中心峰位寻找范围;Step S12, determining the Raman frequency shift of the characteristic peak to be extracted and the search range of the central peak position;
步骤S13、基于待提取特征峰拉曼频移、中心峰位寻找范围,确定中心峰位寻找范围序列长度内的拉曼强度最大值,作为待提取特征峰准确中心峰位,对应的索引值为中心峰位索引值center_peak_raman_shift_index;Step S13, based on the Raman frequency shift of the characteristic peak to be extracted and the center peak search range, determine the maximum Raman intensity within the center peak search range sequence length as the accurate center peak position of the characteristic peak to be extracted, and the corresponding index value is the center peak index value center_peak_raman_shift_index;
确定中心峰位寻找范围序列长度内拉曼强度最大值的过程包括以下步骤:The process of determining the central peak position and finding the maximum Raman intensity within the range sequence length includes the following steps:
首先,获取raman shift的步长divis,然后按照步长divis在中心峰位寻找范围序列长度内确定拉曼强度最大值,作为待提取特征峰准确中心峰位。First, the step length divis of the Raman shift is obtained, and then the maximum Raman intensity is determined within the sequence length of the central peak position search range according to the step length divis, which is used as the accurate central peak position of the characteristic peak to be extracted.
步骤S2、基于设定的置信峰位比p值,计算特征峰两侧交点的准确坐标,所述交点为基于置信峰位比p值确定的参考点;计算特征峰两侧交点准确坐标的过程包括以下步骤:Step S2, based on the set confidence peak position ratio p value, calculate the exact coordinates of the intersection points on both sides of the characteristic peak, wherein the intersection points are reference points determined based on the confidence peak position ratio p value; the process of calculating the exact coordinates of the intersection points on both sides of the characteristic peak includes the following steps:
步骤S21、获取特征峰左右交点范围,即寻峰范围search_peak_length;Step S21, obtaining the left and right intersection range of the characteristic peak, that is, the peak search range search_peak_length;
步骤S22、设置左、右两交点索引值xlnum_index、xrnum_index的起始值等于准确中心峰位索引值;Step S22, setting the starting values of the left and right intersection index values xlnum_index and xrnum_index to be equal to the accurate center peak index value;
步骤S23、基于中心峰位,分别向左、向右计算左右两交点的索引值:Step S23: Based on the center peak position, the index values of the left and right intersections are calculated respectively:
步骤S231、寻找左侧交点的序列长度为search_peak_length/2,即寻峰范围的一半,当y[xlnum_index]>(1-p)*y[center_peak_raman_shift_index]时,左交点x[xlnum_index]每向左移动一个步长,即索引值减1,判断此时的x[xlnum_index]是否在左侧交点的序列长度范围内,如在范围内,则继续向左移动寻找交点。Step S231, the sequence length for finding the left intersection is search_peak_length/2, that is, half of the peak search range. When y[xlnum_index]>(1-p)*y[center_peak_raman_shift_index], the left intersection x[xlnum_index] moves one step to the left, that is, the index value is reduced by 1, and it is determined whether x[xlnum_index] at this time is within the sequence length range of the left intersection. If it is within the range, continue to move left to find the intersection.
其中,x[xlnum_index]表示索引xlnum_index处对应的拉曼频移,y[xlnum_index]表示索引xlnum_index处对应的拉曼强度,同样的y[center_peak_raman_shift_index]表示索引center_peak_raman_shift_index处对应的拉曼强度;Among them, x[xlnum_index] represents the Raman frequency shift corresponding to the index xlnum_index, y[xlnum_index] represents the Raman intensity corresponding to the index xlnum_index, and similarly y[center_peak_raman_shift_index] represents the Raman intensity corresponding to the index center_peak_raman_shift_index;
索引值是拉曼光谱横纵坐标的一个映射(类似于计算机的寻址),与坐标值一一对应,索引值加/减1,则横坐标对应右/左移一个步长,调整索引值可以同时控制横、纵坐标,索引值与横纵坐标的关系可通过如下例子进行理解:The index value is a mapping of the horizontal and vertical coordinates of the Raman spectrum (similar to computer addressing), which corresponds to the coordinate value one by one. If the index value is added/subtracted by 1, the horizontal coordinate will move right/left by one step. Adjusting the index value can control the horizontal and vertical coordinates at the same time. The relationship between the index value and the horizontal and vertical coordinates can be understood through the following example:
横坐标Raman shift:400、401、402、403、404、405Horizontal axis Raman shift: 400, 401, 402, 403, 404, 405
纵坐标Raman intensity:50、70、90、100、120、150Vertical axis Raman intensity: 50, 70, 90, 100, 120, 150
索引Index:1、2、3、4、5、6Index: 1, 2, 3, 4, 5, 6
当前横坐标x[3]=402,对应的y[3]=90;当向右移动一个步长时,即索引值为3+1=4,那么一定有x[4]=403,对应的y[4]=100。The current horizontal coordinate is x[3]=402, and the corresponding y[3]=90; when moving one step to the right, that is, the index value is 3+1=4, then x[4]=403 must be present, and the corresponding y[4]=100.
当y[xlnum_index]<=(1-p)*y[center_peak_raman_shift_index]或此刻的x[xlnum_index]已经超过左侧交点的序列长度范围,则停止,此时的xlnum_index为左交点索引值;When y[xlnum_index]<=(1-p)*y[center_peak_raman_shift_index] or x[xlnum_index] at this moment has exceeded the sequence length range of the left intersection, stop, and xlnum_index at this moment is the index value of the left intersection;
步骤S232、寻找右侧交点的序列长度为search_peak_length/2,即寻峰范围的一半,当y[xrnum_index]>(1-p)*y[center_peak_raman_shift_index]时,右交点x[xrnum_index]每向右移动一个步长,即索引值加1,判断此时的x[xrnum_index]是否在右侧交点的序列长度范围内,如在范围内,则继续向右移动寻找交点。Step S232, the sequence length for finding the right intersection is search_peak_length/2, which is half of the peak search range. When y[xrnum_index]>(1-p)*y[center_peak_raman_shift_index], the right intersection x[xrnum_index] moves one step to the right, that is, the index value is increased by 1, and it is determined whether x[xrnum_index] at this time is within the sequence length range of the right intersection. If so, continue to move right to find the intersection.
当y[xrnum_index]<=(1-p)*y[center_peak_raman_shift_index]或此刻的x[xrnum_index]已经超过右侧交点的序列长度范围,则停止,此时的xrnum_index为右交点的索引值。When y[xrnum_index]<=(1-p)*y[center_peak_raman_shift_index] or x[xrnum_index] at this moment has exceeded the sequence length range of the right intersection, stop, and xrnum_index at this moment is the index value of the right intersection.
步骤S3、计算特征峰两侧切点的准确坐标:Step S3, calculate the exact coordinates of the tangent points on both sides of the characteristic peak:
步骤S31、计算中心峰位与两交点间的水平距离△xL、△xR;Step S31, calculating the horizontal distances △x L and △x R between the central peak and the two intersection points;
步骤S32、左、右切点坐标索引值xllnum_index、xrrnum_index的起始值分别等于xlnum_index、xrnum_index;左、右切点为计算拉曼光谱特征峰峰面积的左右端点;Step S32, the starting values of the left and right tangent point coordinate index values xllnum_index and xrrnum_index are respectively equal to xlnum_index and xrnum_index; the left and right tangent points are the left and right endpoints for calculating the peak area of the characteristic peak of the Raman spectrum;
步骤S33、左切点x[xllnum_index]每次向左移动一个步长,即索引值减1,当x[xllnum_index]=x[center_peak_raman_shift_index]-(1/p)*△xL时,找到特征峰左侧切点索引值xllnum_index;Step S33, the left tangent point x[xllnum_index] moves to the left by one step each time, that is, the index value decreases by 1, and when x[xllnum_index]=x[center_peak_raman_shift_index]-(1/p)*△x L , the index value xllnum_index of the left tangent point of the characteristic peak is found;
步骤S34、右切点x[xrrnum_index]每次向右移动一个步长,即索引值加1,当x[xrrnum_index]=x[center_peak_raman_shift_index]+(1/p)*△xR时,找到特征峰右侧切点索引值xrrnum_index;Step S34, the right tangent point x[xrrnum_index] moves rightward by one step each time, that is, the index value is increased by 1, and when x[xrrnum_index]=x[center_peak_raman_shift_index]+(1/p)*△x R , the right tangent point index value xrrnum_index of the characteristic peak is found;
步骤S35、左右两切点的坐标分别为(x[xllnum_index],y[xllnum_index]),(x[xrrnum_index],y[xrrnum_index])。Step S35, the coordinates of the left and right tangent points are (x[xllnum_index], y[xllnum_index]), (x[xrrnum_index], y[xrrnum_index]) respectively.
步骤S4、计算拉曼特征峰与两切点连线围成区域的面积:Step S4, calculating the area of the region enclosed by the Raman characteristic peak and the line connecting the two tangent points:
步骤S41、以特征峰左切点为起点,相邻两点的拉曼强度值y[xllnum_index]、y[xllnum_index+1]为上下底,以拉曼步长为高,计算每个小梯形的面积,直至到达右切点截止,小梯形的面积和记为S总;Step S41, taking the left tangent point of the characteristic peak as the starting point, the Raman intensity values y[xllnum_index] and y[xllnum_index+1] of two adjacent points as the upper and lower bases, and the Raman step length as the height, calculate the area of each small trapezoid until the right tangent point is reached, and the sum of the areas of the small trapezoids is recorded as Stotal;
步骤S42、以特征峰左右两切点的拉曼强度值y[xllnum_index]、y[xrrnum_index]为上下底,两切点的水平距离为高,计算梯形的面积记为S背,也就是拉曼背景的面积;Step S42, taking the Raman intensity values y[xllnum_index] and y[xrrnum_index] of the left and right tangent points of the characteristic peak as the upper and lower bases, and the horizontal distance between the two tangent points as the height, the area of the trapezoid is calculated and recorded as Sback , that is, the area of the Raman background;
步骤S43、S总减去S背得到的面积,即为拉曼特征峰的峰面积。Step S43, the area obtained by subtracting Sback from Stotal is the peak area of the Raman characteristic peak.
需要说明的是,本发明无扣除拉曼背景确定拉曼光谱特征峰峰面积的方法中的无扣除拉曼背景是指相对现有的拉曼光谱特征峰峰面积计算方法中需要预先扣除拉曼背景的方式而言的,即不需要按照现有的扣除背景方式进行扣除,并不是指本发明不需要减去拉曼背景的面积。It should be noted that, in the method for determining the peak area of a characteristic peak of a Raman spectrum without subtracting Raman background of the present invention, the term "no subtraction of Raman background" refers to a method relative to the existing method for calculating the peak area of a characteristic peak of a Raman spectrum, in which the Raman background needs to be subtracted in advance. That is, the method does not need to subtract the background according to the existing method, but does not mean that the present invention does not need to subtract the area of the Raman background.
具体实施方式二:Specific implementation method 2:
本实施方式为无扣除拉曼背景确定拉曼光谱特征峰峰面积的系统,所述系统为具体实施方式一所述无扣除拉曼背景确定拉曼光谱特征峰峰面积的方法对应的程序,所述系统包括:This embodiment is a system for determining the peak area of a characteristic peak of a Raman spectrum without subtracting the Raman background. The system is a program corresponding to the method for determining the peak area of a characteristic peak of a Raman spectrum without subtracting the Raman background described in the first embodiment. The system includes:
中心峰位信息确定单元:用于计算特征峰的准确中心峰位信息,具体过程包括以下步骤:Central peak position information determination unit: used to calculate the accurate central peak position information of the characteristic peak, the specific process includes the following steps:
首先,读取整条拉曼光谱数据,将raman shift和intensity分别存储在数组x、y中;raman shift即拉曼位移,intensity即拉曼强度;First, read the entire Raman spectrum data and store the raman shift and intensity in arrays x and y respectively; raman shift refers to Raman displacement, and intensity refers to Raman intensity;
然后基于待提取特征峰拉曼频移、中心峰位寻找范围,确定中心峰位寻找范围序列长度内的拉曼强度最大值,作为待提取特征峰准确中心峰位,对应的索引值为中心峰位索引值center_peak_raman_shift_index;Then, based on the Raman frequency shift of the characteristic peak to be extracted and the center peak search range, the maximum Raman intensity within the center peak search range sequence length is determined as the accurate center peak position of the characteristic peak to be extracted, and the corresponding index value is the center peak index value center_peak_raman_shift_index;
特征峰两侧交点确定单元:基于设定的置信峰位比p值,计算特征峰两侧交点的准确坐标,所述交点为基于置信峰位比p值确定的参考点;计算特征峰两侧交点准确坐标的过程包括以下步骤:The intersection point determination unit on both sides of the characteristic peak: based on the set confidence peak position ratio p value, calculates the accurate coordinates of the intersection points on both sides of the characteristic peak, wherein the intersection points are reference points determined based on the confidence peak position ratio p value; the process of calculating the accurate coordinates of the intersection points on both sides of the characteristic peak includes the following steps:
步骤S21、获取特征峰左右交点范围,即寻峰范围search_peak_length;Step S21, obtaining the left and right intersection range of the characteristic peak, that is, the peak search range search_peak_length;
步骤S22、设置左、右两交点索引值xlnum_index、xrnum_index的起始值等于准确中心峰位的索引值;Step S22, setting the starting values of the left and right intersection index values xlnum_index and xrnum_index to be equal to the index value of the accurate center peak position;
步骤S23、基于中心峰位,分别向左、向右计算左右两交点的索引值:Step S23: Based on the center peak position, the index values of the left and right intersections are calculated respectively:
步骤S231、寻找左侧交点的序列长度为search_peak_length/2;Step S231, the length of the sequence for finding the left intersection point is search_peak_length/2;
当y[xlnum_index]>(1-p)*y[center_peak_raman_shift_index]时,左交点x[xlnum_index]每向左移动一个步长,即索引值减1,判断此时的x[xlnum_index]是否在左侧交点的序列长度范围内,如在范围内,则继续向左移动寻找交点;When y[xlnum_index]>(1-p)*y[center_peak_raman_shift_index], the left intersection point x[xlnum_index] moves one step to the left, that is, the index value decreases by 1, and it is determined whether x[xlnum_index] is within the sequence length range of the left intersection point. If it is within the range, it continues to move to the left to find the intersection point;
其中,x[xlnum_index]表示索引xlnum_index处对应的拉曼频移,y[xlnum_index]表示索引xlnum_index处对应的拉曼强度,y[center_peak_raman_shift_index]表示索引center_peak_raman_shift_index处对应的拉曼强度;Among them, x[xlnum_index] represents the Raman frequency shift corresponding to the index xlnum_index, y[xlnum_index] represents the Raman intensity corresponding to the index xlnum_index, and y[center_peak_raman_shift_index] represents the Raman intensity corresponding to the index center_peak_raman_shift_index;
当y[xlnum_index]<=(1-p)*y[center_peak_raman_shift_index]或此刻的x[xlnum_index]已经超过左侧交点的序列长度范围,则停止,此时的xlnum_index为左交点索引值;When y[xlnum_index]<=(1-p)*y[center_peak_raman_shift_index] or x[xlnum_index] at this moment has exceeded the sequence length range of the left intersection, stop, and xlnum_index at this moment is the index value of the left intersection;
步骤S232、寻找右侧交点的序列长度为search_peak_length/2;Step S232, the length of the sequence for finding the right intersection point is search_peak_length/2;
当y[xrnum_index]>(1-p)*y[center_peak_raman_shift_index]时,右交点x[xrnum_index]每向右移动一个步长,即索引值加1,判断此时的x[xrnum_index]是否在右侧交点的序列长度范围内,如在范围内,则继续向右移动寻找交点;When y[xrnum_index]>(1-p)*y[center_peak_raman_shift_index], the right intersection point x[xrnum_index] moves one step to the right, that is, the index value is increased by 1, and it is judged whether x[xrnum_index] at this time is within the sequence length range of the right intersection point. If it is within the range, it continues to move to the right to find the intersection point;
当y[xrnum_index]<=(1-p)*y[center_peak_raman_shift_index]或此刻的x[xrnum_index]已经超过右侧交点的序列长度范围,则停止,此时的xrnum_index为右交点的索引值;When y[xrnum_index]<=(1-p)*y[center_peak_raman_shift_index] or x[xrnum_index] at this moment has exceeded the sequence length range of the right intersection, stop, and xrnum_index at this moment is the index value of the right intersection;
特征峰两侧切点确定单元:基于特征峰两侧交点计算特征峰两侧切点的准确坐标,具体过程包括以下步骤:Characteristic peak two-side tangent point determination unit: based on the intersection points on both sides of the characteristic peak, the accurate coordinates of the tangent points on both sides of the characteristic peak are calculated. The specific process includes the following steps:
步骤S31、计算中心峰位与两交点间的水平距离△xL、△xR;Step S31, calculating the horizontal distances △x L and △x R between the central peak and the two intersection points;
步骤S32、左、右切点坐标索引值xllnum_index、xrrnum_index的起始值分别等于xlnum_index、xrnum_index;左、右切点为计算拉曼光谱特征峰峰面积的左右端点;Step S32, the starting values of the left and right tangent point coordinate index values xllnum_index and xrrnum_index are respectively equal to xlnum_index and xrnum_index; the left and right tangent points are the left and right endpoints for calculating the peak area of the characteristic peak of the Raman spectrum;
步骤S33、左切点x[xllnum_index]每次向左移动一个步长,即索引值减1,当x[xllnum_index]=x[center_peak_raman_shift_index]-(1/p)*△xL时,找到特征峰左侧切点索引值xllnum_index;Step S33, the left tangent point x[xllnum_index] moves to the left by one step each time, that is, the index value decreases by 1, and when x[xllnum_index]=x[center_peak_raman_shift_index]-(1/p)*△x L , the index value xllnum_index of the left tangent point of the characteristic peak is found;
步骤S34、右切点x[xrrnum_index]每次向右移动一个步长,即索引值加1,当x[xrrnum_index]=x[center_peak_raman_shift_index]+(1/p)*△xR时,找到特征峰右侧切点索引值xrrnum_index;Step S34, the right tangent point x[xrrnum_index] moves rightward by one step each time, that is, the index value is increased by 1, and when x[xrrnum_index]=x[center_peak_raman_shift_index]+(1/p)*△x R , the right tangent point index value xrrnum_index of the characteristic peak is found;
步骤S35、左右两切点的坐标分别为(x[xllnum_index],y[xllnum_index]),(x[xrrnum_index],y[xrrnum_index]);Step S35, the coordinates of the left and right tangent points are (x[xllnum_index], y[xllnum_index]), (x[xrrnum_index], y[xrrnum_index]);
拉曼特征峰峰面积计算单元:基于左右两切点的坐标计算拉曼特征峰与两切点连线围成区域的面积,具体过程包括以下步骤:Raman characteristic peak area calculation unit: based on the coordinates of the left and right tangent points, the area of the Raman characteristic peak and the line connecting the two tangent points is calculated. The specific process includes the following steps:
步骤S41、以特征峰左切点为起点,相邻两点的拉曼强度值y[xllnum_index]、y[xllnum_index+1]为上下底,以拉曼步长为高,计算每个小梯形的面积,直至到达右切点截止,小梯形的面积和记为S总;Step S41, taking the left tangent point of the characteristic peak as the starting point, the Raman intensity values y[xllnum_index] and y[xllnum_index+1] of two adjacent points as the upper and lower bases, and the Raman step length as the height, calculate the area of each small trapezoid until the right tangent point is reached, and the sum of the areas of the small trapezoids is recorded as Stotal;
步骤S42、以特征峰左右两切点的拉曼强度值y[xllnum_index]、y[xrrnum_index]为上下底,两切点的水平距离为高,计算梯形的面积记为S背,也就是拉曼背景的面积;Step S42, taking the Raman intensity values y[xllnum_index] and y[xrrnum_index] of the left and right tangent points of the characteristic peak as the upper and lower bases, and the horizontal distance between the two tangent points as the height, the area of the trapezoid is calculated and recorded as Sback , that is, the area of the Raman background;
步骤S43、S总减去S背得到的面积,即为拉曼特征峰的峰面积。Step S43, the area obtained by subtracting Sback from Stotal is the peak area of the Raman characteristic peak.
具体实施方式三:Specific implementation method three:
本实施方式为一种计算机存储介质,所述存储介质中存储有至少一条指令,所述至少一条指令由处理器加载并执行以实现所述的无扣除拉曼背景确定拉曼光谱特征峰峰面积的方法。This embodiment is a computer storage medium, in which at least one instruction is stored. The at least one instruction is loaded and executed by a processor to implement the method for determining the peak area of a characteristic peak of a Raman spectrum without subtracting the Raman background.
应当理解,指令包括本发明描述的任何方法对应的计算机程序产品、软件或计算机化方法;所述指令可以用于编程计算机系统,或其他电子装置。计算机存储介质可以包括其上存储有指令的可读介质,可以包括但不限于磁存储介质,光存储介质;磁光存储介质包括只读存储器ROM、随机存取存储器RAM、可擦除可编程存储器(例如,EPROM和EEPROM)以及闪存层,或者适合于存储电子指令的其他类型的介质。It should be understood that the instructions include computer program products, software or computerized methods corresponding to any method described in the present invention; the instructions can be used to program a computer system, or other electronic device. Computer storage media may include readable media on which instructions are stored, which may include but are not limited to magnetic storage media, optical storage media; magneto-optical storage media include read-only memory ROM, random access memory RAM, erasable programmable memory (e.g., EPROM and EEPROM) and flash memory layers, or other types of media suitable for storing electronic instructions.
具体实施方式四:Specific implementation method four:
本实施方式为无扣除拉曼背景确定拉曼光谱特征峰峰面积的设备,所述设备包括处理器和存储器,应当理解,包括本发明描述的任何包括处理器和存储器的设备,设备还可以包括其他通过信号或指令进行显示、交互、处理、控制等以及其他功能的单元、模块;This embodiment is a device for determining the peak area of characteristic peaks of Raman spectrum without subtracting Raman background, and the device includes a processor and a memory. It should be understood that the device includes any device including a processor and a memory described in the present invention, and the device may also include other units and modules that perform display, interaction, processing, control, etc. and other functions through signals or instructions;
所述存储器中存储有至少一条指令,所述至少一条指令由处理器加载并执行以实现所述的无扣除拉曼背景确定拉曼光谱特征峰峰面积的方法。At least one instruction is stored in the memory, and the at least one instruction is loaded and executed by the processor to implement the method for determining the peak area of a characteristic peak of a Raman spectrum without subtracting the Raman background.
实施例Example
由于实际采集到的拉曼光谱背景峰没有规律且不可预测,无法获取到不包含任何背景干扰的拉曼光谱数据。对于有背景干扰的拉曼光谱数据,采用现有方法扣除背景,计算特征峰峰面积作为标准峰面积评估本发明的有益效果并不合理。因此,本发明采用拉曼光谱模拟的常用方法,将多个洛伦兹峰叠加生成无背景的拉曼光谱数据。Since the actual collected Raman spectrum background peaks are irregular and unpredictable, it is impossible to obtain Raman spectrum data without any background interference. For Raman spectrum data with background interference, it is not reasonable to use the existing method to deduct the background and calculate the peak area of the characteristic peak as the standard peak area to evaluate the beneficial effects of the present invention. Therefore, the present invention adopts the common method of Raman spectrum simulation to superimpose multiple Lorentz peaks to generate Raman spectrum data without background.
拉曼背景信号则由Gaussian函数、Sigmoid函数、Exponential函数、Ploynomial函数四种背景函数单独或组合产生,将背景干扰与模拟拉曼光谱数据叠加,即得到了含有不同类型、不同参数的含背景拉曼光谱数据。The Raman background signal is generated by four background functions, namely, Gaussian function, Sigmoid function, Exponential function and Ploynomial function, either alone or in combination. By superimposing the background interference with the simulated Raman spectrum data, we can obtain background Raman spectrum data of different types and parameters.
采用以下实施例验证本发明的有益效果:The following examples are used to verify the beneficial effects of the present invention:
实施例中计算同一条模拟拉曼光谱不同特征峰峰面积时使用的可优化参数一致,只更改待计算特征峰的中心峰位信息;对比有无背景干扰时峰面积变化,只更改背景函数组合,不更改背景函数参数及可优化参数。In the embodiment, the optimizable parameters used when calculating the peak areas of different characteristic peaks of the same simulated Raman spectrum are consistent, and only the central peak position information of the characteristic peak to be calculated is changed; when comparing the peak area changes with and without background interference, only the background function combination is changed, and the background function parameters and the optimizable parameters are not changed.
试验一:背景信号强度小于拉曼信号强度时计算拉曼峰面积是按照以下步骤完成的:Experiment 1: Calculation of Raman peak area when background signal intensity is less than Raman signal intensity is completed according to the following steps:
本试验生成的模拟拉曼光谱参数如下:拉曼中心位置分别为544、739、1009、1329、1690,拉曼半峰宽分别为36、25、30、33、57,拉曼峰面积分别为7200、6020、9589、10345、11300,拉曼步长为0.1。The simulated Raman spectrum parameters generated in this experiment are as follows: the Raman center positions are 544, 739, 1009, 1329, and 1690, the Raman half-peak widths are 36, 25, 30, 33, and 57, the Raman peak areas are 7200, 6020, 9589, 10345, and 11300, and the Raman step size is 0.1.
本试验的背景函数参数如下:Gaussian参数为1000、128、550;Sigmoid参数为830、25、100;Exponential参数为21;Ploynomial参数为20。The background function parameters of this experiment are as follows: Gaussian parameters are 1000, 128, 550; Sigmoid parameters are 830, 25, 100; Exponential parameter is 21; Ploynomial parameter is 20.
步骤S1,计算待提取特征峰的准确中心峰位信息,具体步骤如下:Step S1, calculating the accurate central peak position information of the characteristic peak to be extracted, the specific steps are as follows:
步骤S11,将生成拉曼光谱的raman shift和intensity分别存储在数组x,y中;特别地,通过改变不同类型背景函数组合即可生成包含不同背景干扰的拉曼光谱;Step S11, storing the raman shift and intensity of the generated Raman spectrum in arrays x and y respectively; in particular, by changing the combination of different types of background functions, Raman spectra containing different background interferences can be generated;
步骤S12,输入待提取的特征峰,本试验中输入的待提取特征峰分别为535、750、1000、1320、1700,输入中心峰位寻找范围设定为80;Step S12, input the characteristic peaks to be extracted. In this experiment, the characteristic peaks to be extracted are 535, 750, 1000, 1320, and 1700, respectively, and the input center peak position search range is set to 80;
步骤S13,寻找输入待提取中心峰位序列长度内拉曼强度的最大值,作为待提取特征峰准确中心峰位,其索引值为中心峰位索引值center_peak_raman_shift_index,具体步骤如下:Step S13, finding the maximum value of the Raman intensity within the length of the input center peak sequence to be extracted as the accurate center peak position of the characteristic peak to be extracted, and its index value is the center peak index value center_peak_raman_shift_index, and the specific steps are as follows:
模拟拉曼光谱raman shift步长divis为0.1,中心峰位寻找范围的序列长度为80,寻找输入中心峰位左右各40个序列长度范围内的拉曼强度最大值,作为准确中心峰位,对应索引值为准确中心峰位索引值。The simulated Raman spectrum raman shift step divis is 0.1, the sequence length of the central peak search range is 80, and the maximum Raman intensity within the range of 40 sequence lengths on the left and right of the input central peak is found as the accurate central peak position, and the corresponding index value is the accurate central peak index value.
步骤S2,计算待提取特征峰中心峰位的左右交点坐标,具体步骤如下:Step S2, calculating the left and right intersection coordinates of the central peak position of the characteristic peak to be extracted, the specific steps are as follows:
步骤S21,本试验设定左右交点寻找范围序列长度参数为200,无背景拉曼光谱置信峰位比设定为0.9,有背景拉曼光谱置信峰位比设定为0.35;Step S21, in this experiment, the left and right intersection search range sequence length parameter is set to 200, the background-free Raman spectrum confidence peak ratio is set to 0.9, and the background Raman spectrum confidence peak ratio is set to 0.35;
步骤S22,令左、右两交点的索引值xlnum_index、xrnum_index的起始值等于步骤S13中确定的中心峰位索引值;Step S22, setting the starting values of the index values xlnum_index and xrnum_index of the left and right intersection points to be equal to the central peak index value determined in step S13;
步骤S23,根据计算公式分别向左向右确定两交点索引值,具体步骤如下:Step S23, determining the index values of the two intersection points respectively to the left and to the right according to the calculation formula, the specific steps are as follows:
步骤S231,寻找左侧交点的序列长度范围为步骤S21中设定的左右交点寻找范围序列长度参数的一半,当y[xlnum_index]>(1-p)*y[center_peak_raman_shift_index]时,左交点x[xlnum_index]每次向左移动一个步长,即索引值减1,判断此时的x[xlnum_index]是否在设定的左侧交点序列长度范围内,如在范围内,则继续向左移动寻找交点。当y[xlnum_index]<=(1-p)*y[center_peak_raman_shift_index]或此刻的x[xlnum_index]已经超过左侧交点的序列长度范围,则停止,此时的xlnum_index为左交点索引值;Step S231, the sequence length range for searching the left intersection is half of the sequence length parameter for searching the left and right intersections set in step S21. When y[xlnum_index]>(1-p)*y[center_peak_raman_shift_index], the left intersection x[xlnum_index] moves one step to the left each time, that is, the index value is reduced by 1, and it is determined whether the current x[xlnum_index] is within the set left intersection sequence length range. If it is within the range, it continues to move to the left to search for the intersection. When y[xlnum_index]<=(1-p)*y[center_peak_raman_shift_index] or the current x[xlnum_index] has exceeded the sequence length range of the left intersection, it stops, and the current xlnum_index is the left intersection index value;
步骤S232,寻找右侧交点的序列长度为步骤S21中设定的左右交点寻找范围序列长度参数的一半,当y[xrnum_index]>(1-p)*y[center_peak_raman_shift_index]时,右交点x[xrnum_index]每次向右移动一个步长,即索引值加1,判断此时的x[xrnum_index]是否在设定的右侧交点的序列长度范围内,如在范围内,则继续向右移动寻找交点。当y[xrnum_index]<=(1-p)*y[center_peak_raman_shift_index]或此刻的x[xrnum_index]已经超过右侧交点的序列长度范围,则停止,此时的xrnum_index为右交点的索引值。Step S232, the sequence length of the right intersection is half of the sequence length parameter of the left and right intersection search range set in step S21. When y[xrnum_index]>(1-p)*y[center_peak_raman_shift_index], the right intersection x[xrnum_index] moves one step to the right each time, that is, the index value is increased by 1, and it is determined whether x[xrnum_index] at this time is within the set sequence length range of the right intersection. If it is within the range, continue to move to the right to find the intersection. When y[xrnum_index]<=(1-p)*y[center_peak_raman_shift_index] or x[xrnum_index] at this moment has exceeded the sequence length range of the right intersection, stop, and xrnum_index at this time is the index value of the right intersection.
步骤S3,计算待提取特征峰中心峰位的左右切点坐标,具体步骤如下:Step S3, calculating the left and right tangent point coordinates of the central peak position of the characteristic peak to be extracted, the specific steps are as follows:
步骤S31,计算待提取中心峰位与两交点间的水平距离△xL、△xR;Step S31, calculating the horizontal distances △x L and △x R between the central peak to be extracted and the two intersection points;
步骤S32,左右两切点坐标索引值xllnum_index、xrrnum_index的起始值分别等于xlnum_index、xrnum_index;Step S32, the starting values of the left and right tangent point coordinate index values xllnum_index and xrrnum_index are respectively equal to xlnum_index and xrnum_index;
步骤S33,左切点x[xllnum_index]每次向左移动一个步长,即索引值减1,当x[xllnum_index]=x[center_peak_raman_shift_index]-(1/p)*△xL时,找到特征峰左侧切点索引值xllnum_index;Step S33, the left tangent point x[xllnum_index] moves to the left by one step each time, that is, the index value decreases by 1, and when x[xllnum_index]=x[center_peak_raman_shift_index]-(1/p)*△x L , the index value xllnum_index of the left tangent point of the characteristic peak is found;
步骤S34,右切点x[xrrnum_index]每次向右移动一个步长,即索引值加1,当x[xrrnum_index]=x[center_peak_raman_shift_index]+(1/p)*△xR时,找到特征峰右侧切点索引值xrrnum_index;Step S34, the right tangent point x[xrrnum_index] is moved rightward by one step each time, that is, the index value is increased by 1, and when x[xrrnum_index]=x[center_peak_raman_shift_index]+(1/p)*△x R , the right tangent point index value xrrnum_index of the characteristic peak is found;
步骤S35,左右两切点的坐标分别为(x[xllnum_index],y[xllnum_index]),(x[xrrnum_index],y[xrrnum_index])。Step S35, the coordinates of the left and right tangent points are (x[xllnum_index], y[xllnum_index]), (x[xrrnum_index], y[xrrnum_index]) respectively.
步骤S4,计算待提取特征峰峰面积,具体步骤如下:Step S4, calculating the peak area of the characteristic peak to be extracted, the specific steps are as follows:
步骤S41,以特征峰左切点为起点,相邻两点的拉曼强度值y[xllnum_index]、y[xllnum_index+1]为上下底,拉曼步长divis为高,计算每个小梯形的面积,直至到达右切点截止,小梯形的面积和记为S总;Step S41, taking the left tangent point of the characteristic peak as the starting point, the Raman intensity values of the two adjacent points y[xllnum_index] and y[xllnum_index+1] as the upper and lower bases, and the Raman step length divis as the height, calculate the area of each small trapezoid until reaching the right tangent point, and the sum of the areas of the small trapezoids is recorded as Stotal;
步骤S42,以特征峰左右两切点对应的拉曼强度值y[xllnum_index]、y[xrrnum_index]为上下底,两切点的水平距离为高,计算拉曼背景的面积记为S背;Step S42, taking the Raman intensity values y[xllnum_index] and y[xrrnum_index] corresponding to the left and right tangent points of the characteristic peak as the upper and lower bases, and the horizontal distance between the two tangent points as the height, the area of the Raman background is calculated and recorded as Sback ;
步骤S43,S总减去S背得到的面积,即为拉曼特征峰的峰面积。Step S43, the area obtained by subtracting Sback from Stotal is the peak area of the Raman characteristic peak.
图2为试验一背景强度小于拉曼信号强度的情况下,同时叠加四种背景函数的模拟拉曼光谱谱图与无背景模拟拉曼光谱谱图,图中圆点为本发明计算得到的特征峰准确中心峰位、两侧交点、两侧切点位置;FIG2 is a simulated Raman spectrum of four background functions and a simulated Raman spectrum without background when the background intensity is less than the Raman signal intensity in Experiment 1, wherein the dots in the figure are the accurate central peak position, the intersection point on both sides, and the tangent point position on both sides of the characteristic peak calculated by the present invention;
表1为试验一背景强度小于拉曼信号强度的情况下,本发明对于不同背景函数组合,计算到的不同特征峰有背景与无背景特征面积比统计图。Table 1 is a statistical diagram of the characteristic area ratios with and without background of different characteristic peaks calculated for different background function combinations in the present invention when the background intensity is less than the Raman signal intensity in the first test.
表1Table 1
注:拉曼光谱背景由以下四个函数产生,其中G代表Gaussian函数、S代表Sigmoid函数、E代表Exponential函数、P代表Ploynomial函数;字母组合表示该条光谱背景由对应的函数组合而成Note: Raman spectrum background is generated by the following four functions, where G represents Gaussian function, S represents Sigmoid function, E represents Exponential function, and P represents Ploynomial function; the letter combination indicates that the spectrum background is composed of the corresponding functions.
从图2、表1结果可知,背景强度小于拉曼信号强度的情况下,在不同背景函数参数、不同背景函数组合的干扰下,本发明对于不同半峰宽、不同强度的拉曼特征峰,计算得到的有背景与无背景特征面积比变化低于5%。It can be seen from the results in Figure 2 and Table 1 that when the background intensity is less than the Raman signal intensity, under the interference of different background function parameters and different background function combinations, the calculated characteristic area ratio with background and without background for Raman characteristic peaks with different half-peak widths and different intensities in the present invention changes by less than 5%.
试验二:背景信号强度大于拉曼信号强度时计算拉曼峰面积,本试验与试验一的区别在于:Test 2: Calculate the Raman peak area when the background signal intensity is greater than the Raman signal intensity. The difference between this test and test 1 is:
本试验使用的背景函数参数如下:Gaussian参数为400、739、1000;Sigmoid参数为530、100、500;Exponential参数为300;Ploynomial参数为200。The background function parameters used in this experiment are as follows: Gaussian parameters are 400, 739, and 1000; Sigmoid parameters are 530, 100, and 500; Exponential parameter is 300; and Ploynomial parameter is 200.
步骤S21,左右交点寻找范围序列长度参数为140,无背景拉曼光谱置信峰位比设定为0.93,有背景拉曼光谱置信峰位比设定为0.67;其他步骤及参数均与试验一相同。Step S21, the left and right intersection search range sequence length parameter is 140, the background-free Raman spectrum confidence peak ratio is set to 0.93, and the background Raman spectrum confidence peak ratio is set to 0.67; other steps and parameters are the same as those in Experiment 1.
图3为试验二背景强度大于拉曼信号强度的情况下,同时叠加四种背景函数的模拟拉曼光谱谱图与无背景模拟拉曼光谱谱图,图中圆点为本发明计算得到的特征峰准确中心峰位、两侧交点、两侧切点位置;FIG3 is a simulated Raman spectrum graph of four background functions and a simulated Raman spectrum graph without background when the background intensity is greater than the Raman signal intensity in Experiment 2, wherein the dots in the graph are the accurate central peak position, the intersection point on both sides, and the tangent point position on both sides of the characteristic peak calculated by the present invention;
表2为试验二背景强度大于拉曼信号强度的情况下,本发明对于不同背景函数组合,计算到的不同特征峰有背景与无背景特征面积比统计图。Table 2 is a statistical diagram of the characteristic area ratios with and without background of different characteristic peaks calculated for different background function combinations in the present invention when the background intensity in Experiment 2 is greater than the Raman signal intensity.
表2Table 2
注:拉曼光谱背景由以下四个函数产生,其中G代表Gaussian函数、S代表Sigmoid函数、E代表Exponential函数、P代表Ploynomial函数;字母组合表示该条光谱背景由对应的函数组合而成Note: Raman spectrum background is generated by the following four functions, where G represents Gaussian function, S represents Sigmoid function, E represents Exponential function, and P represents Ploynomial function; the letter combination indicates that the spectrum background is composed of the corresponding functions.
从图3、表2结果可知,背景强度大于拉曼信号强度的情况下,在不同背景函数参数、不同背景函数组合的干扰下,本发明对于不同半峰宽、不同强度的拉曼特征峰,计算得到的有背景与无背景特征面积比变化低于5%。It can be seen from the results in Figure 3 and Table 2 that when the background intensity is greater than the Raman signal intensity, under the interference of different background function parameters and different background function combinations, the calculated characteristic area ratio with background and without background for Raman characteristic peaks with different half-peak widths and different intensities in the present invention changes by less than 5%.
试验三:背景信号强度与部分拉曼信号强度相当且大于其余拉曼信号强度时计算拉曼峰峰面积,本试验与试验一的区别在于:Test 3: Calculate the Raman peak area when the background signal intensity is equal to the intensity of some Raman signals and greater than the intensity of the remaining Raman signals. The difference between this test and test 1 is:
本试验的模拟拉曼光谱参数如下:拉曼中心位置分别为544、739、1009、1329、1690,拉曼半峰宽分别为20、30、38、50、42,拉曼峰面积分别为17600、29800、26589、20345、10000,拉曼步长为0.1。The simulated Raman spectrum parameters of this experiment are as follows: the Raman center positions are 544, 739, 1009, 1329, and 1690, the Raman half-peak widths are 20, 30, 38, 50, and 42, the Raman peak areas are 17600, 29800, 26589, 20345, and 10000, and the Raman step size is 0.1.
本试验的背景函数参数如下:Gaussian参数为2400、750、800;Sigmoid参数为600、260、1000;Exponential参数为100;Ploynomial参数为200。The background function parameters of this experiment are as follows: Gaussian parameters are 2400, 750, 800; Sigmoid parameters are 600, 260, 1000; Exponential parameter is 100; Ploynomial parameter is 200.
步骤S21,左右交点寻找范围序列长度参数为120,无背景拉曼光谱置信峰位比设定为0.88,有背景拉曼光谱置信峰位比设定为0.6;其余步骤及参数均与试验一相同。Step S21, the left and right intersection search range sequence length parameter is 120, the background-free Raman spectrum confidence peak ratio is set to 0.88, and the background Raman spectrum confidence peak ratio is set to 0.6; the remaining steps and parameters are the same as those in Experiment 1.
图4为试验三背景强度与部分拉曼信号强度相当且大于其余拉曼信号强度的情况下,同时叠加四种背景函数的模拟拉曼光谱谱图与无背景模拟拉曼光谱谱图,图中圆点为本发明计算得到的特征峰准确中心峰位、两侧交点、两侧切点位置;FIG4 is a simulated Raman spectrum with four background functions and a simulated Raman spectrum without background when the background intensity of Experiment 3 is equivalent to the intensity of some Raman signals and greater than the intensity of other Raman signals. The dots in the figure are the accurate central peak position, intersection points on both sides, and tangent points on both sides of the characteristic peak calculated by the present invention;
表3为试验三背景强度与部分拉曼信号强度相当且大于其余拉曼信号强度的情况下,本发明对于不同背景函数组合,计算到的不同特征峰有背景与无背景特征面积比统计图。Table 3 is a statistical diagram of the characteristic area ratios with and without background of different characteristic peaks calculated for different background function combinations in the present invention when the background intensity of Experiment 3 is equivalent to the intensity of some Raman signals and greater than the intensity of other Raman signals.
表3table 3
注:拉曼光谱背景由以下四个函数产生,其中G代表Gaussian函数、S代表Sigmoid函数、E代表Exponential函数、P代表Ploynomial函数;字母组合表示该条光谱背景由对应的函数组合而成Note: Raman spectrum background is generated by the following four functions, where G represents Gaussian function, S represents Sigmoid function, E represents Exponential function, and P represents Ploynomial function; the letter combination indicates that the spectrum background is composed of the corresponding functions.
从图4、表3结果可知,背景强度与部分拉曼信号强度相当且大于其余拉曼信号强度的情况下,在不同背景函数参数、不同背景函数组合的干扰下,本发明对于不同半峰宽、不同强度的拉曼特征峰,计算得到的有背景与无背景特征面积比变化低于5%。It can be seen from the results in Figure 4 and Table 3 that when the background intensity is equivalent to the intensity of some Raman signals and greater than the intensity of other Raman signals, under the interference of different background function parameters and different background function combinations, for Raman characteristic peaks with different half-peak widths and different intensities, the calculated characteristic area ratio with background and without background changes less than 5%.
从上述三个试验结果可知,本发明在不同背景函数参数、不同背景函数组合的干扰下,无需改变置信峰位比参数、左右交点范围参数的前提下,计算得到的不同特征峰有背景与无背景特征面积比变化低于5%。本发明方法计算结果差异性低、不受主观因素影响,优于现阶段计算拉曼峰面积的其他方法,对于提升拉曼光谱定量检测系统的稳定性和可靠性具有重要促进作用。From the above three test results, it can be seen that under the interference of different background function parameters and different background function combinations, without changing the confidence peak ratio parameter and the left and right intersection range parameter, the calculated characteristic area ratio of different characteristic peaks with background and without background changes less than 5%. The calculation results of the method of the present invention have low variability and are not affected by subjective factors. It is superior to other methods for calculating Raman peak area at this stage, and plays an important role in improving the stability and reliability of Raman spectroscopy quantitative detection systems.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310908925.5A CN116933056B (en) | 2023-07-24 | 2023-07-24 | Method and system for determining peak area of characteristic peak of Raman spectrum without subtracting Raman background |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310908925.5A CN116933056B (en) | 2023-07-24 | 2023-07-24 | Method and system for determining peak area of characteristic peak of Raman spectrum without subtracting Raman background |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116933056A CN116933056A (en) | 2023-10-24 |
CN116933056B true CN116933056B (en) | 2024-06-21 |
Family
ID=88387491
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310908925.5A Active CN116933056B (en) | 2023-07-24 | 2023-07-24 | Method and system for determining peak area of characteristic peak of Raman spectrum without subtracting Raman background |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116933056B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101291616A (en) * | 2005-10-04 | 2008-10-22 | 如新国际股份有限公司 | Raman instrument for measuring weak signals in the presence of strong background fluorescence |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104215623B (en) * | 2013-05-31 | 2018-09-25 | 欧普图斯(苏州)光学纳米科技有限公司 | Laser Raman spectroscopy intelligence discrimination method and system towards conglomerate detection |
US20210270742A1 (en) * | 2020-02-28 | 2021-09-02 | Virginia Tech Intellectual Properties, Inc. | Peak-preserving and enhancing baseline correction methods for raman spectroscopy |
CN112712108B (en) * | 2020-12-16 | 2023-08-18 | 西北大学 | A Raman Spectroscopy Multivariate Data Analysis Method |
CN113109317B (en) * | 2021-03-26 | 2022-03-25 | 中国科学院西安光学精密机械研究所 | Raman spectrum quantitative analysis method and system based on background subtraction extraction peak area |
-
2023
- 2023-07-24 CN CN202310908925.5A patent/CN116933056B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101291616A (en) * | 2005-10-04 | 2008-10-22 | 如新国际股份有限公司 | Raman instrument for measuring weak signals in the presence of strong background fluorescence |
Non-Patent Citations (1)
Title |
---|
基于拉曼光谱CCD信号的谱峰识别技术研究;朱倩;程明霄;丁妍;李时伟;林锦国;;传感器与微系统;20121220(第12期);第12-15页 * |
Also Published As
Publication number | Publication date |
---|---|
CN116933056A (en) | 2023-10-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8139833B2 (en) | Analyzing large data sets using a computer system | |
WO2019104487A1 (en) | Mixture detection method and device | |
CN108780048A (en) | A kind of method, detection device and the readable storage medium storing program for executing of determining detection device | |
CN110084212B (en) | Spectral characteristic peak identification and positioning method based on improved sine and cosine algorithm | |
CN101975818A (en) | Detection system and method of characteristic substance | |
JP5945365B2 (en) | Method for identifying substances from NMR spectra | |
Luboschik et al. | Heterogeneity-based guidance for exploring multiscale data in systems biology | |
Failmezger et al. | Semi-automated 3D leaf reconstruction and analysis of trichome patterning from light microscopic images | |
TWI493168B (en) | A method computer program and system to analyze mass spectra | |
CN116933056B (en) | Method and system for determining peak area of characteristic peak of Raman spectrum without subtracting Raman background | |
CN112461805A (en) | Method for fluorescence intensity substrate calculation | |
WO2018103541A1 (en) | Raman spectrum detection method and electronic apparatus for removing solvent perturbation | |
US7515769B2 (en) | Mapping-data analyzing method and apparatus | |
JP2007139548A (en) | Mobility normalization device, normalization method, normalization program and self-organizing map, and substance detection method, detection program, detection rule generation method and data structure | |
JP2007212206A (en) | Mapping data display method, program, and apparatus | |
JP6280910B2 (en) | Method for measuring the performance of a spectroscopic system | |
JP5020491B2 (en) | NMR data processing apparatus and method | |
CN113740294B (en) | Near infrared modeling-based gasoline/diesel oil detection and analysis method and device | |
CN113035292B (en) | A kind of method and system for measuring pH value of glioma infiltrating area | |
CN112257017B (en) | Unitary linear point-by-point analysis method, system and device for standardized residual error detection method | |
CN108828009A (en) | A method of non-conductor depth of defect is differentiated based on multipair electrode capacitance imaging detection technology | |
CN117314914B (en) | Defect identification method for engineering nondestructive testing image and related equipment | |
US20100046813A1 (en) | Systems and Methods of Analyzing Two Dimensional Gels | |
CN114526818B (en) | Spectrum measuring method, spectrum measuring device, spectrometer and storage medium | |
CN120336836A (en) | A wine component analysis method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |