Instrument calibration method, system and device based on dynamic time and longitudinal scaling
Through the method based on dynamic time and longitudinal scaling, interpolation fitting and similarity matching, combined with baseline correction and dynamic time regularization, the inconsistency problem of spectral measurement and analysis instruments in interstage difference and spectral drift is solved, and high-accuracy spectral signal calibration is achieved.
Patent Information
- Application Number
- CN202411076082.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-08-07
AI Technical Summary
There are inconsistencies in the interstage difference and spectral drift of existing spectral measurement and analysis instruments, and traditional calibration methods cannot effectively solve these problems.
The instrument calibration method based on dynamic time and longitudinal scaling is adopted, and the high accuracy mapping of the spectral signal is achieved through interpolation fitting and similarity matching, combined with baseline correction and dynamic time alignment.
It effectively solves the problems of interstage difference and spectral drift between instruments, and achieves high consistency and accuracy calibration of spectral signals.
Smart Images

Figure CN118960958B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of optical instrument calibration, and in particular to an instrument calibration method, system and device based on dynamic time and longitudinal scaling, wherein the device comprises a computer-readable storage medium and an electronic device. Background Art
[0002] In spectral measurement and analysis instruments, due to the existence of optical component processing errors, optical system installation errors, detector installation errors, and instrument comprehensive calibration errors, for the same test object, not only are there inconsistencies in the measured spectral signals between instruments of different manufacturers and models, but even between multiple instruments of the same manufacturer and the same model, there will be inconsistencies in the measured spectral signals. This inconsistency in the measured spectral signals between different devices is a systematic error, that is, the inter-instrument difference. At the same time, each spectrometer will also have slight spectral drift after a period of time due to environmental influences, so it needs to be calibrated regularly.
[0003] For the inter-instrument difference and spectral drift of spectral measurement and analysis instruments, the current correction method usually uses a sharp line spectral lamp. The sharp line spectral lamp has multiple discrete linear spectra, and the spectral lines have been calibrated in advance and given standard values. During calibration, the spectrometer directly measures the light emitted by the spectral lamp to obtain the corresponding discrete linear characteristic spectral lines. Corresponding to different spectral measurement and analysis instruments, the horizontal coordinate values corresponding to the discrete linear characteristic spectral lines may be ordinal values of pixels or sampling sequences according to different instruments. A second-order polynomial relationship can be established through the standard value and the pixel (sampling sequence) ordinal value. The coefficients of the constant term, the linear term, and the quadratic term can be obtained through regression solution, thereby correcting the entire spectrum.
[0004] This method has the following shortcomings: 1. The sharp line spectral lamp can only provide accurate values for a limited number of discrete spectral lines, and the calibration corresponding to these spectral lines is accurate; however, there is no standard value for calibration in other spectral ranges, and it is only based on experience and uses a second-order polynomial fitting. 2. Since the existing spectral calibration method is to fit a series of point pairs with a second-order polynomial, a curve function with constant term, linear term and quadratic term coefficients I, C1, C2 is established, and the pixel (sampling sequence) ordinal value is mapped to the spectral wavelength, frequency and wave number through this function, the result is that all point pairs and the fitted curve will produce distance residuals. In other words, the fitting curve makes several discrete current characteristic spectral lines that can be accurately aligned become inaccurate. 3. The sharp line spectral lamp provides linear discrete characteristic spectral lines. If the resolution of some spectral measurement and analysis instruments is not high (such as some handheld devices), it may not display the corresponding spectral lines at all, and the calibration procedure cannot be completed. 4. For inter-instrument difference calibration, that is, to achieve the consistency requirement of spectral signals of different instruments, the second-order polynomial fitting method, which is based on solving a finite number of discrete spectral lines, cannot guarantee that the entire spectrum between different instruments has good consistency, that is, this method cannot correct the inter-instrument difference problem well. Summary of the invention
[0005] The present invention provides an instrument calibration method based on dynamic time and longitudinal scaling, comprising:
[0006] The spectrum to be calibrated is obtained by an instrument, wherein the spectrum to be calibrated of the standard material for spectrum calibration is obtained by an instrument, wherein the abscissa of the spectrum to be calibrated is the wavelength, frequency or wave number, and the ordinate is the light intensity;
[0007] Interpolation fitting step: making the horizontal coordinates of the spectrum to be calibrated and the standard spectrum of the standard substance for spectrum calibration the same through interpolation fitting;
[0008] Similarity matching step: performing similarity matching on the standard spectrum and the spectrum to be calibrated after interpolation fitting;
[0009] The similarity matching step includes:
[0010] respectively obtaining discrete sequences of standard spectra and spectra to be calibrated;
[0011] respectively obtaining the spectral peaks of the standard spectrum and the spectrum to be calibrated;
[0012] The peak height of the set percentage is used as the boundaries on both sides of the peak, the peak interval segment is intercepted, and the remaining interval is the valley interval segment;
[0013] Invert the valley interval segment into the peak interval segment and obtain the spectrum peak value of the peak interval segment formed by the inversion, and obtain the standard spectrum with only the peak and the spectrum to be calibrated respectively;
[0014] Performing baseline correction on the spectrum to be calibrated having only the peak, so that the two end values and the peak value of the standard spectrum having only the peak and the spectrum to be calibrated after baseline correction overlap with each other in the peak interval segment;
[0015] The dynamic time warping method is used to analyze the similarity between the baseline-corrected spectrum to be calibrated and the standard spectrum with only peaks, and the mapping of the two spectra with the highest similarity is obtained.
[0016] According to one aspect of the present invention, the step of performing baseline correction on the spectrum to be calibrated having only a peak comprises:
[0017] Baseline correction is performed on the peak interval segments of the standard spectrum and the spectrum to be calibrated one by one, so that the ordinate values corresponding to the two end points of the peak interval segments of the standard spectrum and the spectrum to be calibrated coincide with the peak values.
[0018] According to one aspect of the present invention, the step of performing baseline correction on the spectrum to be calibrated having only a peak comprises:
[0019] The peak interval of the standard spectrum and the spectrum to be calibrated is divided into two sub-intervals according to the abscissa corresponding to the peak value, the endpoint with the smaller abscissa of the two end points and the abscissa corresponding to the peak value are used as the two end points of the first sub-interval, and the endpoint with the larger abscissa of the two end points and the abscissa corresponding to the peak value are used as the two end points of the second sub-interval;
[0020] The spectral value of the spectrum to be calibrated in the first sub-interval is updated by the following formula:
[0021]
[0022] Among them, [j1,j F ] is the first sub-interval of the spectrum to be calibrated, [i1,i f ] is the interval of the calibration spectrum corresponding to the first subinterval, l is the abscissa index of the first subinterval, l = 1, 2…f, is the abscissa j of the spectrum to be calibrated l The corresponding spectral value, is the horizontal coordinate j of the spectrum to be calibrated after baseline calibration l The corresponding spectral value, k0 is the slope calibration of the first sub-interval of the spectrum to be calibrated, Δ0 is the deviation calibration of the first sub-interval of the spectrum to be calibrated, and are the spectral values corresponding to the two end points of the first sub-interval of the spectrum to be calibrated, and are the spectral values corresponding to the two end points of the standard spectrum and the first sub-interval respectively;
[0023] The spectral value of the spectrum to be calibrated in the second sub-interval is updated by the following formula:
[0024]
[0025] Among them, [j f, j t ] is the second sub-interval of the spectrum to be calibrated, [i f, i t ] is the interval of the calibration spectrum corresponding to the second subinterval, w is the abscissa index of the second subinterval, w = f,…,t,b w is the abscissa j of the spectrum to be calibrated w The corresponding spectral value, is the horizontal coordinate j of the spectrum to be calibrated after baseline calibration w The corresponding spectral value, k1 is the slope calibration of the second sub-interval of the spectrum to be calibrated, Δ1 is the deviation calibration of the second sub-interval of the spectrum to be calibrated, and are the spectral values corresponding to the two end points of the second sub-interval of the spectrum to be calibrated, and They are the spectral values corresponding to the two end points of the standard spectrum and the corresponding interval of the second sub-interval respectively.
[0026] According to one aspect of the present invention, the step of using the dynamic time warping method to analyze the similarity between the baseline-corrected spectrum to be calibrated and the standard spectrum with only peaks comprises:
[0027] The similarity between the baseline-corrected spectrum to be calibrated and the standard spectrum with only peaks is obtained by the following formula:
[0028]
[0029] The discrete sequences of the peak intervals of the standard spectrum and the spectrum to be calibrated are A i and B j , D(A i,x ,B j,y ) represents A i The xth point of the interval sequence and B j The shortest distance between the yth points in the interval sequence; D is the shortest distance between the yth points in the sequence A. i and B j The two-dimensional matrix composed of δ=|a x -b y |, a x A i The spectrum value of the xth point in the interval sequence, b y For B j The spectral value of the y-th point in the interval sequence.
[0030] According to one aspect of the present invention, in the step of using a set percentage of the peak height as the boundaries on both sides of the peak, the set percentage is 5%.
[0031] According to one aspect of the present invention, the step of respectively obtaining the spectral peaks of the standard spectrum and the spectrum to be calibrated comprises:
[0032] Setting the peak distance threshold between the standard spectrum and the spectrum to be calibrated;
[0033] respectively obtaining the spectral peaks of the standard spectrum and the spectrum to be calibrated;
[0034] A set of point pairs whose distances between the spectral peaks of the standard spectrum and the spectrum to be calibrated are not less than a peak distance threshold is obtained.
[0035] According to one aspect of the present invention, the step of respectively obtaining the spectral peaks of the standard spectrum and the spectrum to be calibrated further comprises:
[0036] Delete isolated peak points whose distance is greater than the peak distance threshold.
[0037] According to one aspect of the present invention, it also includes:
[0038] The standard spectrum of the standard substance is measured by a spectral metrology standard device.
[0039] According to one aspect of the present invention, it also includes:
[0040] Compare the resolution of the instrument with that of a spectral metrology standard;
[0041] If the resolution of the instrument is lower than the resolution of the spectral metrology standard device, the standard spectrum is downsampled to obtain a standard spectrum with the same resolution as the instrument.
[0042] According to one aspect of the present invention, the step of downsampling the standard spectrum comprises:
[0043] Decimation downsampling of the standard spectrum;
[0044] Preferably, the standard spectrum is downsampled in combination with the field average;
[0045] Preferably, the standard spectrum is downsampled in combination with neighborhood weighting.
[0046] According to one aspect of the present invention, before the similarity matching step, the step further includes:
[0047] Spectrum sub-segment division step: divide the interpolation-fitted standard spectrum and the spectrum to be calibrated into multiple sub-segments according to the spectral range, and obtain multiple spectral sub-segments of the standard spectrum and the spectrum to be calibrated:
[0048] Wherein, a similarity matching step is performed on multiple spectrum sub-segments of the standard spectrum and the spectrum to be calibrated respectively.
[0049] The present invention also provides an instrument calibration system based on dynamic time and longitudinal scaling, comprising:
[0050] A spectrum acquisition module, which acquires a spectrum to be calibrated of a standard substance for spectrum calibration measured by the instrument to be calibrated and a standard spectrum of the standard substance, wherein the horizontal coordinates of the spectrum to be calibrated and the standard spectrum are wavelength, frequency or wave number, and the vertical coordinates are light intensity;
[0051] An interpolation fitting module, which makes the horizontal coordinates of the standard spectrum of the standard material for spectrum calibration collected by the spectrum collection module and the spectrum to be calibrated obtained by the spectrum to be calibrated obtaining module to be calibrated the same through interpolation fitting;
[0052] A similarity matching module performs similarity matching between the spectrum to be calibrated and the standard spectrum fitted by the interpolation fitting module;
[0053] Wherein, the similarity matching module includes:
[0054] A discrete unit, for obtaining discrete sequences of a standard spectrum and a spectrum to be calibrated;
[0055] A peak acquisition unit is used to obtain the spectrum peaks of the standard spectrum and the spectrum to be calibrated;
[0056] The interval interception unit uses the peak height of a set percentage as the boundaries on both sides of the peak to intercept the peak interval segment, and the remaining interval is the valley interval segment;
[0057] An inversion unit inverts the valley interval segment into a peak interval segment and obtains the spectrum peak value of the peak interval segment formed by the inversion, and obtains a standard spectrum with only the peak and a spectrum to be calibrated respectively;
[0058] A baseline correction unit performs baseline correction on the spectrum to be calibrated having only a peak, so that the two end values and the peak value of the standard spectrum having only a peak and the spectrum to be calibrated after baseline correction overlap with each other in the peak interval segment;
[0059] The similarity analysis unit uses a dynamic time warping method to analyze the similarity between the spectrum to be calibrated after baseline correction and the standard spectrum with only peaks, and obtains a mapping of the two spectra with the highest similarity.
[0060] According to a third aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes an instrument calibration program based on dynamic time and longitudinal scaling, and when the instrument calibration program based on dynamic time and longitudinal scaling is executed by a processor, the steps of the above-mentioned instrument calibration method based on dynamic time and longitudinal scaling are implemented.
[0061] According to a fourth aspect of the present invention, an electronic device is provided, comprising a memory and a processor, wherein the memory comprises a group of instrument calibration programs based on dynamic time and longitudinal scaling, and when the instrument calibration programs based on dynamic time and longitudinal scaling are executed by the processor, the steps of the above-mentioned instrument calibration method based on dynamic time and longitudinal scaling are implemented.
[0062] The present invention ensures the accuracy of the source through the standard spectrum of the standard substance; calibrates each spectral line in the full spectrum range of the spectrum to be calibrated of the instrument to be calibrated through interpolation fitting; performs baseline correction by intercepting the peak interval segment and flipping the valley interval segment into the peak interval segment to realize the longitudinal scaling correction, and then analyzes the similarity between the spectrum to be calibrated after the baseline correction and the standard spectrum with only the peak through the dynamic time warping method, taking into account the scaling of the spectrum on the two axes of light intensity and wavelength and wave number, preventing the partial or overall sequence point mismatch between the spectrum to be calibrated and the standard spectrum, and obtaining a high-accuracy mapping of the two spectra. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 is a flow chart of an embodiment of the instrument calibration method based on dynamic time and longitudinal scaling of the present invention;
[0064] Figure 2 It is a schematic diagram of a block diagram of the instrument calibration system based on dynamic time and longitudinal scaling according to the present invention;
[0065] Figure 3 is a schematic diagram of the electronic device of the present invention.
[0066] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0067] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0068] Figure 1 FIG. 1 is a flow chart of an embodiment of the instrument calibration method based on dynamic time and longitudinal scaling of the present invention. Figure 1 As shown, the instrument calibration method based on dynamic time and longitudinal scaling includes:
[0069] Step S1, a step of obtaining a spectrum to be calibrated: obtaining a spectrum to be calibrated of a standard substance for spectrum calibration by an instrument, wherein the abscissa of the spectrum to be calibrated is wavelength, frequency or wave number, and the ordinate is light intensity; the ordinate may also be light intensity or any other measurement value equivalent to light intensity, such as digital current or voltage (output of a light detector (i.e., an instrument)); the ordinate may also be absorbance, etc.;
[0070] Step S4, interpolation fitting step: interpolation fitting is used to make the horizontal coordinates of the spectrum to be calibrated and the standard spectrum of the standard material for spectrum calibration the same; the standard spectrum of the standard material can be measured by a national metrology standard device using a standard method such as a national standard, for example, the standard spectrum of the standard material is measured by a standard method for measuring the standard spectrum of the standard material using a spectrum metrology standard device, and the calibration method includes a standard material for spectrum calibration traceable to the highest national legal metrology institution and a calibration certificate containing an accurate calibration value of the spectrum wavelength (frequency);
[0071] Step S6, similarity matching step: performing similarity matching on the standard spectrum and the spectrum to be calibrated after interpolation fitting.
[0072] In some embodiments of the present invention, step S6 includes:
[0073] Step S61, obtaining discrete sequences of a standard spectrum and a spectrum to be calibrated respectively;
[0074] Step S62, respectively obtaining the spectrum peaks of the standard spectrum and the spectrum to be calibrated;
[0075] Step S63, taking the peak height of a set percentage as the boundaries of both sides of the peak, intercepting the peak interval segment, and the remaining interval is the valley interval segment;
[0076] Step S64, inverting the valley interval segment into the peak interval segment and obtaining the spectrum peak value of the peak interval segment formed by the inversion, and respectively obtaining a standard spectrum with only the peak and a spectrum to be calibrated;
[0077] Step S65, performing baseline correction on the spectrum to be calibrated having only the peak, so that the two end values and the peak value of the standard spectrum having only the peak and the spectrum to be calibrated after baseline correction overlap with each other in the peak interval segment;
[0078] Step S66, using a dynamic time warping method to analyze the similarity between the baseline-corrected spectrum to be calibrated and the standard spectrum with only peaks, to obtain a mapping of the two spectra with the highest similarity.
[0079] The present invention performs full spectrum calibration on the spectrum to be calibrated of the instrument to be calibrated by using interpolation fitting through the standard spectrum of the standard substance, prevents sequence point mismatch between the spectrum to be calibrated and the standard spectrum through dynamic time adjustment and longitudinal scaling correction, realizes high-accuracy mapping of the two spectra, and thus can realize spectrum consistency calibration of the instrument to be calibrated with different inter-station differences.
[0080] In some embodiments of the present invention, step S65 includes:
[0081] Baseline correction is performed on the peak interval segments of the standard spectrum and the spectrum to be calibrated one by one, so that the ordinate values corresponding to the two end points of the peak interval segments of the standard spectrum and the spectrum to be calibrated coincide with the peak values.
[0082] In some embodiments of the present invention, step S65 includes:
[0083] The peak interval of the standard spectrum and the spectrum to be calibrated is divided into two sub-intervals according to the abscissa corresponding to the peak value, the endpoint with the smaller abscissa of the two end points and the abscissa corresponding to the peak value are used as the two end points of the first sub-interval, and the endpoint with the larger abscissa of the two end points and the abscissa corresponding to the peak value are used as the two end points of the second sub-interval;
[0084] The spectral value of the spectrum to be calibrated in the first sub-interval is updated by the following formula:
[0085]
[0086] Among them, [j 1, j f ] is the first sub-interval of the spectrum to be calibrated, [i 1, i f ] is the interval of the calibration spectrum corresponding to the first subinterval, l is the abscissa index of the first subinterval, l = 1, 2…f, is the abscissa j of the spectrum to be calibrated l The corresponding spectral value, is the horizontal coordinate j of the spectrum to be calibrated after baseline calibration l The corresponding spectral value, k0 is the slope calibration of the first sub-interval of the spectrum to be calibrated, Δ0 is the deviation calibration of the first sub-interval of the spectrum to be calibrated, and are the spectral values corresponding to the two end points of the first sub-interval of the spectrum to be calibrated, and are the spectral values corresponding to the two end points of the standard spectrum and the first sub-interval respectively;
[0087] The spectral value of the spectrum to be calibrated in the second sub-interval is updated by the following formula:
[0088]
[0089] Among them, [j f, j t ] is the second sub-interval of the spectrum to be calibrated, [i f ,i t ] is the interval of the calibration spectrum corresponding to the second subinterval, w is the abscissa index of the second subinterval, w = f,…,t,b w is the abscissa j of the spectrum to be calibrated w The corresponding spectral value, is the horizontal coordinate j of the spectrum to be calibrated after baseline calibration wThe corresponding spectral value, k1 is the slope calibration of the second sub-interval of the spectrum to be calibrated, Δ1 is the deviation calibration of the second sub-interval of the spectrum to be calibrated, and are the spectral values corresponding to the two end points of the second sub-interval of the spectrum to be calibrated, and They are the spectral values corresponding to the two end points of the standard spectrum and the corresponding interval of the second sub-interval respectively.
[0090] In some embodiments of the present invention, step S66 includes:
[0091] The similarity between the baseline-corrected spectrum to be calibrated and the standard spectrum with only peaks is obtained by the following formula:
[0092]
[0093] The discrete sequences of the peak intervals of the standard spectrum and the spectrum to be calibrated are A i and B j , D(A i,x ,B j,y ) represents A i The xth point of the interval sequence and B j The shortest distance between the yth points in the interval sequence; D is the shortest distance between the yth points in the sequence A. i and B j The two-dimensional matrix composed of δ=|a x -b y |, a x A i The spectrum value of the xth point in the interval sequence, b y For B j The spectral value of the y-th point in the interval sequence.
[0094] In some embodiments of the present invention, in step S63, the set percentage is 5%.
[0095] In some embodiments of the present invention, step S62 includes:
[0096] Setting the peak distance threshold between the standard spectrum and the spectrum to be calibrated;
[0097] respectively obtaining the spectral peaks of the standard spectrum and the spectrum to be calibrated;
[0098] A set of point pairs whose distances between the spectral peaks of the standard spectrum and the spectrum to be calibrated are not less than a peak distance threshold is obtained.
[0099] In some embodiments of the present invention, the step S62 further includes:
[0100] Delete isolated peak points whose distance is greater than the peak distance threshold.
[0101] In some embodiments of the present invention, similarity matching is performed between the standard spectrum and the spectrum to be calibrated measured by the instrument to be calibrated: assuming that the sequence of the standard spectrum (or the standard spectrum after downsampling) is A, and the sequence of the spectrum to be calibrated is B, after downsampling, interpolation and region truncation, the two sequences have the same length, namely A = {a1, a2, a3, ... an}, B = {b1, b2, b3, ... b n}. The general sequence similarity calculation method either only considers the comparison in the intensity direction (Euclidean distance method) or only considers the comparison in the spectral wavelength or wavenumber direction (dynamic time warping method), without considering both at the same time. Because the spectra generated by different instruments are scaled on both the intensity and wavelength and wavenumber axes, if only a single factor is considered for similarity calculation, it will cause partial or overall sequence point mismatch, resulting in poor similarity calculation results.
[0102] The present invention proposes a sequence similarity measurement method combining segmented intensity scaling correction transformation with dynamic time adjustment. In the past, similarity measurement calculation was performed using Euclidean distance or dynamic time adjustment method without intensity scaling transformation, which would result in the peak of one sequence being the point with the same height as that in another sequence being the best calculation result, rather than the peak point near it. Step S6 of the present invention, the similarity matching step includes:
[0103] Step S601: Use methods such as binary peak search or derivative peak search to find the peaks p1, p2, p3, ..., p of the standard spectrum and the spectrum to be calibrated. n , and the spectral peaks to be calibrated p'1, p'2, p'3...p' n Set the distance threshold d0, traverse all the peak points in A and B, and find the peaks in the two sequences that satisfy |p i -p' j |≤d0 point pair set {p k ,p' k}, delete isolated peak points without matching (peak points whose distance is greater than the distance threshold);
[0104] Step S602, taking 5% of the peak height as the peak boundary, intercepting the peak interval segment; the remaining interval is the valley interval segment, in which the standard spectrum peak interval and the spectrum peak interval to be calibrated are A and B respectively. i and B j ;
[0105] Step S603: for the valley segment A of the standard spectrum and the spectrum to be calibrated k and B l , after reversing it into a peak interval, repeat the operation of step S601;
[0106] Step S604: To achieve accurate matching of the two spectral intervals, the instrument spectrum to be calibrated needs to be baseline corrected so that the two end values and peaks of the two spectral intervals coincide with each other. Assuming the standard spectrum peak (valley) interval [i0,i1]([k0,k1]), the end values are A i(k)0 and A i(k)1 , the peak (valley) position is q A , whose value is p i(k)A ; The corresponding instrument spectral peak (valley) interval to be calibrated is [j0,j1]([l0,l1]), and the two end values are B j(l)0 and B j(l)1 , the peak (valley) position is q, and its value is p j(l)B ;
[0107] In order to make the two end values and peak values of the standard spectrum interval and the instrument calibrated spectrum interval equal after baseline correction, the assumed peak (valley) interval is divided into two sub-interval bands with the peak (valley) position as the dividing line: for the standard spectrum, the first sub-interval is [i0,q A ]([k0,q A ]), the corresponding left and right endpoint values are a i(k)0 and p i(k)A ; The corresponding spectrum to be calibrated, the first sub-interval is [j0,q]([l0,q]), and the corresponding endpoint values are B j(l)0 and p j(l)B At the same time, for the second sub-interval of the standard spectrum [q A ,i1]([q A ,k1]), the corresponding endpoint values are p i(k)A and A i(k)1 ; The corresponding second sub-interval of the spectrum to be calibrated is [q,j1]([q,l1]), and the corresponding endpoint values are p j(l)B and B j(l)1 ;
[0108] To achieve spectral baseline correction, coefficients k0 and Δ0 are set for the first sub-interval of the spectrum to be calibrated; the spectral value of each point in the first sub-interval of the spectrum to be calibrated is added with the product of the corresponding spectral position and k0 and Δ0 to achieve the approximation of the calibration spectrum and the standard spectrum. j(l)0 and p j(l)B Add the product of the corresponding endpoint position and k0 and the left and right endpoint values A of the first subinterval of the standard spectrum after Δ0 i(k)0 and p i(k)A correspond to overlap respectively;
[0109] Similarly, the coefficients k1 and Δ1 are set for the second sub-interval of the spectrum to be calibrated. Unlike the first sub-interval, the spectral value of each point in the interval needs to be subtracted from the product of the corresponding spectral position and k1 and then added with Δ1 to achieve the approximation of the spectrum to be calibrated and the standard spectrum. Similar to the first sub-interval, when the left and right endpoint values p j(l)B and B j(l)1 Subtract the product of the corresponding endpoint position and k1 and add Δ1 to the left and right endpoint values p of the second subinterval of the standard spectrum i(k)A and A i(k)1 correspond to overlap respectively;
[0110] Where Δ0, k0, Δ1, k1, the formula is:
[0111]
[0112]
[0113] Each spectral point B in the spectral band to be calibrated j(l)t The calibrated value is expressed as (t represents the spectral point number):
[0114] B′ j(l)t =B j(l)t +k0*j(l) t +Δ0(t∈first subinterval)
[0115] B′ j(l)t =B j(l)t -k1*j(l) t +Δ1(t∈the second subinterval)
[0116] Thus, the spectral baseline correction of this band is completed;
[0117] Step S605: After the baseline correction is completed for the spectral peak (valley) interval measured by the calibrated instrument, a dynamic time warping algorithm is used to achieve similarity matching of the spectral peak (valley) interval. Assume that the standard spectral interval is A i The spectral interval of the instrument to be calibrated is B j ,The similarity matching algorithm can be obtained by the following formula:
[0118]
[0119] Where D(A i,x ,B j,y ) represents A i The xth point of the interval sequence and B j The shortest distance between the yth points in the interval sequence; D is the shortest distance between the yth points in the sequence A. i and B j A two-dimensional matrix composed of x -by |. This method can be used to obtain the mapping when the similarity between the standard spectrum sequence sub-segment and the spectrum sequence sub-segment of the instrument to be calibrated is the highest. This mapping must be surjective, but not necessarily injective.
[0120] Step S606, finally obtaining the transformed spectrum sequence B' of the instrument to be calibrated j With the original sequence B j The mapping function in the wavelength (wave number) direction is B' j =H(B j ), the mapping function in the intensity direction is B' j =L(B j );
[0121] Step S607, apply the method of steps S604-S606 to all spectral intervals. After merging all spectral intervals, the wavelength (wavenumber) direction mapping function H and intensity mapping function L of the entire spectrum can be obtained. The actual test sample spectrum of the instrument is substituted into these two mapping functions to obtain the calibrated sample measurement spectrum.
[0122] When the spectrum measuring instrument measures other objects after completing the spectrum calibration, the obtained spectrum is substituted into the full spectrum calibration mapping function to obtain the result, which is the spectrum of the other objects after the instrument system error is calibrated.
[0123] In some embodiments of the present invention, the instrument calibration method based on dynamic time and longitudinal scaling further includes:
[0124] Step S2, measuring the standard spectrum of the standard substance by using a spectrum measurement standard device.
[0125] The high-purity standard material for spectrum calibration in the present invention is calibrated and traced in advance by the spectrum measurement standard device of the highest legal metrology institution in the country, and the corresponding calibration result can be regarded as the standard value. As the source of the national spectrum calibration value, the spectrum measurement standard device calibrates the standard material with the highest resolution interval to ensure that the spectrum of the standard material has the highest accuracy in wavelength frequency (horizontal axis direction) and light intensity (vertical axis direction).
[0126] In some embodiments of the present invention, the instrument calibration method based on dynamic time and longitudinal scaling further includes:
[0127] Step S3, adjusting the resolution of the instrument and the spectral measurement standard device to the same resolution.
[0128] In some embodiments of the present invention, step S3 includes:
[0129] Step S31, comparing the resolution of the instrument with that of a spectral metrology standard device;
[0130] Step S32: if the resolution of the instrument is lower than the resolution of the spectral measurement standard device, downsample the standard spectrum to obtain a standard spectrum with the same resolution as the instrument.
[0131] In some embodiments of the present invention, step S32 includes:
[0132] The standard spectrum is decimated and downsampled.
[0133] In some embodiments of the present invention, step S32 includes:
[0134] Downsampling was performed on the standard spectra combined with field averaging.
[0135] In some embodiments of the present invention, step S32 includes:
[0136] A neighborhood is set, the neighborhood being not less than the resolution of the instrument divided by the resolution of the spectral metrology standard device. Preferably, the size of the neighborhood is 1-1.5 times the ratio of the resolution of the instrument to be calibrated divided by the resolution of the spectral metrology standard device. For example, if the resolution of the spectral metrology standard device is 0.1 wavenumber and the resolution of the target instrument is 0.5 wavenumber, the neighborhood size is 5 or 7. If the neighborhood is too small, the accuracy of the resolution alignment between the spectrum to be calibrated and the standard spectrum is reduced. If the neighborhood is too large, the amount of calculation is too large, resulting in waste.
[0137] The horizontal coordinate of the spectrum line to be calibrated is obtained, and the light intensity of the spectrum line corresponding to the standard spectrum is updated to the average light intensity in its neighborhood.
[0138] In some embodiments of the present invention, step S32 includes:
[0139] Downsampling of the standard spectrum combined with neighborhood weighting.
[0140] In some embodiments of the present invention, step S32 includes:
[0141] Set the field;
[0142] The light intensity of the horizontal coordinate of the spectral line to be calibrated on the standard spectrum is updated to the weighted average of the light intensity in its neighborhood. The weight decreases as the distance from each light intensity increases. The weight usually decreases with increasing distance, which means that values closer to the center point in the neighborhood have a greater impact on the final average result.
[0143] For the edge positions of the spectrum, i.e., the first and last values in the sequence, since they have no neighbors on both sides, only the neighbors on one side can be used for weighted average calculation.
[0144] The present invention can realize accurate calibration of a low-resolution spectral instrument to be calibrated. In practice, the discrete values of the standard spectrum after downsampling and the spectrum of the instrument to be calibrated are still different in the coordinates of the X-axis (wavelength, frequency or wave number value), so the standard spectrum after downsampling is calculated by interpolation and fitting to ensure that the X-coordinate values of the two spectral discrete sampling point sequences are exactly the same. The spectral alignment step in the present invention can also be used for spectra and spectral lines that have uneven sampling or have specific wavelengths, frequencies and wave numbers that require special calibration.
[0145] The present invention calibrates all instruments with different precision and resolution. The reference spectrum is the original spectrum of the standard material with the highest resolution and its down-sampling at different resolutions. Therefore, the spectral consistency between the instruments with different precision and resolution after calibration is guaranteed, and the calibrated spectrum is traceable to the highest national measurement standard, ensuring the accuracy of the calibration spectrum.
[0146] The present invention does not calibrate the entire spectrum through a limited number of discrete spectral lines, but rather performs multi-resolution, sequence similarity and other calculation processing methods on the full spectrum to achieve accurate calibration of the full spectrum, accurate calibration of instrument spectra with different resolutions, and accurate calibration of inter-instrument differences.
[0147] In some embodiments of the present invention, the instrument calibration method based on dynamic time and longitudinal scaling further includes:
[0148] Step S5, spectrum sub-segment division step: divide the interpolated and fitted standard spectrum and the spectrum to be calibrated into multiple sub-segments according to the spectral range, to obtain multiple spectrum sub-segments of the standard spectrum and the spectrum to be calibrated:
[0149] Wherein, a similarity matching step is performed on multiple spectrum sub-segments of the standard spectrum and the spectrum to be calibrated respectively.
[0150] The present invention performs resolution downsampling on the standard spectrum of the standard substance; aligns the discrete wavelength and frequency values of the standard spectrum with the spectrum to be calibrated through interpolation and fitting; subdivides the spectrum range into a plurality of sub-segments, and performs peak or valley normalization; performs sequence similarity analysis to obtain a mapping function of the standard spectrum sequence sub-segments and the spectrum sequence sub-segments to be calibrated; and finally merges the sub-segments to obtain a corresponding calibration mapping function relationship, so that the spectra to be measured of instruments with different error values, different precisions and resolutions are all consistent and comparable after calibration, and are consistent with the standard spectrum.
[0151] Figure 2 is a schematic diagram of a block diagram of an instrument calibration system based on dynamic time and longitudinal scaling according to the present invention, such as Figure 2 As shown, the instrument calibration system based on dynamic time and longitudinal scaling includes:
[0152] The spectrum acquisition module 10 acquires the spectrum to be calibrated of the standard material for spectrum calibration measured by the instrument to be calibrated and the standard spectrum of the standard material, wherein the horizontal coordinates of the spectrum to be calibrated and the standard spectrum are wavelength, frequency or wave number, and the vertical coordinates are light intensity;
[0153] An interpolation fitting module 30, which makes the horizontal coordinates of the standard spectrum of the standard material for spectrum calibration collected by the spectrum collection module and the spectrum to be calibrated obtained by the spectrum to be calibrated obtaining module to be calibrated the same through interpolation fitting;
[0154] The similarity matching module 50 performs similarity matching between the spectrum to be calibrated and the standard spectrum fitted by the interpolation fitting module.
[0155] In some embodiments of the present invention, the similarity matching module 50 includes:
[0156] A discrete unit 51, for obtaining discrete sequences of a standard spectrum and a spectrum to be calibrated;
[0157] A peak acquisition unit 52, for obtaining the spectrum peaks of the standard spectrum and the spectrum to be calibrated respectively;
[0158] The interval interception unit 53 uses a set percentage of the peak height as the boundaries of both sides of the peak to intercept the peak interval segment, and the remaining interval is the valley interval segment;
[0159] An inversion unit 54 inverts the valley interval segment into a peak interval segment and obtains the spectrum peak value of the peak interval segment formed by the inversion, and obtains a standard spectrum with only the peak and a spectrum to be calibrated respectively;
[0160] A baseline correction unit 55 performs baseline correction on the spectrum to be calibrated having only peaks, so that the two end values and the peak value of the standard spectrum having only peaks and the spectrum to be calibrated after baseline correction overlap with each other in the peak interval segment;
[0161] The similarity analysis unit 56 uses a dynamic time warping method to analyze the similarity between the baseline-corrected spectrum to be calibrated and the standard spectrum with only peaks, and obtains a mapping of the two spectra with the highest similarity.
[0162] In some embodiments of the present invention, the baseline correction unit 55 includes:
[0163] The interval division subunit 551 divides the peak interval of the standard spectrum and the spectrum to be calibrated into two sub-intervals according to the horizontal coordinates corresponding to the peak values, and the endpoint on the side with the smaller horizontal coordinate of the two end points and the horizontal coordinate corresponding to the peak value are used as the two end points of the first sub-interval, and the endpoint on the other side with the larger horizontal coordinate of the two end points and the horizontal coordinate corresponding to the peak value are used as the two end points of the second sub-interval;
[0164] A first updating subunit 552 updates the spectrum value of the spectrum to be calibrated of the first subinterval divided by the interval dividing subunit 551 through formulas (1)-(3);
[0165] The second updating subunit 553 updates the spectrum value of the spectrum to be calibrated in the second subinterval divided by the interval dividing subunit 551 through formulas (4)-(6).
[0166] In some embodiments of the present invention, the similarity analysis unit 56 obtains the similarity between the baseline-corrected spectrum to be calibrated and the standard spectrum with only the peak through formula (7).
[0167] In some embodiments of the present invention, the peak value acquisition unit 52 includes:
[0168] A threshold setting subunit 521 is used to set a peak distance threshold between the standard spectrum and the spectrum to be calibrated;
[0169] The spectrum peak acquisition subunit 522 obtains the spectrum peaks of the standard spectrum and the spectrum to be calibrated respectively;
[0170] The screening subunit 523 obtains a set of point pairs whose distances between the spectrum peaks of the standard spectrum and the spectrum to be calibrated are not less than a peak distance threshold.
[0171] In some embodiments of the present invention, the instrument calibration system based on dynamic time and longitudinal scaling further comprises:
[0172] A dividing module 40, which divides the standard spectrum and the spectrum to be calibrated after interpolation and fitting by the interpolation and fitting module 30 into a plurality of sub-segments to obtain a plurality of spectrum sub-segments of the standard spectrum and the spectrum to be calibrated after interpolation and fitting;
[0173] The similarity matching module 50 performs similarity analysis on the standard spectrum divided by the dividing module 30 and the multiple spectrum sub-segments of the spectrum to be calibrated.
[0174] In some embodiments of the present invention, the instrument calibration system based on dynamic time and longitudinal scaling further comprises:
[0175] The resolution adjustment module 20 adjusts the resolution of the instrument and the spectral measurement standard device to the same resolution.
[0176] In some embodiments of the present invention, the resolution adjustment module 20 includes:
[0177] A comparison unit 21, comparing the resolution of the instrument with that of a spectral metrology standard device;
[0178] The down-sampling unit 22 down-samples the standard spectrum to obtain a standard spectrum with the same resolution as the instrument if the resolution of the instrument is lower than the resolution of the spectrum measurement standard device.
[0179] The above-mentioned instrument calibration methods based on dynamic time and longitudinal scaling of the present invention can be applied to the electronic device 1. Figure 3 , which is a schematic diagram of the application environment of a preferred embodiment of the instrument calibration method based on dynamic time and longitudinal scaling of the present invention.
[0180] In this embodiment, the electronic device 1 may be a terminal device with computing functions, such as a server, a smart phone, a tablet computer, a portable computer, or a desktop computer.
[0181] The electronic device 1 includes: a processor 12 and a memory 11 , and may also include a network interface 13 , a communication bus 14 and the like.
[0182] The memory 11 includes at least one type of readable storage medium. The at least one type of readable storage medium may be a non-volatile storage medium such as a flash memory, a hard disk, a multimedia card, a card-type memory, etc. In some embodiments, the readable storage medium may be an internal storage unit of the electronic device 1, such as a hard disk of the electronic device 1. In other embodiments, the readable storage medium may also be an external memory of the electronic device 1, such as a plug-in hard disk equipped on the electronic device 1, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc.
[0183] In this embodiment, the readable storage medium of the memory 11 is generally used to store the instrument calibration program 110 based on dynamic time and longitudinal scaling, standard materials and data sets of standard materials installed in the electronic device 1. The memory 11 can also be used to temporarily store data that has been output or is to be output.
[0184] In some embodiments, the processor 12 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 11, such as executing an instrument calibration program 110 based on dynamic time and longitudinal scaling.
[0185] The network interface 13 may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is generally used to establish a communication connection between the electronic device 1 and other electronic devices.
[0186] The communication bus 14 is used to realize the connection and communication between these components.
[0187] Figure 3The electronic device 1 is shown only with components 11 - 14 , but it should be understood that implementation of all of the components shown is not required, and more or fewer components may alternatively be implemented.
[0188] Optionally, the electronic device 1 may further include a user interface, which may include an input unit such as a keyboard, a voice input device such as a microphone and other devices with voice recognition function, a voice output device such as a speaker, headphones, etc. Optionally, the user interface may also include a standard wired interface or a wireless interface.
[0189] Optionally, the electronic device 1 may further include a display, which may also be referred to as a display screen or a display unit. In some embodiments, it may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an organic light-emitting diode (OLED) touch device. The display is used to display information processed in the electronic device 1 and to display a visual user interface.
[0190] Optionally, the electronic device 1 further includes a touch sensor. The area provided by the touch sensor for the user to perform a touch operation is called a touch control area. In addition, the touch sensor described here may be a resistive touch sensor, a capacitive touch sensor, etc. Moreover, the touch sensor includes not only a contact touch sensor, but also a proximity touch sensor, etc. In addition, the touch sensor may be a single sensor or a plurality of sensors arranged in an array, for example.
[0191] In addition, the area of the display of the electronic device 1 can be the same as or different from the area of the touch sensor. Optionally, the display and the touch sensor are stacked to form a touch display screen. The device detects touch operations triggered by the user based on the touch display screen.
[0192] Optionally, the electronic device 1 may further include a radio frequency (RF) circuit, a sensor, an audio circuit, etc., which will not be described in detail here.
[0193] In addition, an embodiment of the present invention also provides a computer-readable storage medium, which includes an instrument calibration program based on dynamic time and longitudinal scaling. When the instrument calibration program based on dynamic time and longitudinal scaling is executed by a processor, the steps of the instrument calibration method based on dynamic time and longitudinal scaling of the above-mentioned embodiments are implemented.
[0194] The specific implementation of the computer-readable storage medium of the present invention is substantially the same as the specific implementation of the instrument calibration method and electronic device based on dynamic time and longitudinal scaling described above, and will not be described in detail herein.
[0195] The present invention aims at spectral measuring instruments to be calibrated with different system errors and different resolutions. By converting different accuracies and resolutions, the present invention can establish a calibration relationship of the spectral lines of the spectrum to be calibrated corresponding to the standard spectrum at the same resolution at each pixel (sampling point) in the full spectral range, and ensure the consistency of the spectra after calibration between different instruments.
[0196] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0197] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0198] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0199] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0200] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0201] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The second and other words are used to indicate names, but not to indicate any particular order.
[0202] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. An instrument calibration method based on dynamic time and longitudinal scaling, characterized in that: include: The spectrum to be calibrated is obtained by an instrument, wherein the spectrum to be calibrated of the standard material for spectrum calibration is obtained by an instrument, wherein the abscissa of the spectrum to be calibrated is the wavelength, frequency or wave number, and the ordinate is the light intensity; Interpolation fitting step: making the horizontal coordinates of the spectrum to be calibrated and the standard spectrum of the standard substance for spectrum calibration the same through interpolation fitting; Similarity matching step: performing similarity matching on the standard spectrum and the spectrum to be calibrated after interpolation fitting; The similarity matching step includes: respectively obtaining discrete sequences of standard spectra and spectra to be calibrated; respectively obtaining the spectral peaks of the standard spectrum and the spectrum to be calibrated; The peak height of the set percentage is used as the boundaries on both sides of the peak, the peak interval segment is intercepted, and the remaining interval is the valley interval segment; Invert the valley interval segment into the peak interval segment and obtain the spectrum peak value of the peak interval segment formed by the inversion, and obtain the standard spectrum with only the peak and the spectrum to be calibrated respectively; Performing baseline correction on the spectrum to be calibrated having only the peak, so that the two end values and the peak value of the standard spectrum having only the peak and the spectrum to be calibrated after baseline correction overlap with each other in the peak interval segment; The dynamic time warping method is used to analyze the similarity between the spectrum to be calibrated after baseline correction and the standard spectrum with only peaks, and the mapping of the two spectra with the highest similarity is obtained; The step of performing baseline correction on the spectrum to be calibrated having only a peak comprises: Baseline correction is performed on the peak interval segments of the standard spectrum and the spectrum to be calibrated one by one, so that the ordinate values corresponding to the two end points of the peak interval segments of the standard spectrum and the spectrum to be calibrated coincide with the peak values; The step of performing baseline correction on the peak interval segments of the standard spectrum and the spectrum to be calibrated one by one so that the ordinate values corresponding to the two end points of the peak interval segments of the standard spectrum and the spectrum to be calibrated coincide with the peak values includes: The peak interval of the standard spectrum and the spectrum to be calibrated is divided into two sub-intervals according to the abscissa corresponding to the peak value, the endpoint with the smaller abscissa of the two end points and the abscissa corresponding to the peak value are used as the two end points of the first sub-interval, and the endpoint with the larger abscissa of the two end points and the abscissa corresponding to the peak value are used as the two end points of the second sub-interval; The spectral value of the spectrum to be calibrated in the first sub-interval is updated by the following formula: in, is the first sub-interval of the spectrum to be calibrated, is the interval of the calibration spectrum corresponding to the first subinterval, is the abscissa index of the first subinterval, , is the horizontal coordinate of the spectrum to be calibrated The corresponding spectral value, is the horizontal coordinate of the spectrum to be calibrated after baseline calibration The corresponding spectral value, is the slope calibration of the first sub-interval of the spectrum to be calibrated, is the deviation calibration of the first sub-interval of the spectrum to be calibrated, and are the spectral values corresponding to the two end points of the first sub-interval of the spectrum to be calibrated, and are the spectral values corresponding to the two end points of the standard spectrum and the first sub-interval respectively; The spectral value of the spectrum to be calibrated in the second sub-interval is updated by the following formula: in, is the second sub-interval of the spectrum to be calibrated, is the interval of the calibration spectrum corresponding to the second subinterval, is the horizontal coordinate index of the second subinterval, , is the horizontal coordinate of the spectrum to be calibrated The corresponding spectral value, is the horizontal coordinate of the spectrum to be calibrated after baseline calibration The corresponding spectral value, is the slope calibration for the second sub-interval of the spectrum to be calibrated, For the second sub-interval deviation calibration of the spectrum to be calibrated, and are the spectral values corresponding to the two end points of the second sub-interval of the spectrum to be calibrated, and are the spectral values corresponding to the two end points of the standard spectrum and the corresponding interval of the second sub-interval respectively; The step of using the dynamic time warping method to analyze the similarity between the baseline-corrected spectrum to be calibrated and the standard spectrum with only peaks comprises: The similarity between the baseline-corrected spectrum to be calibrated and the standard spectrum with only peaks is obtained by the following formula: The discrete sequences of the peak interval segments of the standard spectrum and the spectrum to be calibrated are A i and B j , D ( A i,x , B j,y )represent A i Interval sequence x Points and B j Interval sequence y The shortest distance between points; D Is a sequence A i and B j The two-dimensional matrix composed of , for A i Interval sequence x The spectral value of each point, for B j Interval sequence y The spectral value of a point.
2. The instrument calibration method based on dynamic time and longitudinal scaling according to claim 1, characterized in that: In the step of using a set percentage of the peak height as the boundaries on both sides of the peak, the set percentage is 5%.
3. The instrument calibration method based on dynamic time and longitudinal scaling according to claim 1, characterized in that: The steps of respectively obtaining the spectral peaks of the standard spectrum and the spectrum to be calibrated include: Setting the peak distance threshold between the standard spectrum and the spectrum to be calibrated; A set of point pairs whose distances between the spectral peaks of the standard spectrum and the spectrum to be calibrated are not less than a peak distance threshold is obtained.
4. The instrument calibration method based on dynamic time and longitudinal scaling according to claim 3, characterized in that: The step of respectively obtaining the spectral peaks of the standard spectrum and the spectrum to be calibrated further comprises: Delete isolated peak points whose distance is greater than the peak distance threshold.
5. The instrument calibration method based on dynamic time and longitudinal scaling according to claim 1, characterized in that: Also includes: The standard spectrum of the standard substance is measured by a spectral metrology standard device.
6. The instrument calibration method based on dynamic time and longitudinal scaling according to claim 5, characterized in that: Also includes: Compare the resolution of the instrument with that of a spectral metrology standard; If the resolution of the instrument is lower than the resolution of the spectral metrology standard device, the standard spectrum is downsampled to obtain a standard spectrum with the same resolution as the instrument.
7. The instrument calibration method based on dynamic time and longitudinal scaling according to claim 6, characterized in that: The step of downsampling the standard spectrum comprises: The standard spectrum is decimated and downsampled.
8. The instrument calibration method based on dynamic time and longitudinal scaling according to claim 6, characterized in that: The step of downsampling the standard spectrum comprises: Downsampling of the standard spectrum combined with neighborhood averaging.
9. The instrument calibration method based on dynamic time and longitudinal scaling according to claim 6, characterized in that: The step of downsampling the standard spectrum comprises: Downsampling of the standard spectrum combined with neighborhood weighting.
10. The instrument calibration method based on dynamic time and longitudinal scaling according to any one of claims 1 to 9, characterized in that: The similarity matching step also includes: Spectrum sub-segment division step: divide the interpolation-fitted standard spectrum and the spectrum to be calibrated into multiple sub-segments according to the spectral range, and obtain multiple spectral sub-segments of the standard spectrum and the spectrum to be calibrated: Wherein, a similarity matching step is performed on multiple spectrum sub-segments of the standard spectrum and the spectrum to be calibrated respectively.
11. An instrument calibration system based on dynamic time and longitudinal scaling, characterized in that: include: A spectrum acquisition module, which acquires a spectrum to be calibrated of a standard substance for spectrum calibration measured by the instrument to be calibrated and a standard spectrum of the standard substance, wherein the horizontal coordinates of the spectrum to be calibrated and the standard spectrum are wavelength, frequency or wave number, and the vertical coordinates are light intensity; An interpolation fitting module, which makes the horizontal coordinates of the standard spectrum of the standard material for spectrum calibration collected by the spectrum collection module and the spectrum to be calibrated obtained by the spectrum to be calibrated obtaining module to be calibrated the same through interpolation fitting; A similarity matching module performs similarity matching between the spectrum to be calibrated and the standard spectrum fitted by the interpolation fitting module; Wherein, the similarity matching module includes: A discrete unit, for obtaining discrete sequences of a standard spectrum and a spectrum to be calibrated; A peak acquisition unit is used to obtain the spectrum peaks of the standard spectrum and the spectrum to be calibrated; The interval interception unit uses the peak height of a set percentage as the boundaries on both sides of the peak to intercept the peak interval segment, and the remaining interval is the valley interval segment; An inversion unit inverts the valley interval segment into a peak interval segment and obtains the spectrum peak value of the peak interval segment formed by the inversion, and obtains a standard spectrum with only the peak and a spectrum to be calibrated respectively; A baseline correction unit performs baseline correction on the spectrum to be calibrated having only a peak, so that the two end values and the peak value of the standard spectrum having only a peak and the spectrum to be calibrated after baseline correction overlap with each other in the peak interval segment; The similarity analysis unit uses a dynamic time warping method to analyze the similarity between the spectrum to be calibrated after baseline correction and the standard spectrum with only peaks, and obtains a mapping of the two spectra with the highest similarity; Wherein, the baseline correction unit comprises: The interval division subunit divides the peak interval of the standard spectrum and the spectrum to be calibrated into two sub-intervals according to the horizontal coordinates corresponding to the peak values, and the endpoint on the side with the smaller horizontal coordinate of the two end points and the horizontal coordinate corresponding to the peak value are used as the two end points of the first sub-interval, and the endpoint on the other side with the larger horizontal coordinate of the two end points and the horizontal coordinate corresponding to the peak value are used as the two end points of the second sub-interval; The first updating subunit updates the spectrum value of the spectrum to be calibrated of the first subinterval divided by the interval dividing subunit by the following formula: in, is the first sub-interval of the spectrum to be calibrated, is the interval of the calibration spectrum corresponding to the first subinterval, is the abscissa index of the first subinterval, , is the horizontal coordinate of the spectrum to be calibrated The corresponding spectral value, is the horizontal coordinate of the spectrum to be calibrated after baseline calibration The corresponding spectral value, is the slope calibration of the first sub-interval of the spectrum to be calibrated, is the deviation calibration of the first sub-interval of the spectrum to be calibrated, and are the spectral values corresponding to the two end points of the first sub-interval of the spectrum to be calibrated, and are the spectral values corresponding to the two end points of the standard spectrum and the first sub-interval respectively; The second updating subunit updates the spectrum value of the spectrum to be calibrated of the second subinterval divided by the interval dividing subunit by the following formula: in, is the second sub-interval of the spectrum to be calibrated, is the interval of the calibration spectrum corresponding to the second subinterval, is the horizontal coordinate index of the second subinterval, , is the horizontal coordinate of the spectrum to be calibrated The corresponding spectral value, is the horizontal coordinate of the spectrum to be calibrated after baseline calibration The corresponding spectral value, is the slope calibration for the second sub-interval of the spectrum to be calibrated, For the second sub-interval deviation calibration of the spectrum to be calibrated, and are the spectral values corresponding to the two end points of the second sub-interval of the spectrum to be calibrated, and are the spectral values corresponding to the two end points of the standard spectrum and the corresponding interval of the second sub-interval respectively; The similarity analysis unit obtains the similarity between the baseline-corrected spectrum to be calibrated and the standard spectrum with only the peaks by the following formula: The discrete sequences of the peak interval segments of the standard spectrum and the spectrum to be calibrated are A i and B j , D ( A i,x , B j,y )represent A i Interval sequence x Points and B j Interval sequence y The shortest distance between points; D Is a sequence A i and B j The two-dimensional matrix composed of , for A i Interval sequence x The spectral value of each point, for B j Interval sequence y The spectral value of a point.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes an instrument calibration program based on dynamic time and longitudinal scaling. When the instrument calibration program based on dynamic time and longitudinal scaling is executed by a processor, the steps of the instrument calibration method based on dynamic time and longitudinal scaling as described in any one of claims 1-10 are implemented.
13. An electronic device, characterized in that: It comprises a memory and a processor, wherein the memory comprises an instrument calibration program based on dynamic time and longitudinal scaling, and when the instrument calibration program based on dynamic time and longitudinal scaling is executed by the processor, the steps of the instrument calibration method based on dynamic time and longitudinal scaling as described in any one of claims 1-10 are implemented.
Citation Information
Patent Citations
Reconstruction of frequency registration deviations for quantitative spectroscopy
CN107923794A
Method for display of spectrum on computer system
JP1996286656A