A method for detecting quality of fiber grating based on symmetry discrimination
By preprocessing and locally fitting spectral data, combined with relative symmetry error calculation, and dynamically setting the symmetry discrimination threshold, efficient and accurate detection of fiber grating quality is achieved, solving the problems of strong subjectivity and low detection efficiency in existing technologies.
Patent Information
- Application Number
- CN202611156989.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-31
- Publication Date
- 2026-11-24
AI Technical Summary
Existing fiber Bragg grating quality inspection methods suffer from high subjectivity, low inspection efficiency, and insensitivity to local distortions. In particular, when the spectral peak shape is skewed, distorted, the side lobes are abnormal, or there is local asymmetry, it is difficult to accurately judge the quality of the fiber Bragg grating.
By acquiring and preprocessing spectral data, local fitting is performed using Savitzky-Golay smoothing filtering and a Gaussian-Lorentz mixture model. The relative symmetry error is calculated and a dynamic symmetry discrimination threshold is set. The quality of the fiber grating is determined based on the symmetry score.
It improves the accuracy and efficiency of fiber Bragg grating quality inspection, reduces the impact of noise on inspection, reduces the subjectivity of manual judgment, and enhances the sensitivity to local distortion.
Smart Images

Figure CN123155160A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of spectral signal processing technology, and in particular to a fiber optic grating quality detection method based on symmetry discrimination. Background Technology
[0002] Fiber Bragg gratings (FBGs) are widely used in sensing, communication, and structural health monitoring. The quality of a FBG directly affects its center wavelength identification accuracy, reflection intensity stability, and the reliability of subsequent demodulation results.
[0003] Current fiber Bragg grating quality inspection typically relies on manual observation of parameters such as spectral curves, center wavelength shift, peak intensity, or full width at half maximum (FWHM). These methods suffer from high subjectivity, low efficiency, and insensitivity to local distortions. Ideal or high-quality fiber Bragg gratings usually exhibit good left-right symmetry near their spectral peaks; however, processing defects, uneven writing, abnormal encapsulation stress, optical path interference, or damage can lead to spectral peak skewness, distortion, abnormal sidelobes, or local asymmetry. Summary of the Invention
[0004] The purpose of this invention is to address the problems of high subjectivity, low efficiency, and insensitivity to noise in manual fiber grating quality inspection, and to propose a fiber grating quality inspection method based on symmetry discrimination, comprising the following steps: S1. Acquire the spectral data of the fiber grating to be tested, preprocess the spectral data, and obtain the preprocessed spectral data. S2. Locate the peak center of the preprocessed spectral data; S3. Within a set wavelength range with the peak center as the midpoint, according to a preset wavelength interval sequence, starting from the peak center, sample several pairs of points on both sides of the peak center of the preprocessed spectral data, calculate the relative symmetry error of each pair of sampling points, and set a symmetry discrimination threshold based on the wavelength offset of each pair of sampling points relative to the peak center. S4. Record the number of sampling point pairs whose relative symmetry error is less than the corresponding symmetry discrimination threshold. ,by The ratio of the sampled points to the total number of sampled points is the symmetry score; S5. Set a symmetry score threshold and determine the quality of the fiber Bragg grating based on the symmetry score.
[0005] Furthermore, the spectral data includes wavelength data and corresponding light intensity data.
[0006] Furthermore, preprocessing of spectral data includes one or more of the following: filtering, smoothing, denoising, baseline correction, or normalization.
[0007] Furthermore, S2 specifically refers to: Savitzky-Golay smoothing filter is applied to the preprocessed spectral data to obtain smoothed spectral data. Estimate the spectral baseline of the smoothed and filtered spectral data, and subtract the baseline from the smoothed and filtered spectral data to obtain the baseline-free spectral data; The first and second derivatives of the baseline-removed spectral data are calculated, and the points where the first derivative changes from positive to negative and the second derivative is less than 0 are selected as candidate peak centers. Nonlinear fitting is performed on the local baseline-de-baseline spectral data within a set numerical range on both sides of the center of each candidate peak; The point where the fitted wavelength is located is taken as the peak center.
[0008] Furthermore, a Gaussian-Lorentz mixture model is used for nonlinear fitting, as shown in the following formula:
[0009] in, Let A represent the spectral amplitude at wavelength λ, B be the local background, and A be the fitted peak center amplitude. This represents the Gaussian-Lorentz mixing ratio coefficient. λ represents the center wavelength of the fitted peak, and w represents the full width at half maximum (FWHM) of the fitted peak center. Wavelength is represented by the horizontal axis of the spectrum.
[0010] Furthermore, the formula for the relative symmetry error of the sampling point pair is:
[0011] in, This represents the relative symmetry error of the i-th sampling point pair. and These represent the spectral amplitudes of the i-th sampling point pair on the left and right sides of the peak center, respectively.
[0012] Furthermore, the symmetry discrimination threshold is set as follows:
[0013] in, This represents the symmetry discrimination threshold for the i-th sampling point pair. This indicates the allowable symmetry error at the peak center. Indicates the relaxation factor. denoted by , w represents the wavelength offset of the i-th sampling point relative to the peak center, and w represents the half-peak width at the peak center.
[0014] The present invention also proposes a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-described fiber Bragg grating quality detection method based on symmetry discrimination.
[0015] The present invention also proposes an electronic device, including a processor and a memory, wherein the processor and the memory are interconnected, the memory is used to store a computer program, the computer program includes computer-readable instructions, and the processor is configured to invoke the computer-readable instructions to execute the above-described fiber Bragg grating quality detection method based on symmetry discrimination.
[0016] The present invention also proposes a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the fiber optic grating quality detection method based on symmetry discrimination described above.
[0017] The beneficial effects of the technical solution provided by this invention are: (1) This invention calculates the first and second derivatives of the spectrum, and selects the positions where the first derivative changes from positive to negative and the second derivative is less than 0 as candidate peaks. It also performs local fitting through the Gauss-Lorentz mixture model, which is sensitive to noise and avoids peak center shift caused by noise spikes, sidelobe peaks or sampling intervals.
[0018] (2) The symmetry score is calculated based on the dynamic symmetry discrimination threshold set by the wavelength offset, so that different tolerances are used in the region near the peak and the region far from the peak, which is more in line with the real peak structure and reduces the subjectivity and misjudgment of manual threshold setting. This improves detection efficiency. Attached Figure Description
[0019] Figure 1 This is a flowchart of a fiber optic grating quality detection method based on symmetry discrimination, according to an example of the present invention. Figure 2 This is a block diagram of an electronic device according to an exemplary embodiment of the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described below with reference to the accompanying drawings.
[0021] A flowchart of a fiber optic grating quality detection method based on symmetry discrimination, as described in an example of the present invention, is as follows: Figure 1 Specifically, it includes: S1. Acquire the spectral data of the fiber grating to be tested, preprocess the spectral data, and obtain the preprocessed spectral data.
[0022] The fiber grating under test is illuminated by a broadband light source, and its reflection spectrum signal is acquired using a spectral detection device. The acquired analog optical signal is converted into a digital signal to obtain a raw spectral dataset containing a series of discrete sampling points. The dataset includes wavelength data and light intensity data at each sampling point. The wavelength data reflects the Bragg condition of the grating, and the light intensity data reflects the reflection efficiency and loss characteristics of the grating.
[0023] Due to environmental disturbances and equipment noise during the data acquisition process, the raw spectral data needs to be preprocessed, specifically including one or more of the following steps: (1) Filtering: Use digital filters, such as Butterworth filters and median filters, to filter out high-frequency random noise or power frequency interference and retain effective spectral profile information.
[0024] (2) Smoothing and noise reduction: The data is smoothed by using the moving average method or Savitzky-Golay smoothing algorithm to reduce data jitter while preserving the spectral peak characteristics, such as peak intensity and half width at half maximum.
[0025] (3) Baseline correction: Identify and subtract background noise baseline or dark current offset in the spectral data, and normalize the spectral baseline to zero or standard level to ensure the accuracy of subsequent calculation of reflectance or peak value.
[0026] (4) Normalization: The light intensity data is normalized according to the maximum peak value or incident light power to eliminate the amplitude difference caused by the fluctuation of the light source power or the optical path loss, so that the spectral data of different gratings are comparable.
[0027] S2. Locate the peak center of the preprocessed spectral data.
[0028] The specific steps include: (1) Smoothing Filter To reduce the impact of random noise on subsequent peak detection and parameter extraction, the original spectral data is first subjected to Savitzky-Golay smoothing filtering. This method effectively suppresses high-frequency noise while preserving spectral shape and peak position information by performing least-squares polynomial fitting on local data points within a sliding window.
[0029] In this invention, the sliding window length is set to 9–21 sampling points, with the specific value fine-tuned based on the spectral sampling interval and signal-to-noise ratio level; the polynomial order is selected as second or third order to achieve a balance between smoothing intensity and peak shape fidelity. For spectra with drastic changes or containing narrow peaks, a smaller window and a lower order are preferred to avoid excessive smoothing that could lead to peak position shift or peak width distortion.
[0030] (2) Baseline estimation and deduction Baseline drift often exists in spectral signals due to instrument response, scattering effects, or sample matrix. If not corrected, it will affect the accuracy of peak detection and quantification.
[0031] This paper uses morphological opening operation and moving quantile method for baseline estimation.
[0032] Morphological operations utilize structuring elements to erode and dilate the spectrum, removing narrower peak structures and retaining only slowly changing background components. The moving quantile method approximates the baseline by taking low quantiles, such as the 5% or 10% quantile, within a local window, exhibiting good robustness to strong peak regions. The estimated baseline is then subtracted point-by-point from the original spectrum to obtain baseline-removed spectral data, which is used for subsequent derivative calculations and peak identification.
[0033] (3) Candidate peak identification based on derivative To enhance the detectability of weak peaks and reduce subjective threshold settings, a numerical differentiation method is used to extract spectral features. First, the first derivative of the spectrum is calculated. With the second derivative The location where the first derivative changes from positive to negative and the second derivative is less than 0 is identified as the central region of a potential absorption or emission peak, thus obtaining candidate peaks. This criterion can effectively distinguish true peaks from monotonic changes or noise fluctuations, and is especially suitable for spectral data with many overlapping peaks and complex backgrounds.
[0034] (4) Local fitting For each candidate peak, local spectral data within a range of 0.2–0.5 nm on both sides of its center position are extracted for nonlinear fitting. The fitting function adopts a Gaussian-Lorentz mixture model:
[0035]
[0036]
[0037] in, Let A represent the spectral amplitude at wavelength λ, B be the local background, and A be the fitted peak center amplitude. and Let these represent the Gaussian function and the Lorentz function, respectively. This represents the Gaussian-Lorentz mixing ratio coefficient. λ represents the wavelength of the peak at the center obtained from the fitting, and w represents the half-width at half-maximum (FWHM) of the fitted peak. Wavelength is represented by the horizontal axis of the spectrum.
[0038] The broadening of actual spectral peaks is usually caused by both Gaussian non-uniform broadening and Lorentz uniform broadening. A single Gaussian or Lorentz model can only describe one of the ideal cases, while a mixed model can more realistically reflect the actual physical broadening process by adjusting the weights of the two through the coefficient η.
[0039] By optimizing the model parameters using the least squares method, key spectral features such as peak height, peak center, and half-maximum width can be obtained.
[0040] (5) Determine the peak center Wavelength obtained by local fitting The location is used as the final peak center, rather than simply taking the maximum sampling point. This method improves peak position accuracy and enhances the comparability between different spectral batches. In actual spectra, multiple adjacent candidate peaks may appear due to noise spikes, sidelobe effects, or fitting instability. Noise spikes and sidelobes are eliminated based on peak height, half-width at half-maximum (HWHM), fitting residuals, and peak spacing. Weak peaks below a preset threshold are eliminated based on peak height; abnormal peaks that are too narrow or too wide are excluded based on HWHM; peaks with high goodness of fit and small residuals are retained based on fitting residuals; and physically indistinguishable peaks that are too close are merged or eliminated based on peak spacing. Through comprehensive evaluation of the above multi-dimensional features, spurious peaks caused by noise can be effectively removed, while retaining physically meaningful main peaks and shoulder peaks.
[0041] S3. Within a set wavelength range with the peak center as the midpoint, according to a preset wavelength interval sequence, starting from the peak center, sample several pairs of points on both sides of the peak center of the preprocessed spectral data, calculate the relative symmetry error of each pair of sampling points, and set a symmetry discrimination threshold based on the wavelength offset of each pair of sampling points relative to the peak center.
[0042] The wavelength interval sequence is With the peak center wavelength As a symmetry discrimination benchmark, the peak center is located at a preset wavelength interval on both sides. Select equidistant corresponding points and sample several point pairs. Let the wavelength offset of the i-th equidistant point relative to the peak center be . Then we have: Where i is a positive integer, representing the i-th number in the wavelength interval sequence. The left and right sides of the peak center are offset by the same amount from the peak center. The spectral amplitudes at each location are defined as follows: ; , This indicates the preprocessed spectral data at wavelength. Spectral amplitude at that location, This indicates the preprocessed spectral data at wavelength. Spectral amplitude at that location, and These represent the same offset from the peak center to the left and right sides, respectively. Spectral amplitude at the location.
[0043] The relative symmetry error of each pair of sampling points is:
[0044] in, This represents the relative symmetry error of the i-th sampling point pair.
[0045] The symmetry requirement is higher in the region near the peak center, while the allowable error range is appropriately relaxed in the region far from the peak center to take into account the effects of increased noise and reduced amplitude at the spectral line edges. A symmetry discrimination threshold is set based on the wavelength offset of each pair of sampling points relative to the peak center.
[0046] Specifically, the symmetry discrimination threshold can be set in the following way: (1) Segmented threshold =3%, when ≤0.05nm; =5%, when 0.05nm < ≤0.15nm; =8%, when 0.15nm < ≤0.30nm.
[0047] (2) Set the symmetry discrimination threshold based on the half-width of the peak where the peak center is located and the wavelength offset relative to the peak center.
[0048] in, This represents the symmetry discrimination threshold for the i-th sampling point pair. This represents the allowable symmetry error at the peak center, which can be taken as 0.01–0.05. This represents a relaxation factor, which can be 0.5–2. denoted by , w represents the wavelength offset of the i-th sampling point relative to the peak center, and w represents the half-width of the peak where the peak center is located.
[0049] (3) Set the symmetry discrimination threshold based on the wavelength offset relative to the peak center.
[0050] in, This represents the slope of the threshold as it widens with the offset, and can be taken as 0.01–0.05 nm. -1 .
[0051] S4. Record the relative symmetry error. Less than the corresponding symmetry discrimination threshold the number of sampling point pairs , using the ratio of to the total number N of sampling point pairs as the symmetry score .
[0052] wherein, Q represents the percentage of corresponding points meeting the symmetry requirement in the total number of comparison points, which is used to characterize the overall symmetry degree of the fiber grating reflection peak. The larger the Q value, the better the overall symmetry of the reflection peak.
[0053] S5: Set a symmetry score threshold, and determine the quality of the fiber grating according to the symmetry score.
[0054] Based on the symmetry score Q, the quality of the fiber grating can be further determined; when Q is greater than or equal to a preset symmetry score threshold, the fiber grating is determined to be qualified; when Q is less than the preset symmetry score threshold, the fiber grating is determined to have quality abnormality or be unqualified.
[0055] The test was carried out under the following conditions: a fiber grating demodulator was used to collect the reflection spectrum, with a scanning range of 1549.5-1550.8 nm and a sampling interval of 0.005 nm. 30 fiber grating samples were selected, including 20 manually qualified samples and 10 abnormal samples. The abnormal samples include uneven writing, local refractive index modulation offset, side lobe enhancement, etc. Table 1 is an example of qualified sample data, and Table 2 is an example of abnormal sample data.
[0056] Table 1
[0057] The number of points of this sample meeting the symmetry requirement is 16 / 18, the symmetry score is 88.9%, and it is determined to be qualified.
[0058] Table 2
[0059] The number of points of this sample meeting the symmetry requirement is 5 / 18, the symmetry score is 27.8%, and it is determined to be abnormal in quality.
[0060] In an exemplary embodiment, a computer-readable storage medium is included, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned fiber grating quality detection method based on symmetry discrimination is realized.
[0061] Please refer to Figure 2 , in an exemplary embodiment, an electronic device is further included, including at least one processor, at least one memory, and at least one communication bus.
[0062] The memory stores a computer program, which includes computer-readable instructions. The processor calls the computer-readable instructions stored in the memory through the communication bus to execute the aforementioned fiber optic grating quality detection method based on symmetry discrimination.
[0063] In one exemplary embodiment, a computer program product is proposed, including a computer program / instructions that, when executed by a processor, implement the steps of the fiber Bragg grating quality detection method based on symmetry discrimination described above.
[0064] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A fiber optic grating quality inspection method based on symmetry discrimination, characterized in that, Includes the following steps: S1. Acquire the spectral data of the fiber grating to be tested, preprocess the spectral data, and obtain the preprocessed spectral data. S2. Locate the peak center of the preprocessed spectral data; S3. Within a set wavelength range with the peak center as the midpoint, according to a preset wavelength interval sequence, starting from the peak center, sample several pairs of points on both sides of the peak center of the preprocessed spectral data, calculate the relative symmetry error of each pair of sampling points, and set a symmetry discrimination threshold based on the wavelength offset of each pair of sampling points relative to the peak center. S4. Record the number of sampling point pairs whose relative symmetry error is less than the corresponding symmetry discrimination threshold. ,by The ratio of the sampled points to the total number of sampled points is the symmetry score; S5. Set a symmetry score threshold and determine the quality of the fiber Bragg grating based on the symmetry score.
2. The fiber optic grating quality detection method based on symmetry discrimination according to claim 1, characterized in that, Spectral data includes wavelength data and corresponding light intensity data.
3. The fiber optic grating quality detection method based on symmetry discrimination according to claim 1, characterized in that, Preprocessing of spectral data includes one or more of the following: filtering, smoothing, denoising, baseline correction, or normalization.
4. The fiber optic grating quality detection method based on symmetry discrimination according to claim 1, characterized in that, S2 specifically refers to: Savitzky-Golay smoothing filter is applied to the preprocessed spectral data to obtain smoothed spectral data. Estimate the spectral baseline of the smoothed and filtered spectral data, and subtract the baseline from the smoothed and filtered spectral data to obtain the baseline-free spectral data; The first and second derivatives of the baseline-removed spectral data are calculated, and the points where the first derivative changes from positive to negative and the second derivative is less than 0 are selected as candidate peak centers. Nonlinear fitting is performed on the local baseline-de-baseline spectral data within a set numerical range on both sides of the center of each candidate peak; The point where the fitted wavelength is located is taken as the peak center.
5. The fiber optic grating quality detection method based on symmetry discrimination according to claim 4, characterized in that, A Gaussian-Lorentz mixture model is used for nonlinear fitting, as shown in the following formula: in, Let A represent the spectral amplitude at wavelength λ, B be the local background, and A be the fitted peak center amplitude. This represents the Gaussian-Lorentz mixing ratio coefficient. λ represents the center wavelength of the peak obtained by fitting, and w represents the full width at half maximum (FWHM) of the fitted peak. Wavelength is represented by the horizontal axis of the spectrum.
6. The fiber optic grating quality detection method based on symmetry discrimination according to claim 1, characterized in that, The formula for the relative symmetry error of a sampling point pair is: in, This represents the relative symmetry error of the i-th sampling point pair. and These represent the spectral amplitudes of the i-th sampling point pair on the left and right sides of the peak center, respectively.
7. The fiber optic grating quality detection method based on symmetry discrimination according to claim 1, characterized in that, The symmetry discrimination threshold is set as follows: in, This represents the symmetry discrimination threshold for the i-th sampling point pair. This indicates the allowable symmetry error at the peak center. Indicates the relaxation factor. denoted by , w represents the wavelength offset of the i-th sampling point relative to the peak center, and w represents the half-width of the peak where the peak center is located.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 7.
9. An electronic device, characterized in that, The device includes a processor and a memory, the processor being interconnected with the memory, wherein the memory is used to store a computer program, the computer program including computer-readable instructions, and the processor is configured to invoke the computer-readable instructions to perform the method as described in any one of claims 1 to 7.
10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the method described in any one of claims 1 to 7.
