Rapid peak searching method for monochromator calibration
Through sliding window cross-correlation operation and mask file matching, the problem of inefficient threshold method in monochromator calibration is solved, efficient and accurate target peak detection is achieved, and the accuracy and efficiency of monochromator calibration is ensured.
Patent Information
- Application Number
- CN202411132538.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-11-26
AI Technical Summary
In the existing monochromator calibration method, the peak search algorithm based on threshold is inefficient, and it is impossible to effectively distinguish the characteristic peaks of mercury argon lamps from non-target peaks, resulting in the need of secondary screening and the characteristic peak intensity within the low grating diffraction efficiency range. Below the non-target peak, affecting availability.
Use sliding window cross-correlation operation to match the template file, determine the most relevant position through the cross-correlation operation result, generate a mask file and multiply it with the peak file to be found, filter out the target peak and noise data, accurately locate the target peak, and calibrate it The bimodal interval length is used to determine the bimodal position to ensure the accuracy of detection.
It realizes efficient and accurate target peak detection, reduces the leakage detection rate, improves detection speed and efficiency, can identify weak target peaks and eliminate non-target peaks, and the results are accurate and easy to use.
Smart Images

Figure CN119025860A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of monochromator calibration, in particular to a fast peak-finding method for monochromator calibration. Background Art
[0002] A monochromator is an instrument that produces monochromatic light through a spectroscopic element. Monochromator calibration is a necessary process in the development of a monochromator. The main purpose of monochromator calibration is to match the number of pulses of the stepper motor that controls the movement of the monochromator grating turret with the actual wavelength. The main method of monochromator calibration is to use the monochromator to scan the characteristic spectrum of a mercury-argon lamp, find the peak of the scanned spectrum, and fit the wavelength of the characteristic spectrum and its corresponding pulse, so that the monochromator can output the correct wavelength.
[0003] The existing peak-finding method is mainly based on the threshold-based peak-finding algorithm. However, this method has the following defects: on the one hand, it can only detect all spectral peaks above the threshold, and if the threshold is not selected properly, the target peak may be missed; on the other hand, it is impossible to separate the characteristic peaks of the mercury-argon lamp obtained by scanning and the non-target peaks caused by other reasons (stray light, high-order diffraction, ambient light, etc.). However, there will be many target peaks and non-target peaks in the actual scanning process, which requires secondary screening of the detected peaks, resulting in low efficiency of this method; and in the wavelength range where the grating diffraction efficiency is low, the characteristic peak intensity of the mercury-argon lamp may be lower than the intensity of the non-target peak, further reducing the usability of this peak-finding method.
[0004] Based on the above, the present invention needs to design a high-efficiency peak-finding method for the calibration of the monochromator scanning mercury-argon lamp to solve the above-mentioned defects. Summary of the invention
[0005] The purpose of the present invention is to overcome the above-mentioned deficiencies in the prior art and to provide a rapid peak-finding method for monochromator calibration which is simple to implement, highly efficient and highly accurate in detection.
[0006] The technical solution of the present invention is: a rapid peak finding method for monochromator calibration, comprising the following steps:
[0007] S1: Use a monochromator to scan the wavelength data of the mercury-argon lamp, calibrate the wavelength and pulse corresponding to the characteristic peak of the mercury-argon lamp, and obtain a template file that only retains the characteristic peak position data;
[0008] S2: Establishing a sliding window, performing sliding window cross-correlation operation on the template file and the file to be peak-finded, and obtaining a correlation operation result;
[0009] S3: Obtaining the maximum value in the correlation operation result to determine the sliding window value corresponding to the most relevant position between the template file and the file to be found;
[0010] S4: setting all non-zero values on the template file to 1, moving the template file to the most relevant position relative to the file to be peak-finded according to the sliding window value, and padding the template file with zeros to the same size as the file to be peak-finded to serve as a mask file;
[0011] S5: multiplying the mask file by the corresponding position of the peak-to-be-searched file, filtering out non-target peaks and noise data in the peak-to-be-searched file, and then the remaining peaks in the peak-to-be-searched file are target peaks.
[0012] Furthermore, in S1, the wavelength and pulse corresponding to the characteristic peak of the mercury-argon lamp are manually calibrated, the characteristic peak data of interest is retained, and all data values except the characteristic peak of interest are set to 0 to obtain a template file.
[0013] Further, in S2, the cross-correlation operation is obtained by the following formula:
[0014]
[0015] Where: R(x) is the correlation value function of the template file and the file to be found, T(i) is the spectral intensity of the template file, i is the index number, I(x+i) is the spectral intensity of the file to be found, x is the sliding window value of the template file and the file to be found; the sequence length of I is greater than the sequence length of T.
[0016] Further, in S3, the maximum value is obtained by the following formula:
[0017] index=max(R(x))
[0018] Where index is the index value corresponding to the maximum value position of the obtained correlation operation result sequence; R(x) is the correlation value function of the template file and the peak file to be found, and each position corresponds to a correlation value; x is the sliding window value of the template file and the peak file to be found.
[0019] Furthermore, the method further includes step S6: calibrating the single peak and double peak of the characteristic peak in S1, and judging whether there is a double peak in the region by judging the length of each interval.
[0020] Furthermore, in S1, the calibrated characteristic peaks include double peaks and single peaks, the data lengths of the single peak interval and the double peak interval are set, and the data length of the double peak interval includes the data lengths of two complete characteristic peaks. At this time, the non-zero interval of the double peak position is larger than the non-zero interval of the single peak position. By judging the data length of each interval, it is determined whether there is a double peak in the area.
[0021] Furthermore, the data length of the unimodal interval takes the maximum value in the unimodal data, and the data length of the bimodal interval takes the two largest peaks.
[0022] Furthermore, in S1, a monochromator is used to scan a mercury-argon lamp to obtain a spectrum, in which the horizontal axis is the number of pulses of the monochromator stepper motor and the vertical axis is the intensity value of the monochromator detector; the characteristic spectrum line of the mercury-argon lamp itself is used as a standard file, and characteristic peaks of interest are selected from the standard file and marked in the spectrum, and all data values except the characteristic peaks of interest are set to 0, and several non-zero intervals are the locations of the characteristic peaks.
[0023] Further, in S3, the sliding window value is the horizontal axis coordinate value corresponding to the maximum value in the spectrum graph.
[0024] Beneficial effects of the present invention:
[0025] (1) The template file is cross-correlatedly matched with the peak file to be found, and the most relevant positions of the template file and the peak file to be found are determined. A mask file is obtained based on the template file and the most relevant positions. The mask file and the peak file to be found are then multiplied to remove non-target peak data and noise data. This solves the problem that the existing method cannot distinguish between the characteristic peak and non-target peak of the mercury argon lamp and requires secondary screening of the target peak, so that the target peak signal can be detected even if it is very weak, and the non-target peak is not detected. In addition, the result is accurate, easy to use, simple to implement, fast detection speed, and high detection efficiency.
[0026] (2) By multiplying the peak file to be found and the mask file, multiple small intervals containing the target peak will be obtained, and the target peak corresponds to the maximum value in the small interval. Therefore, even if the target peak is very weak, it can be detected by finding the maximum value;
[0027] (3) When making the template file, the peaks at the double peak position are taken complete, and the data length of the single peak interval and the double peak interval is set. The length of each small area is further judged to determine whether there is a double peak in the area, thereby accurately determining the double peak position and greatly reducing the missed detection rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 Schematic diagram of the peak search process of an embodiment of the present invention, wherein a. a file to be searched for peaks, b. a template file, c. a mask file, d. a final peak search result;
[0029] Figure 2 This is a spectrum diagram obtained by scanning a mercury-argon lamp with a monochromator according to an embodiment of the present invention;
[0030] Figure 3 is the characteristic spectrum line of the mercury-argon lamp itself in the embodiment of the present invention;
[0031] Figure 4 yes Figure 1 An enlarged schematic diagram of the template file b of the illustrated embodiment;
[0032] Figure 5is a schematic diagram comparing a bimodal interval and a unimodal interval in a template file of an embodiment of the present invention;
[0033] Figure 6 yes Figure 1 An enlarged schematic diagram of the peak-finding file a in the illustrated embodiment;
[0034] Figure 7 is a schematic diagram of correlation values of a to-be-searched peak file and a template file at each index position according to an embodiment of the present invention;
[0035] Figure 8 is a schematic diagram for comparing a mask file without 0-filling and a file to be peak-finded in an embodiment of the present invention;
[0036] Fig. 9 yes Figure 1 An enlarged schematic diagram of the final peak search result d of the embodiment shown;
[0037] Fig.10 It is a schematic diagram illustrating the final peak search result according to an embodiment of the present invention. DETAILED DESCRIPTION
[0038] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0039] Example 1
[0040] like Figure 1 As shown, a rapid peak finding method for monochromator calibration specifically comprises the following steps:
[0041] S101: Use a monochromator to scan the wavelength data of the mercury-argon lamp, calibrate the wavelength and pulse corresponding to the characteristic peak of the mercury-argon lamp, and obtain a template file that only retains the characteristic peak position data.
[0042] Specifically, this embodiment uses a monochromator to scan a mercury-argon lamp to obtain a spectrum, such as Figure 2 shown. Figure 2 The horizontal axis is the pulse number of the monochromator stepper motor, and the vertical axis is the intensity value of the monochromator detector. The scanning position is determined by the pulse number of the monochromator stepper motor, and the spectral intensity is obtained by the intensity value of the detector. Figure 3 It is the characteristic spectrum line of the mercury-argon lamp itself, which serves as a standard file, that is, the standard light source wavelength file.
[0043] Manually mark out Figure 2 Zhongyu Figure 3 That is, select the characteristic peak of interest from the standard file. Figure 2 Mark them in the image, and set all data values except the characteristic peaks of interest to 0, so that several non-zero small intervals are obtained, which are the locations of the characteristic peaks, such as Figure 4As shown in the figure, this figure is a template file. Only the data at the characteristic peak position is retained, and the data of non-characteristic peaks are all set to 0.
[0044] Among the marked characteristic peaks, there are two double peaks in the mercury-argon lamp, corresponding to Figure 3 The double peak position refers to the area in the spectrum where the two peaks are very close but not completely overlapped, such as Figure 5 As shown. In order to better identify the position of the double peak, the peak of the double peak position is taken complete when making the template file, that is, when making the template file, the entire characteristic peak area in the double peak area is included, rather than just the peak position of the characteristic peak, to ensure that the template file contains the width of the entire double peak, which means that you not only record the peak position, but also the front and back parts of the peak, so as to retain all relevant information of the peak in the template file for accurate identification and analysis, improve the accuracy of double peak identification, and avoid identification errors caused by ignoring the peak area. After taking the complete, the non-zero interval of the double peak position will be larger than the non-zero interval of other single peaks.
[0045] In addition, the data length of the unimodal interval and the bimodal interval is set, wherein the data length of the unimodal interval takes the maximum value of the unimodal data, and the data length of the bimodal interval includes the data length of two complete characteristic peaks. Preferably, the data length of the unimodal interval is 21, and the data length of the bimodal interval is 31, and the specific length can be set according to the actual situation.
[0046] S102: Establish a sliding window, and perform sliding window cross-correlation operation on the template file and the file to be peak-finded to obtain a correlation operation result.
[0047] Specifically, first select a window size and align it with the template file; the sliding window moves step by step on the peak file to be found, each time moving a predetermined step size, and for each window position, calculate the correlation value between the data in the window and the template file, which represents the matching degree of the template at the window position; when the window slides, save the correlation value at each position into a one-dimensional array, which shows the matching degree of the template at different positions. It can be said that the result of the correlation operation is a one-dimensional array, and each element in the array represents the similarity between the template file and the peak file to be found at different positions, so as to facilitate finding features matching the template in the data to be processed.
[0048] Among them, Figure 6 As shown, the peak file to be found is also obtained by scanning the characteristic spectrum line of the mercury-argon lamp with a monochromator.
[0049] like Figure 7 As shown: The cross-correlation operation is obtained by the following formula:
[0050]
[0051] Where: R(x) is the correlation function between the template file and the file to be found, T(i) is the spectral intensity of the template file, i is the index number, I(x+i) is the spectral intensity of the file to be found, and x is the sliding window value of the template file and the file to be found. The sequence length of I needs to be greater than the sequence length of T.
[0052] The main principle of the algorithm is to perform correlation operations on the template file that has been marked with the characteristic peaks and pulses of the mercury-argon lamp and the file of the peak to be found obtained by scanning, and obtain the position of the target peak by finding the most relevant position.
[0053] S103: Obtain the maximum value in the one-dimensional array to determine the sliding window value x corresponding to the most relevant position between the template file and the file to be peak-searched.
[0054] Specifically, the x value is Figure 7 The horizontal coordinate value corresponding to the maximum value at the circle is the pulse value of the stepper motor when the monochromator is scanning. The maximum value in the one-dimensional array is obtained by the following formula:
[0055] index=max(R(x)) (2)
[0056] Where: index is the index value corresponding to the maximum value position of the obtained correlation value sequence; R(x) is the correlation value function obtained by the peak file to be found and the template file through formula (1), and each position corresponds to a correlation value; max is the maximum value operation.
[0057] S104: Set all non-zero values on the template file to 1, move the template file to the most relevant position relative to the peak file to be found according to the sliding window value x, and fill the template file with zeros to the same size as the peak file to be found as a mask file.
[0058] Specifically, Figure 1 and Figure 8As shown: The mask file is derived from the template file, and its purpose is to filter out all non-target peaks and noise signals in the peak file to be found. The method of making a mask file is as follows: set all non-zero values on the template file to 1, and move the template file to the most relevant position relative to the peak file to be found according to the x value. Since the template file only records the data from the first characteristic peak to the last characteristic peak, and the monochromator without wavelength calibration does not know the correct pulse value corresponding to the first characteristic peak to the last characteristic peak when scanning, a pulse range covering all characteristic peaks will be scanned during scanning, which results in the actual scanned spectral line pulse range being larger than the pulse range of the template file, that is, the data length of the peak file to be found is larger than the data length of the template file. In order to multiply the mask file and the peak file to be found to remove non-target peak data and noise data, their data lengths need to be consistent, so the template file is padded with 0s to the same size as the peak file to be found to obtain the mask file.
[0059] S105: Multiply the mask file by the corresponding position of the file to be found, filter out non-target peaks and noise data in the file to be found, and then the remaining peaks in the file to be found are target peaks.
[0060] The reason why the corresponding positions of the mask file and the peak file to be found are multiplied in this embodiment is that the positions of non-target peaks in the mask file are all 0, so after multiplication, the non-target peaks and noise signals in the peak file to be found are all changed to 0, so that many small intervals containing characteristic peaks are obtained. At this time, the remaining peaks in the peak file to be found are the target peaks, such as Fig. 9 and Fig.10 shown.
[0061] S106: Calibration of single peak and double peak.
[0062] According to the standard document of mercury-argon lamp, it is known that there are two double peaks at wavelengths of 404nm, 407nm and 576nm, 579nm. In step S101, the data length of the single peak and double peak intervals is set, and the length of each small area is judged to determine whether there is a double peak in the area. For example: assuming that the data length of the single peak interval is 21, and the data length of the double peak interval is 31, if the length of a certain interval is equal to 21, it is judged to be a single peak area, otherwise it is a double peak area.
[0063] In summary, the present invention solves the problem that the existing method proposed by the present invention cannot distinguish the characteristic peak and non-target peak of the mercury argon lamp and needs secondary screening of the target peak by combining the cross-correlation operation with the mask method. It also solves the problem that the threshold-based peak finding algorithm filters out the target peak but retains the non-target peak when the threshold is not selected appropriately, so that the target peak signal can be detected even if it is very weak, the double peak position is not missed, and the non-target peak is not detected. The result is accurate, easy to use, simple to implement, fast detection speed and high detection efficiency.
Claims
1. A rapid peak finding method for monochromator calibration, characterized in that: The following steps are involved: S1: Use a monochromator to scan the wavelength data of the mercury-argon lamp, calibrate the wavelength and pulse corresponding to the characteristic peak of the mercury-argon lamp, and obtain a template file that only retains the characteristic peak position data; S2: Establishing a sliding window, performing sliding window cross-correlation operation on the template file and the file to be peak-finded, and obtaining a correlation operation result; S3: Obtaining the maximum value in the correlation operation result to determine the sliding window value corresponding to the most relevant position between the template file and the file to be found; S4: setting all non-zero values on the template file to 1, moving the template file to the most relevant position relative to the file to be peak-finded according to the sliding window value, and padding the template file with zeros to the same size as the file to be peak-finded to serve as a mask file; S5: multiplying the mask file by the corresponding position of the peak-to-be-searched file, filtering out non-target peaks and noise data in the peak-to-be-searched file, and then the remaining peaks in the peak-to-be-searched file are target peaks.
2. The rapid peak finding method for monochromator calibration according to claim 1, characterized in that: In S1, the wavelength and pulse corresponding to the characteristic peak of the mercury-argon lamp are manually calibrated, the characteristic peak data of interest is retained, and all data values except the characteristic peak of interest are set to 0 to obtain a template file.
3. The rapid peak finding method for monochromator calibration according to claim 1 or 2, characterized in that: In S2, the cross-correlation operation is obtained by the following formula: Where: R(x) is the correlation function between the template file and the file to be found, T(i) is the spectral intensity of the template file, i is the index number, I(x+i) is the spectral intensity of the file to be found, and x is the sliding window value of the template file and the file to be found; The sequence length of I is greater than the sequence length of T.
4. The rapid peak finding method for monochromator calibration according to claim 3, characterized in that: In S3, the maximum value is obtained by the following formula: index=max(R(x)) Where index is the index value corresponding to the maximum value position of the obtained correlation operation result sequence; R(x) is the correlation value function of the template file and the peak file to be found, and each position corresponds to a correlation value; x is the sliding window value of the template file and the peak file to be found.
5. The rapid peak finding method for monochromator calibration according to claim 1 or 2, characterized in that: The step also includes step S6: calibrating the single peak and double peak of the characteristic peak in S1, and judging whether there is a double peak in the area by judging the length of each interval.
6. The rapid peak finding method for monochromator calibration according to claim 5, characterized in that: In S1, the calibrated characteristic peaks include double peaks and single peaks, the data lengths of the single peak interval and the double peak interval are set, and the data length of the double peak interval includes the data lengths of two complete characteristic peaks. At this time, the non-zero interval of the double peak position is larger than the non-zero interval of the single peak position. By judging the data length of each interval, it is determined whether there is a double peak in the area.
7. The rapid peak-finding method for monochromator calibration according to claim 6, characterized in that: The data length of the unimodal interval is the maximum value of the unimodal data, and the data length of the bimodal interval is the two largest peaks.
8. The rapid peak-finding method for monochromator calibration according to claim 2, characterized in that: In S1, a monochromator is used to scan a mercury-argon lamp to obtain a spectrum, in which the horizontal axis is the pulse number of the monochromator stepper motor and the vertical axis is the intensity value of the monochromator detector. The characteristic spectrum line of the mercury-argon lamp itself is used as a standard file, and characteristic peaks of interest are selected from the standard file and marked in the spectrum. All data values except the characteristic peaks of interest are set to 0, and several non-zero intervals are the locations of the characteristic peaks.
9. The rapid peak-finding method for monochromator calibration according to claim 8, characterized in that: In S3, the sliding window value is the horizontal axis coordinate value corresponding to the maximum value in the spectrum graph.
