Adaptive convolution wavelength demodulation method and system based on reference filter
Through the adaptive adjustment of the convolution kernel and step size, combined with signal preprocessing and Fourier transform, the demodulation accuracy and robustness of the fiber temperature sensor in complex noise environments is solved, and high-precision temperature measurement is achieved.
Patent Information
- Application Number
- CN202510342572.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-07-08
AI Technical Summary
The wavelength demodulation method of existing fiber temperature sensors is difficult to adapt to complex noise environments, resulting in insufficient demodulation accuracy and poor robustness, unable to effectively deal with nonlinear spectral drift, and lacks an adaptive noise management mechanism.
Adaptive convolution wavelength demodulation method based on reference filter is adopted to dynamically adjust the convolution kernel type and step size, and structured noise feature vectors are constructed in combination with signal preprocessing and Fourier transform, and curve fitting is performed to adapt to different noise environments and improve demodulation accuracy and robustness.
Significantly improve the stability and accuracy of understanding and adjustment, the signal-to-noise ratio is increased by 20%-35%, the noise classification accuracy is increased from 78% to 92%, and the temperature measurement error is controlled within ±0.3℃, which is suitable for industrial site strong electromagnetic interference environments.
Smart Images

Figure CN120274903A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of optical fiber temperature measurement, and particularly to an adaptive convolution wavelength demodulation method and system based on a reference filter. Background Art
[0002] The existing wavelength demodulation methods for optical fiber temperature sensors mainly rely on signal processing strategies with fixed parameters and are difficult to adapt to the dynamic changes in complex noise environments. For example, traditional Gaussian filtering is prone to over-smoothing spectral features in high-noise scenarios and has computational redundancy problems in low-noise scenarios. At the same time, existing methods mostly use a single convolution kernel for signal processing and cannot dynamically adjust the filtering strategy according to the noise level, resulting in a significant decrease in demodulation accuracy under strong interference conditions. In addition, traditional methods usually establish the temperature-wavelength relationship based on linear fitting and are difficult to compensate for the non-linear response characteristics of the sensor, and the measured error generally exceeds ±0.5°C.
[0003] Regarding the noise assessment problem, existing technologies mostly rely on single-feature analysis in the time domain or frequency domain and cannot comprehensively capture the complex characteristics of noise. For example, only classifying noise through the time-domain standard deviation or frequency-domain energy distribution results in a classification accuracy of less than 80% in a mixed noise environment. The limitations of this single-domain analysis directly affect the accuracy of subsequent convolution kernel adjustment, thereby reducing the anti-interference ability of the system. In addition, existing methods lack a structured storage and dynamic update mechanism for noise characteristics and are difficult to achieve adaptive noise management.
[0004] In terms of curve fitting, traditional methods usually adopt linear regression or fixed-step optimization algorithms and cannot effectively handle non-linear spectral drift characteristics. For example, when temperature changes cause the spectrum to exhibit quadratic or higher-order non-linear drift, linear fitting will introduce systematic errors. At the same time, the fixed-step strategy is prone to falling into local optima or resulting in too slow a convergence speed during the optimization process, affecting the real-time demodulation efficiency. These problems make the existing demodulation methods face challenges such as insufficient accuracy and poor robustness in industrial field applications. Summary of the Invention
[0005] The purpose of the embodiments of the present invention is to provide an adaptive convolution wavelength demodulation method and system based on a reference filter. By introducing an adaptive filtering method and dynamically adjusting the parameters of the convolution kernel, it can effectively adapt to different noise environments, improve the accuracy of wavelength demodulation, and effectively enhance the robustness and accuracy of the demodulation method.
[0006] To solve the above technical problems, the first aspect of the embodiments of the present invention provides an adaptive convolution wavelength demodulation method based on a reference filter, including the following steps:
[0007] Obtain the original waveform data collected by the fiber optic temperature sensor, and after performing quadratic Gaussian filtering on the original waveform data, obtain a smooth discrete spectrum;
[0008] Obtain the noise level of the original waveform data, and dynamically adjust the convolution kernel of the convolution operation according to the noise level;
[0009] Based on a long-pass filter, obtain a reference spectrum under the same acquisition conditions as the original waveform data, and perform a convolution operation on the reference spectrum and the smooth discrete spectrum by combining the adjusted convolution kernel to obtain a drift sequence and a set of convolution sequences;
[0010] Perform curve fitting through the drift sequence and the set of convolution sequences to obtain a temperature-wavelength drift correspondence curve, and obtain the corresponding temperature value according to the wavelength detection value.
[0011] Further, the obtaining the noise level of the original waveform data includes:
[0012] Perform signal preprocessing on the original waveform data, and the signal preprocessing includes denoising and normalization processing;
[0013] Perform a fast Fourier transform on the preprocessed original waveform data to obtain the noise frequency domain characteristics and noise time domain characteristics of the original waveform data;
[0014] Based on the noise frequency domain characteristics and the noise time domain characteristics, obtain a noise feature vector, and store it as noise structured data after standardization processing;
[0015] Based on the noise feature vector, calculate the noise level, and the noise level includes a low noise level, a medium noise level, and a high noise level.
[0016] Further, the dynamically adjusting the convolution kernel of the convolution operation according to the noise level includes:
[0017] Obtain the noise level of the current detection period;
[0018] Based on the noise level, dynamically adjust the type of the convolution kernel corresponding to the current detection period;
[0019] Wherein, the types of the convolution kernels include: a first type of convolution kernel corresponding to the low noise level, a second type of convolution kernel corresponding to the medium noise level, and a third type of convolution kernel corresponding to the high noise level.
[0020] Further, the first type of convolution kernel is 3×3, and the corresponding weight type is Gaussian distribution;
[0021] The second type of convolution kernel is 5×5, and the corresponding weight type is uniform distribution;
[0022] The third type of convolution kernel is 7×7, and the corresponding weight type is bilateral filtering.
[0023] Further, the process of obtaining the temperature-wavelength drift corresponding curve by curve fitting the drift sequence and the convolution sequence set includes:
[0024] Performing curve fitting on the drift sequence and the convolution sequence set to obtain the wavelength drift value corresponding to the peak of the fitting curve;
[0025] Performing quadratic polynomial fitting on multiple groups of the wavelength drift values and the corresponding temperature values to obtain the temperature-wavelength drift corresponding curve.
[0026] Further, the process of performing curve fitting on the drift sequence and the convolution sequence set includes:
[0027] Obtaining an initial step size and calculating a fitting error based on the initial step size;
[0028] When the fitting error is greater than a first preset error value, controlling the initial step size to decrease according to a first preset ratio value;
[0029] When the fitting error is less than or equal to the first preset ratio value, keeping the initial step size value.
[0030] Further, the fitting error is the mean square error, and its calculation formula is:
[0031]
[0032] where N is the number of data points, y i is the actual observed value, is the predicted value of the fitting curve.
[0033] Further, after controlling the initial step size to decrease according to the first preset ratio value, it also includes:
[0034] When the change value of the mean square error is greater than a second preset ratio value, decreasing the step size value;
[0035] When the change value of the mean square error is less than a third preset ratio value, increasing the step size value;
[0036] When the change value of the mean square error is greater than or equal to the third preset ratio value and less than or equal to the second preset ratio value, keeping the step size value unchanged.
[0037] Further, the drift sequence and the convolution sequence set are:
[0038]
[0039] Among them, x(m) is the reference spectral sequence; h(n - m) is the smoothed discrete spectrum; m is the variable for summation, traversing each sample point of the input sequence; n is the time index of the output sequence, used to determine the specific position in the convolution result sequence.
[0040] Correspondingly, a second aspect of the embodiments of the present invention provides an adaptive convolution wavelength demodulation system based on a reference filter, which performs demodulation based on the above-mentioned adaptive convolution wavelength demodulation method based on a reference filter, and includes:
[0041] A data acquisition module, which is used to acquire the original waveform data collected by the fiber optic temperature sensor, and after performing quadratic Gaussian filtering on the original waveform data, obtain a smoothed discrete spectrum;
[0042] A dynamic adjustment module, which is used to obtain the noise level of the original waveform data and dynamically adjust the convolution kernel of the convolution operation according to the noise level;
[0043] A convolution operation module, which is used to obtain a reference spectrum under the same acquisition conditions as the original waveform data based on a long-pass filter, and perform convolution operation on the reference spectrum and the smoothed discrete spectrum by combining the adjusted convolution kernel to obtain a drift sequence and a set of convolution sequences;
[0044] A curve fitting module, which is used to perform curve fitting through the drift sequence and the set of convolution sequences to obtain a temperature-wavelength drift corresponding curve, and obtain the corresponding temperature value according to the wavelength detection value.
[0045] Correspondingly, a third aspect of the embodiments of the present invention further provides an electronic device, including: at least one processor; and a memory connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the above-mentioned adaptive convolution wavelength demodulation method based on a reference filter.
[0046] In addition, a fourth aspect of the embodiments of the present invention further provides a computer-readable storage medium, on which computer instructions are stored, and when the instructions are executed by a processor, the above-mentioned adaptive convolution wavelength demodulation method based on a reference filter is implemented.
[0047] The above technical solutions of the embodiments of the present invention have the following beneficial technical effects:
[0048] 1. By dynamically adjusting the matching mechanism between the convolution kernel types (such as Gaussian distribution, uniform distribution, bilateral filtering) and the noise levels (low, medium, high), precise adaptation to different noise environments is achieved. For example, bilateral filtering kernels are used for high noise levels, which can suppress noise while retaining spectral edge features, and Gaussian kernels are used for low noise levels to reduce computational redundancy. This significantly improves the demodulation stability of the system in complex noise scenarios. Compared with the method of fixed kernel types, the signal-to-noise ratio can be increased by 20% - 35%, and it is especially suitable for extreme environments such as strong electromagnetic interference in industrial sites;
[0049] 2. Combining the noise frequency domain and time domain features extracted by signal preprocessing (denoising, normalization) and FFT transformation, a structured noise feature vector is constructed. After being standardized, this vector uses a classification algorithm to achieve intelligent discrimination of noise levels. Experimental data shows that compared with single-domain feature analysis, the multi-domain fusion method improves the noise classification accuracy from 78% to 92%, effectively solving the problem of insufficient recognition of complex noise types in traditional single-domain analysis, and providing a reliable basis for subsequent dynamic adjustment of convolution kernels;
[0050] 3. A step size adaptive adjustment mechanism is introduced in the curve fitting stage: when the mean square error change exceeds 20%, the step size is reduced to improve accuracy, and when the change is less than 5%, the step size is increased to accelerate convergence. Combining quadratic polynomial fitting, a non-linear modeling of the temperature-wavelength drift relationship is achieved. Measured data shows that this method controls the temperature measurement error within ±0.3°C, and the error is reduced by about 40% compared with the traditional linear fitting method. It is especially suitable for compensating the non-linear response characteristics of fiber optic sensors, ensuring the high-precision requirements of industrial temperature measurement. Brief Description of the Drawings
[0051] Figure 1 is a schematic diagram of the principle of the fiber optic temperature sensing response data acquisition system provided by an embodiment of the present invention;
[0052] Figure 2 is a flowchart of the adaptive convolution wavelength demodulation method based on a reference filter provided by an embodiment of the present invention;
[0053] Figure 3 is a schematic diagram of the original waveform after removing the interference part provided by an embodiment of the present invention;
[0054] Figure 4 is a schematic diagram of the waveform reference spectrum of a long-pass filter provided by an embodiment of the present invention;
[0055] Figure 5 is a schematic diagram of the smoothed discrete spectrum after being processed by quadratic Gaussian filtering provided by an embodiment of the present invention;
[0056] Figure 6 is a schematic diagram of the smoothed discrete spectrum after normalization provided by an embodiment of the present invention;
[0057] Figure 7 It is a schematic diagram of the multiple polynomial fitting curve of the drift sequence and convolution coefficient provided by the embodiment of the present invention;
[0058] Figure 8 It is a schematic diagram of the temperature-wavelength drift fitting curve provided by the embodiment of the present invention;
[0059] Figure 9 It is a module block diagram of the adaptive convolution wavelength demodulation system based on a reference filter provided by the embodiment of the present invention.
[0060] Reference numerals:
[0061] 1. Data acquisition module, 2. Dynamic adjustment module, 3. Convolution operation module, 4. Curve fitting module. Detailed implementation manners
[0062] To make the purpose, technical solutions and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below in conjunction with the specific implementation manners and with reference to the accompanying drawings. It should be understood that these descriptions are exemplary and are not intended to limit the scope of the present invention. In addition, in the following description, the descriptions of well-known structures and technologies are omitted to avoid unnecessarily confusing the concepts of the present invention.
[0063] As Figure 1 shown, the fiber optic temperature sensing response data acquisition system adopted by the present invention is as Figure 1 shown, and mainly includes an SLD light source, a multimode fiber coupler, a gallium arsenide fiber optic temperature sensor, an optical switch, a medium-temperature dry well furnace, a self-developed spectrometer, and a long-wave pass filter.
[0064] Using a multi-channel experimental device to collect the original waveform data of the gallium arsenide fiber optic temperature sensor at 40°C - 240°C with a step size of 10°C, collecting 5 groups of data for each temperature value, and simultaneously collecting the waveform of the long-wave pass filter (LPF) as the reference spectrum S of the convolution wavelength demodulation algorithm under the same experimental conditions ref .
[0065] Please refer to Figure 2 and Figure 3 , the first aspect of the embodiment of the present invention provides an adaptive convolution wavelength demodulation method based on a reference filter, including the following steps:
[0066] Step S100, obtaining the original waveform data collected by the fiber optic temperature sensor, and after performing quadratic Gaussian filtering on the original waveform data, obtaining a smooth discrete spectrum.
[0067] Through a data acquisition device connected to an optical fiber temperature sensor, the original waveform data collected by the sensor within a certain period of time is transmitted to a processing terminal such as a computer. During the first filtering, the original waveform data is subjected to point-by-point weighted average calculation according to a set Gaussian kernel to obtain preliminarily smoothed data. Then, using the same Gaussian kernel parameters or slightly adjusted according to the actual situation, the preliminarily smoothed data is subjected to Gaussian filtering again to finally obtain a smoothed discrete spectrum. Each data point of this smoothed discrete spectrum represents the light intensity value after smoothing at the corresponding wavelength position.
[0068] Step S200: Obtain the noise level of the original waveform data, and dynamically adjust the convolution kernel of the convolution operation according to the noise level.
[0069] Under different environments, the noise levels of the original waveform data collected by the optical fiber temperature sensor are different. If the noise level is high, a simple and fixed convolution kernel cannot effectively extract signal features, resulting in demodulation errors. By evaluating the noise level and dynamically adjusting the convolution kernel, the convolution operation can better adapt to different noise environments.
[0070] For example, when the noise level is high, a wider and more complex convolution kernel is used to enhance noise suppression and signal feature extraction; when the noise level is low, a relatively narrow and simple convolution kernel is used to reduce the computational amount and avoid over-smoothing the signal.
[0071] Step S300: Based on a long-pass filter, obtain a reference spectrum under the same acquisition conditions as the original waveform data, and perform a convolution operation on the reference spectrum and the smoothed discrete spectrum using the adjusted convolution kernel to obtain a drift sequence and a set of convolution sequences.
[0072] The long-pass filter can filter out the optical signals with wavelengths above a specific value to obtain the reference spectrum. Under the same acquisition conditions, the reference spectrum reflects the spectral characteristics in an ideal state. Performing a convolution operation on it and the processed smoothed discrete spectrum, the convolution process can be regarded as detecting the similarity degree of the smoothed discrete spectrum at different positions based on the reference spectrum characteristics. Through the convolution operation, the change characteristics of the spectrum can be highlighted, thereby obtaining a drift sequence (reflecting the change of wavelength) and a set of convolution sequences (including the results of convolution operations at different positions, used for subsequent analysis of the detailed changes of the spectrum).
[0073] In the same optical path as the optical fiber temperature sensor, a long-pass filter is connected to ensure that the parameter settings of the filter match the sensor acquisition conditions, such as the wavelength cut-off range, etc. Using the same data acquisition device as for collecting the original waveform data, the optical signals after passing through the long-pass filter are collected at the same time interval and environmental conditions to obtain the reference spectrum data. The reference spectrum data and the smoothed discrete spectrum data obtained in step S100 are imported into the convolution operation algorithm.
[0074] During the operation, the reference spectrum can be used as a convolution kernel, and it slides point by point on the smoothed discrete spectrum for convolution calculation. Each convolution calculation obtains a convolution value, and all the convolution values form a set of convolution sequences. At the same time, by analyzing the changes in features such as the peak position in the convolution result, the wavelength drift situation is determined, and a drift sequence is generated. For example, if the peak position in the convolution result moves to the right relative to the reference situation, it indicates that the wavelength increases, and vice versa, the distance of movement can be quantified as a drift value, forming a drift sequence.
[0075] Step S400, perform curve fitting through the drift sequence and the set of convolution sequences to obtain the temperature-wavelength drift corresponding curve, and obtain the corresponding temperature value according to the wavelength detection value.
[0076] Temperature change will cause wavelength drift of the spectrum of the fiber optic temperature sensor. A mathematical relationship between temperature and wavelength drift is established through curve fitting. The drift sequence reflects the change of wavelength, and the set of convolution sequences contains the detailed information of the spectrum change. Using these data for curve fitting can more accurately describe the corresponding relationship between temperature and wavelength drift. After obtaining the corresponding curve, according to the actually detected wavelength value, the corresponding temperature value can be obtained by looking up the corresponding curve.
[0077] In a specific implementation manner of the embodiment of the present invention, obtaining the noise level of the original waveform data in step S200 includes the following steps:
[0078] Step S211, perform signal preprocessing on the original waveform data, and the signal preprocessing includes denoising and normalization processing.
[0079] During the acquisition process of the original waveform data, it will inevitably be interfered by factors such as the external environment and the characteristics of the sensor itself, introducing various noises. These noises will have an adverse impact on subsequent data analysis and processing. By eliminating or reducing the interference of these noises, the original waveform data can better reflect the real signal characteristics. The normalization processing is to map the data to a unified scale range, usually [0,1] or [-1,1]. Different original waveform data have different value ranges and magnitudes. Through normalization processing, each feature can have the same importance, improving the accuracy and stability of subsequent analysis.
[0080] Step S212, perform a fast Fourier transform on the preprocessed original waveform data to obtain the noise frequency domain characteristics and noise time domain characteristics of the original waveform data.
[0081] The fast Fourier transform (FFT) converts the time domain signal into a frequency domain signal. In the time domain, the signal changes with time, and in the frequency domain, the signal is decomposed into sine and cosine components of different frequencies. Noise has different manifestations in the time domain and the frequency domain. Through the FFT transform, the frequency domain characteristics and time domain characteristics of the noise can be obtained simultaneously.
[0082] In the frequency domain, noise appears as energy concentration at certain specific frequencies. For example, power frequency noise in a power system is usually concentrated around 50 Hz or 60 Hz. By analyzing the frequency domain characteristics, the main frequency components of the noise are determined, and then targeted measures are taken for filtering. In the time domain, noise appears as sudden fluctuations or irregular changes in the signal. By observing the time domain characteristics, information such as the occurrence time and duration of the noise can be understood. For example, in an audio signal, if a sharp pulse noise suddenly appears, a signal mutation can be clearly seen in the time domain.
[0083] Step S213: Based on the noise frequency domain characteristics and the noise time domain characteristics, a noise feature vector is obtained and stored as noise structured data after normalization processing.
[0084] The noise frequency domain characteristics and the noise time domain characteristics describe the characteristics of the noise from different perspectives. To facilitate subsequent analysis and processing, these characteristics are combined into a noise feature vector. Each element in this vector represents a specific noise characteristic, such as the noise energy at a certain frequency, the fluctuation amplitude of the noise within a certain time period, etc.
[0085] However, since different noise characteristics have different value ranges and magnitudes, in order to avoid some characteristics having too much influence on subsequent calculations, it is necessary to perform normalization processing on the noise feature vector. There are many methods for normalization processing. The common one is z-score normalization. By calculating the mean and standard deviation of the feature vector, each element is converted into a value under the standard normal distribution. After normalization processing, the elements in the noise feature vector have the same scale, which is convenient for comparison and analysis.
[0086] Finally, the normalized noise feature vector is stored as noise structured data. Structured data has a clear format and structure, which is convenient for storage, query, and management. For example, the noise feature vector can be stored in a database, with each vector as a record and each feature as a field. In this way, when these data are needed for subsequent use, they can be retrieved and called conveniently.
[0087] Step S214: Based on the noise feature vector, the noise level is calculated. The noise level includes low noise level, medium noise level, and high noise level.
[0088] In order to evaluate and classify the severity of noise, the noise level can be calculated based on the noise feature vector, and various methods can be used to achieve this goal. One commonly used method is the threshold-based classification method. First, through historical data analysis, the feature thresholds corresponding to different noise levels are determined. For example, for a specific noise feature, when the value of this feature is less than the threshold T1, the noise level is considered to be a low noise level; when the value of the feature is between T1 and T2, the noise level is considered to be a medium noise level; when the value of the feature is greater than T2, the noise level is considered to be a high noise level.
[0089] Another method is to use machine learning algorithms such as support vector machines (SVMs), decision trees, etc. These algorithms can learn the mapping relationship between the noise feature vector and the noise level by training on a large number of sample data with known noise levels. In practical applications, the noise feature vector to be evaluated is input into the trained model, and the model can output the corresponding noise level. For example, using the SVM algorithm, first divide the sample data with known noise levels into a training set and a test set, train the training set, and adjust the parameters of the model to achieve a better classification effect on the test set. Then, input the new noise feature vector into the trained SVM model, and the model will output the corresponding noise level according to the learned mapping relationship.
[0090] Furthermore, the dynamic adjustment of the convolution kernel for the convolution operation in step S200 includes:
[0091] Step S221, obtaining the noise level of the current detection period.
[0092] During the entire adaptive convolution wavelength demodulation process, the ambient noise situation changes within each detection period. Therefore, by accurately obtaining the noise level of the current detection period, the convolution kernel can be dynamically adjusted according to this level. For example, in a real-time monitoring system of an optical fiber temperature sensor, the original waveform data collected by the sensor is processed every once in a while (i.e., one detection period), and the noise feature vector is obtained through operations such as denoising, normalization, and fast Fourier transform, and then the noise level corresponding to this detection period is calculated. This noise level reflects the degree of noise interference suffered by the data in the current period and is an important basis for subsequent adjustment of the convolution kernel.
[0093] If in a certain detection period, the external environment is relatively stable and there are no obvious electromagnetic interference and other factors, then the calculated noise level is a low noise level; on the contrary, if there is strong electromagnetic interference or other unstable factors, the noise level is a high noise level.
[0094] Step S222: Dynamically adjust the type of convolution kernel corresponding to the current detection period based on the noise level. The types of convolution kernels include: the first type of convolution kernel corresponding to a low noise level, the second type of convolution kernel corresponding to a medium noise level, and the third type of convolution kernel corresponding to a high noise level.
[0095] Different noise levels have different requirements for convolution operations. Therefore, it is necessary to dynamically adjust the type of convolution kernel according to the obtained noise level to achieve the best filtering and feature extraction effects. The present invention defines three types of convolution kernels, corresponding to low, medium, and high noise levels respectively. Optionally, the first type of convolution kernel is 3×3, and the corresponding weight type is Gaussian distribution. The second type of convolution kernel is 5×5, and the corresponding weight type is uniform distribution. The third type of convolution kernel is 7×7, and the corresponding weight type is bilateral filtering.
[0096] When the noise level is low, the first type of convolution kernel is used, and its corresponding weight type is Gaussian distribution. The convolution kernel with Gaussian distribution has the functions of smoothing and denoising. In a low-noise environment, it can further remove some fine noises while retaining the main features of the signal. For the data collected by the fiber optic temperature sensor, at a low noise level, the convolution kernel with Gaussian distribution can smooth the spectral data, making the spectral curve smoother and facilitating subsequent analysis.
[0097] When the noise level is medium, the second type of convolution kernel is adopted, and its weight type is uniform distribution. The convolution kernel with uniform distribution can perform relatively average filtering on the signal when dealing with medium noise, giving the same weight to each part of the signal, and can better retain the overall features of the signal while removing the noise. The convolution kernel with uniform distribution can suppress a certain degree of background noise at a medium level, making the audio signal clearer.
[0098] When the noise level is high, the third type of convolution kernel is used, and its weight type is bilateral filtering. Bilateral filtering combines the information in the spatial domain and the value domain. In a high-noise environment, it can not only consider the spatial distance between pixels (or data points), but also consider the gray value (or data value) difference. In this way, it can better retain the edge and detail information of the signal while removing the noise. For the spectral data collected by the fiber optic temperature sensor with strong noise interference, the convolution kernel of bilateral filtering can effectively remove the noise while retaining the peak value and other key features of the spectrum, thereby improving the accuracy of subsequent wavelength demodulation.
[0099] Specifically, the curve fitting in step S400 through the drift sequence and the convolution sequence set to obtain the temperature-wavelength drift corresponding curve includes:
[0100] Step S410: Perform curve fitting on the drift sequence and the convolution sequence set to obtain the wavelength drift value corresponding to the peak value of the fitting curve.
[0101] In the adaptive convolution wavelength demodulation method based on a reference filter, the drift sequence reflects the drift of the wavelength with respect to certain factors (such as temperature), and the set of convolution sequences contains the results of convolution operations at different positions, which include the detailed change information of the spectrum. By performing curve fitting on the drift sequence and the set of convolution sequences, the mathematical relationship between the two can be found, thereby more accurately analyzing the spectral characteristics.
[0102] Taking the least squares method as an example, assume there is a series of drift sequence data points (x i , y i ), where x i is a certain parameter in the drift sequence (such as time, sampling point number, etc.), and y i is the corresponding convolution sequence value. Through the function f(x), the sum of the squares of the distances from all data points to the curve of this function is minimized, that is, is minimized. By solving this minimization problem, the parameters of the fitting curve are obtained.
[0103] In spectral analysis, peaks often correspond to important spectral characteristics, such as the central wavelength of the spectrum. By finding the peak position of the fitting curve, the wavelength drift value corresponding to this peak can be determined. For example, in a temperature monitoring system, as the temperature changes, the spectrum collected by the fiber optic sensor will drift, and the wavelength drift value corresponding to the peak found through curve fitting can reflect the drift of the spectrum at the current temperature.
[0104] Step S420: Perform quadratic polynomial fitting on multiple groups of wavelength drift values and corresponding temperature values to obtain a temperature-wavelength drift correspondence curve.
[0105] In practical applications, an accurate correspondence relationship between temperature and wavelength drift is usually established, and the corresponding temperature value is obtained based on the wavelength detection value. To obtain a more accurate relationship, multiple experiments are required to obtain multiple groups of wavelength drift values and corresponding temperature values; these data points reflect the wavelength drift of the spectrum at different temperatures.
[0106] By performing a quadratic polynomial fitting on multiple sets of wavelength drift values and corresponding temperature values, a quadratic polynomial function that best fits these data points can be found. Specifically, taking multiple sets of wavelength drift values and temperature values as known data points, substituting them into the quadratic polynomial function, and then using methods such as the least squares method to solve for the coefficients a, b, and c. The quadratic polynomial function obtained through the solution is the temperature-wavelength drift correspondence curve. For example, in a calibration experiment of an optical fiber temperature sensor, the wavelength drift of the spectrum is measured at different temperatures to obtain multiple sets of data points, such as (0.1, 20), (0.2, 30), (0.3, 40), etc., where the first value is the wavelength drift value and the second value is the temperature value. By performing a quadratic polynomial fitting on these data points, a specific quadratic polynomial function can be obtained, such as y = 100x 2 + 50x + 15, and this function describes the correspondence between temperature and wavelength drift. In practical applications, when a wavelength drift value is detected, it can be substituted into this quadratic polynomial function to calculate the corresponding temperature value.
[0107] Furthermore, the curve fitting of the drift sequence and the set of convolution sequences in step S410 includes:
[0108] Step S411, obtaining an initial step size and calculating the fitting error based on the initial step size.
[0109] During the curve fitting process, the choice of the initial step size directly affects the fitting efficiency and accuracy. The initial step size is usually set according to the characteristics of historical data. For example, 1% of the wavelength drift value range is taken as the initial step size. The fitting error is calculated by comparing the deviation between the actual data points and the fitting curve, and the mean square error (MSE) is commonly used as a quantification index. For example, assuming the initial step size is set to 0.1, a quadratic polynomial fitting is performed on the drift sequence and the convolution sequence, the sum of the squares of the differences between the predicted values and the actual values of all data points is calculated, and then the average value is taken to obtain an MSE of 0.5. If the MSE is large, it indicates that the fitting effect at the current step size is not good, and the step size needs to be further adjusted to optimize the fitting result.
[0110] Step S412, when the fitting error is greater than the first preset error value, controlling the initial step size to decrease according to the first preset ratio value.
[0111] An adaptive optimization of the fitting process is achieved by dynamically adjusting the step size. If the calculated fitting error exceeds the preset threshold (e.g., the first preset error value is set to 0.3), the system will trigger a step size reduction mechanism, usually reducing the step size by a fixed ratio (e.g., 50%). For example, when the step size is 0.1 and the MSE is 0.5, the step size is reduced to 0.05, and the fitting calculation is performed again.
[0112] In this way, the search range is gradually narrowed to make the fitting curve closer to the actual data points. This strategy is similar to the learning rate adjustment in the gradient descent algorithm, approaching the optimal solution through iterative optimization, ensuring high-precision fitting results even under complex data distributions.
[0113] Step S413, when the fitting error is less than or equal to the first preset proportional value, the initial step size value will be maintained.
[0114] When the fitting error meets the preset precision requirement (e.g., MSE ≤ 0.3), the system will stop adjusting the step size and maintain the current step size for subsequent calculations, avoiding waste of computing resources caused by excessive adjustment and ensuring the stability of the fitting process. For example, if the MSE is 0.2 when the step size is 0.1, the system determines that the current step size can already meet the precision requirements, and subsequent iterations will continue to use this step size for fitting until the preset maximum number of iterations or convergence conditions are reached. The above dynamic balance strategy effectively improves the execution efficiency of the algorithm while ensuring the fitting precision.
[0115] Optionally, the fitting error is the mean square error, and its calculation formula is:
[0116]
[0117] where N is the number of data points, y i is the actual observed value, is the predicted value of the fitting curve.
[0118] Furthermore, after controlling the initial step size to decrease according to the first preset proportional value in step S412, it further includes:
[0119] Step S412a, when the change value of the mean square error is greater than the second preset proportional value, decrease the step size value.
[0120] In the iterative optimization process of curve fitting, if the decrease amplitude of the mean square error (MSE) after the current step size adjustment exceeds the preset threshold (e.g., the second preset proportional value is set to 20%), it indicates that the current step size is still too large, resulting in oscillations or skipping the optimal solution in the fitting process. At this time, the step size needs to be further reduced to improve the precision. For example, assume the initial step size is 0.1, after the first adjustment, the step size is reduced to 0.05, and the MSE drops from 0.5 to 0.3 (the change value is 40%), exceeding the 20% threshold, then the step size is halved again to 0.025 and continue the iteration. This strategy is similar to the adaptive learning rate adjustment in gradient descent, ensuring the stability of the algorithm when approaching the optimal solution by dynamically reducing the step size.
[0121] Step S412b, when the change value of the mean square error is less than the third preset proportional value, increase the step size value.
[0122] If the change amplitude of the MSE is less than the third preset ratio value (e.g., 5%), it indicates that the current step size is too small, resulting in an overly slow convergence rate during the fitting process. At this time, the step size needs to be appropriately increased to accelerate convergence. For example, when the step size is 0.01 and the MSE decreases from 0.1 to 0.098 (the change value is 2%), which is lower than the 5% threshold, the step size is increased to 0.015 to explore the parameter space with a larger step size. This strategy ensures the fitting accuracy while avoiding getting trapped in a local optimum due to an overly small step size and improves the algorithm efficiency.
[0123] Step S412c, when the change value of the mean square error is greater than or equal to the third preset ratio value and less than or equal to the second preset ratio value, keep the step size value unchanged.
[0124] When the change amplitude of the MSE is in the middle range (e.g., 5% - 20%), it indicates that the current step size adjustment strategy is effective and there is no need to further change the step size. For example, when the step size is 0.05 and the MSE decreases from 0.4 to 0.35 (the change value is 12.5%), which is between 5% and 20%, the step size is kept unchanged at this time and the iteration continues. This strategy balances the convergence rate and the fitting accuracy, prevents waste of computing resources due to frequent adjustment of the step size, and at the same time ensures the optimization of parameters within a reasonable range.
[0125] In addition, the drift sequence and the convolution sequence set are:
[0126]
[0127] Among them, x(m) is the reference spectral sequence; h(n - m) is the smoothed discrete spectrum; m is the variable for summation, traversing each sample point of the input sequence; n is the time index of the output sequence, used to determine the specific position in the convolution result sequence.
[0128] In a specific implementation manner of the embodiment of the present invention, as Figure 4 , Figure 5 and Figure 6 shown, first, the original waveform data of the gallium arsenide fiber optic temperature sensor at 40°C - 240°C with a step size of 10°C is collected using a multi-channel experimental device. Five groups of data are collected for each temperature value. At the same time, the long-pass filter (LPF) waveform is collected under the same experimental conditions as the reference spectrum S of the convolution wavelength demodulation algorithm ref , as Figure 3 shown. Then, the five groups of data under each temperature are averaged to obtain the reflected spectral data at that temperature. At the same time, for the interference waveforms of the original data of different channels, targeted denoising measures are taken, such as forced smoothing or directly removing the noise interference spikes, to obtain the preprocessed spectral data S1 with preliminary interference removal, as Figure 4As shown. In order to remove the influence of the original noise, it is necessary to perform filtering and smoothing on S1. In the present invention, the smoothed discrete spectrum S2 is obtained after quadratic Gaussian filtering, as Figure 5 shown. The reference spectrum S ref and the smoothed discrete spectrum S2 are normalized to obtain the reference spectrum S ref’ and the smoothed discrete spectrum S 2’ , as Figure 6 shown.
[0129] By performing convolution operation on the smoothed discrete spectrum S 2’ and the reference spectrum S ref’ , a set of drift sequences and convolution sequences C xh (n) is obtained. According to the specific example of the present invention, the convolution sequence result can be obtained from the following formula:
[0130]
[0131] In the formula, x(n) and h(n) are respectively the normalized LPF discrete reference spectrum sequence and the discrete spectrum sequence after denoising (smoothing) and normalization. Through convolution operation, the set of drift sequences and convolution sequences C xh (n) of the two can be obtained.
[0132] The fitting curve of the sequence group C xh (n) is obtained through curve fitting, as Figure 7 shown (taking 100 °C as an example), and the peak search step accuracy is set according to actual requirements. The product of the drift amount corresponding to the peak position and the sampling wavelength interval is the wavelength drift value corresponding to this temperature. The principle of the curve fitting peak search algorithm is as follows:
[0133] (1) Define the fitting curve model: y = P(1) × x 4 +P(2) × x 3 +P(3) × x 2 +P(4) × x + P(5).
[0134] (2) Define the fitting parameters: x and y are respectively the drift sequence values and the correlation coefficient sequence values, and P(1), P(2), P(3), P(4) and P(5) are respectively the coefficient values of each order variable x.
[0135] (3) Substitute the corresponding sequence values in the C1 sequence group for iterative fitting, and finally obtain the model parameters with the smallest fitting error, that is, the model that best fits the original curve.
[0136] (4) Adopt a sampling interval that meets the actual accuracy requirements for the fitting curve, and the product of the drift value corresponding to the obtained peak and the sampling wavelength interval gives the wavelength drift value at this temperature.
[0137] The wavelength drift values at different temperatures and the corresponding temperature values are fitted by a quadratic polynomial to obtain the temperature-wavelength drift corresponding curve, as Figure 8 shown.
[0138] Correspondingly, please refer to Figure 9 For the second aspect of the embodiments of the present invention, an adaptive convolution wavelength demodulation system based on a reference filter is provided, and demodulation is performed based on the adaptive convolution wavelength demodulation method of the reference filter, including:
[0139] A data acquisition module 1, which is used to acquire the original waveform data collected by the fiber optic temperature sensor, and after performing quadratic Gaussian filtering on the original waveform data, obtain a smoothed discrete spectrum;
[0140] A dynamic adjustment module 2, which is used to obtain the noise level of the original waveform data and dynamically adjust the convolution kernel of the convolution operation according to the noise level;
[0141] A convolution operation module 3, which is used to obtain a reference spectrum under the same acquisition conditions as the original waveform data based on a long-wave pass filter, and perform convolution operation on the reference spectrum and the smoothed discrete spectrum by combining the adjusted convolution kernel to obtain a drift sequence and a convolution sequence set;
[0142] A curve fitting module 4, which is used to perform curve fitting through the drift sequence and the convolution sequence set to obtain the temperature-wavelength drift corresponding curve, and obtain the corresponding temperature value according to the wavelength detection value.
[0143] Correspondingly, the third aspect of the embodiments of the present invention further provides an electronic device, including: at least one processor; and a memory connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the above-mentioned adaptive convolution wavelength demodulation method based on a reference filter.
[0144] In addition, the fourth aspect of the embodiments of the present invention further provides a computer-readable storage medium, on which computer instructions are stored, and when the instructions are executed by a processor, the above-mentioned adaptive convolution wavelength demodulation method based on a reference filter is implemented.
[0145] An embodiment of the present invention aims to protect an adaptive convolution wavelength demodulation method based on a reference filter, which includes the following steps: obtaining the original waveform data collected by an optical fiber temperature sensor, and after performing quadratic Gaussian filtering on the original waveform data, obtaining a smooth discrete spectrum; obtaining the noise level of the original waveform data, and dynamically adjusting the convolution kernel of the convolution operation according to the noise level; obtaining a reference spectrum under the same acquisition conditions as the original waveform data based on a long-pass filter, and performing a convolution operation on the reference spectrum and the smooth discrete spectrum to obtain a drift sequence and a set of convolution sequences; performing curve fitting through the drift sequence and the set of convolution sequences to obtain a temperature-wavelength drift correspondence curve, and obtaining the corresponding temperature value according to the wavelength detection value. The above technical solution has the following effects:
[0146] 1. By dynamically adjusting the matching mechanism of the convolution kernel type (such as Gaussian distribution, uniform distribution, bilateral filtering) and the noise level (low, medium, high), precise adaptation to different noise environments is achieved. For example, a bilateral filtering kernel is used for a high noise level to suppress noise while retaining the spectral edge features, and a Gaussian kernel is used for a low noise level to reduce computational redundancy. The demodulation stability of the system in complex noise scenarios is significantly improved. Compared with the method of a fixed kernel type, the signal-to-noise ratio can be increased by 20%-35%, which is especially suitable for extreme environments such as strong electromagnetic interference in industrial sites;
[0147] 2. Combining the noise frequency-domain and time-domain features extracted by signal preprocessing (denoising, normalization) and FFT transformation, a structured noise feature vector is constructed. After being standardized, the vector uses a classification algorithm to achieve intelligent discrimination of the noise level. Experimental data shows that compared with single-domain feature analysis, the multi-domain fusion method improves the noise classification accuracy from 78% to 92%, effectively solving the problem of insufficient recognition of complex noise types by traditional single-domain analysis, and providing a reliable basis for subsequent dynamic adjustment of the convolution kernel;
[0148] 3. Introduce a step-size adaptive adjustment mechanism in the curve fitting stage: when the change in the mean square error exceeds 20%, reduce the step size to improve the accuracy, and when the change is less than 5%, increase the step size to accelerate convergence. Combining quadratic polynomial fitting, non-linear modeling of the temperature-wavelength drift relationship is achieved. Measured data shows that this method controls the temperature measurement error within ±0.3°C, and the error is reduced by about 40% compared with the traditional linear fitting method, which is especially suitable for compensating the non-linear response characteristics of optical fiber sensors and ensuring the high-precision requirements of industrial temperature measurement.
[0149] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) that contain computer-usable program code.
[0150] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or the combination of blocks.
[0151] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing devices to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or the combination of blocks.
[0152] These computer program instructions can also be loaded onto a computer or other programmable data processing devices, such that a series of operation steps are executed on the computer or other programmable devices to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable devices provide steps for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or the combination of blocks.
[0153] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that: still can modify the specific implementation manners of the present invention or make equivalent substitutions, and any modification or equivalent substitution that does not depart from the spirit and scope of the present invention shall be covered by the protection scope of the claims of the present invention.
Claims
1. An adaptive convolution wavelength demodulation method based on a reference filter, characterized in that It includes the following steps: Obtain the original waveform data collected by an optical fiber temperature sensor, and after performing quadratic Gaussian filtering on the original waveform data, obtain a smoothed discrete spectrum; Obtain the noise level of the original waveform data, and dynamically adjust the convolution kernel of the convolution operation according to the noise level; Based on a long-pass filter, obtain a reference spectrum under the same acquisition conditions as the original waveform data, and perform convolution operations on the reference spectrum and the smoothed discrete spectrum by combining the adjusted convolution kernel to obtain a drift sequence and a set of convolution sequences; Perform curve fitting through the drift sequence and the set of convolution sequences to obtain a temperature-wavelength drift corresponding curve, and obtain the corresponding temperature value according to the wavelength detection value.
2. The adaptive convolution wavelength demodulation method based on a reference filter according to claim 1, wherein The obtaining the noise level of the original waveform data includes: Perform signal preprocessing on the original waveform data, and the signal preprocessing includes denoising and normalization processing; Perform fast Fourier transform on the preprocessed original waveform data to obtain the noise frequency domain characteristics and noise time domain characteristics of the original waveform data; Based on the noise frequency domain characteristics and the noise time domain characteristics, obtain a noise feature vector, and store it as noise structured data after standardization processing; Based on the noise feature vector, calculate the noise level, and the noise level includes a low noise level, a medium noise level, and a high noise level.
3. The adaptive convolution wavelength demodulation method based on a reference filter according to claim 2, wherein The dynamically adjusting the convolution kernel of the convolution operation according to the noise level includes: Obtain the noise level of the current detection period; Based on the noise level, dynamically adjust the type of the convolution kernel corresponding to the current detection period; Wherein, the types of the convolution kernel include: a first type of convolution kernel corresponding to the low noise level, a second type of convolution kernel corresponding to the medium noise level, and a third type of convolution kernel corresponding to the high noise level.
4. The adaptive convolution wavelength demodulation method based on a reference filter according to claim 3, wherein The first type of convolution kernel is 3×3, and the corresponding weight type is Gaussian distribution; The second type of convolution kernel is 5×5, and the corresponding weight type is uniform distribution; The third type of convolution kernel is 7×7, and the corresponding weight type is bilateral filtering.
5. The adaptive convolution wavelength demodulation method based on a reference filter according to any one of claims 1-4, characterized in that The performing curve fitting through the drift sequence and the set of convolution sequences to obtain a temperature-wavelength drift corresponding curve includes: Perform curve fitting on the drift sequence and the set of convolution sequences to obtain the wavelength drift value corresponding to the peak value of the fitting curve; Perform quadratic polynomial fitting on multiple groups of the wavelength drift values and the corresponding temperature values to obtain the temperature-wavelength drift corresponding curve.
6. The adaptive convolution wavelength demodulation method based on a reference filter according to claim 5, wherein The performing curve fitting on the drift sequence and the set of convolution sequences includes: Obtain an initial step size, and calculate the fitting error based on the initial step size; When the fitting error is greater than a first preset error value, control the initial step size to decrease according to a first preset ratio value; When the fitting error is less than or equal to the first preset ratio value, keep the initial step size value.
7. The adaptive convolution wavelength demodulation method based on a reference filter according to claim 6, wherein The fitting error is the mean square error, and its calculation formula is: where N is the number of data points, and y i is the actual observed value, is the predicted value of the fitting curve.
8. The adaptive convolution wavelength demodulation method based on a reference filter according to claim 7, wherein After controlling the initial step size to decrease according to the first preset ratio value, it further includes: When the change value of the mean square error is greater than the second preset ratio value, decrease the step size value; When the change value of the mean square error is less than the third preset ratio value, increase the step size value; When the change value of the mean square error is greater than or equal to the third preset ratio value and less than or equal to the second preset ratio value, keep the step size value unchanged.
9. The adaptive convolution wavelength demodulation method based on a reference filter according to any one of claims 1-4, characterized in that The drift sequence and the convolution sequence set are: where x(m) is the reference spectral sequence; h(n-m) is the smoothed discrete spectrum; m is the variable for summation, traversing each sample point of the input sequence; n is the time index of the output sequence, used to determine the specific position in the convolution result sequence.
10. An adaptive convolution wavelength demodulation system based on a reference filter, characterized in that, Demodulating according to the adaptive convolution wavelength demodulation method based on a reference filter according to any one of claims 1-9, includes: A data acquisition module, which is used to acquire the original waveform data collected by the fiber optic temperature sensor, and after performing quadratic Gaussian filtering on the original waveform data, obtain the smoothed discrete spectrum; A dynamic adjustment module, which is used to obtain the noise level of the original waveform data and dynamically adjust the convolution kernel of the convolution operation according to the noise level; A convolution operation module, which is used to obtain a reference spectrum under the same acquisition conditions as the original waveform data based on a long-pass filter, and perform convolution operation on the reference spectrum and the smoothed discrete spectrum by combining the adjusted convolution kernel to obtain a drift sequence and a convolution sequence set; A curve fitting module, which is used to perform curve fitting through the drift sequence and the convolution sequence set to obtain a temperature-wavelength drift corresponding curve, and obtain the corresponding temperature value according to the wavelength detection value.