DTS demodulation device based on non-local mean algorithm and noise reduction algorithm module thereof
By constructing and offsetting a two-dimensional matrix, and using neighborhood windows with the same center offset to calculate neighborhood similarity and weight values, the problem of slow noise reduction processing speed in long-distance sensing of DTS system is solved, and more efficient temperature sensing is achieved.
Patent Information
- Application Number
- CN202510818940.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2045-06-18
AI Technical Summary
Existing DTS systems have slow noise reduction processing speed in long-distance sensing and cannot adapt to parallel processing, which affects the accuracy and reliability of temperature sensing.
A noise reduction algorithm module based on nonlocal means is adopted. The original two-dimensional matrix is constructed and offset. Neighborhood similarity and weight values are calculated using neighborhood windows with the same center offset. Parallel processing is used to shorten the data traversal time, and Stokes and anti-Stokes data are processed in the same matrix.
It shortens the noise reduction processing time of DTS data, improves the accuracy and reliability of temperature sensing, and enables the application of DTS system in long-distance sensing.
Smart Images

Figure CN120929718A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fiber optic sensing, and in particular to a DTS demodulation device based on a nonlocal mean algorithm and its noise reduction algorithm module. Background Technology
[0002] Distributed Temperature Sensing (DTS) is a technology that uses the spontaneous Raman scattering effect generated when a laser pulse propagates through an optical fiber to monitor temperature. When a laser pulse propagates through an optical fiber, backscattered light is generated due to factors such as the thermal motion of molecules within the fiber. The intensity and frequency of this backscattered light are related to the temperature of the fiber. Specifically, when incident photons interact with optical phonons in the fiber material, two types of frequency-shifted scattered light are produced: Stokes light with a lower frequency and anti-Stokes light with a higher frequency. Anti-Stokes light exhibits an exponential response to temperature changes, while Stokes light is relatively less affected by temperature; its scattering intensity is closely related to temperature, but it is not sensitive to changes in other parameters such as stress. Therefore, the temperature can be measured by the intensity ratio between Stokes light and anti-Stokes light.
[0003] However, when acquiring temperature data, DTS systems are inevitably affected by various noises, such as thermal noise from photodetectors and noise from electronic circuits. These noises can affect the accuracy and reliability of temperature sensing. Existing technologies, such as patent application number CN202310153853.8, disclose the use of nonlocal averaging algorithms to denoise the raw temperature data of the DTS system before demodulation, in order to improve the accuracy of temperature sensing.
[0004] The nonlocal means algorithm transforms the Stokes original data and the anti-Stokes original data into a two-dimensional data matrix. A search window is then set within this matrix to traverse all the original data, determining the neighboring data corresponding to each original data point when it is used as the data to be denoised. The search window contains two neighboring windows: a first neighboring window centered on the data to be denoised, with a fixed position, and a second neighboring window that traverses all neighboring data within the search window. The Euclidean distance between each second neighboring window and the first neighboring window is calculated, and a weight is assigned to each neighboring data point within the search window based on this Euclidean distance. Finally, a weighted sum is performed on each neighboring data point according to its respective weight to obtain the denoised value of the data to be denoised.
[0005] Traditional nonlocal means algorithms, when traversing a two-dimensional data matrix using a search window, require calculating the denoising value for each data point before moving on to the next. Similarly, when using a first-neighborhood window to traverse the search window, the neighborhood similarity and weight values for each neighboring data point must be calculated before moving on to the next. This denoising approach involves a large amount of computation and is unsuitable for parallel processing, resulting in slow denoising speeds. This significantly limits the application of DTS systems in long-distance sensing. Summary of the Invention
[0006] To address the shortcomings of the prior art, this invention provides a noise reduction algorithm module and a DTS demodulation device based on a nonlocal mean algorithm, which can shorten the noise reduction processing time of DTS data, thereby enabling the application of DTS systems in long-distance sensing.
[0007] The technical problem to be solved by the present invention is achieved through the following technical solution:
[0008] A noise reduction algorithm module based on a nonlocal means algorithm includes a processor and a memory interconnected, wherein the memory stores a computer program for the processor to execute; when the processor executes the computer program, it performs the following steps:
[0009] Step 100: Construct an original two-dimensional matrix using the input Stokes original data and the reverse Stokes original data, wherein the original two-dimensional matrix includes multiple original data;
[0010] Step 200: Set the size of the search window and the neighborhood window, and the movement step size of the neighborhood window within the search window, so as to determine multiple neighborhood windows within the search window;
[0011] Step 300: Based on the center offset between each neighborhood window and the search window, offset the original data in the original two-dimensional matrix to obtain multiple offset two-dimensional matrices, with each offset two-dimensional matrix corresponding to a center offset.
[0012] Step 400: Use the search window to traverse each original data in the original two-dimensional matrix and each offset two-dimensional matrix, and use the neighborhood window to step in each search window to determine the neighborhood windows with the same center offset between different search areas in the original two-dimensional matrix, and the neighborhood windows with the same center position between the original two-dimensional matrix and each offset two-dimensional matrix.
[0013] Step 500: Calculate the neighborhood similarity between the neighborhood windows with the same center offset in the original two-dimensional matrix and the neighborhood windows with the same center position in each offset two-dimensional matrix, and assign weight values to the original data corresponding to each neighborhood window in the original two-dimensional matrix according to the neighborhood similarity.
[0014] Step 600: Perform a weighted summation of the original data corresponding to each search window within the original two-dimensional matrix to obtain a denoised two-dimensional matrix. The denoised two-dimensional matrix includes multiple denoised data, with one denoised data corresponding to one original data.
[0015] Step 700: Output Stokes denoising data and anti-Stokes denoising data based on the denoising two-dimensional matrix.
[0016] Furthermore, both the original two-dimensional matrix and the denoised two-dimensional matrix include M rows and N columns, where M and N ≥ 2. Different rows of original data and different rows of denoised data correspond to different temperature measurement times, and different columns of original data and different columns of denoised data correspond to different temperature measurement positions. Each row of original data and each row of denoised data is arranged in order according to the temperature measurement position, and each column of original data and each column of denoised data is arranged in order according to the temperature measurement time.
[0017] Furthermore, there are two original two-dimensional matrices, namely a first original two-dimensional matrix and a second original two-dimensional matrix. The first original two-dimensional matrix is established from the original Stokes data, and the second original two-dimensional matrix is established from the inverse Stokes data. There are also two denoised two-dimensional matrices, namely a first denoised two-dimensional matrix and a second denoised two-dimensional matrix. The first denoised two-dimensional matrix is obtained by denoising the first original two-dimensional matrix, and the second denoised two-dimensional matrix is obtained by denoising the second original two-dimensional matrix.
[0018] Furthermore, there is only one original two-dimensional matrix, and each original data is formed by connecting Stokes original data and anti-Stokes original data corresponding to the same temperature measurement time and the same temperature measurement location; there is also only one noise reduction two-dimensional matrix, and each noise reduction data can be disconnected to form Stokes noise reduction data and anti-Stokes noise reduction data corresponding to the same temperature measurement time and the same temperature measurement location.
[0019] Furthermore, in step 100, when constructing the original two-dimensional matrix based on the original Stokes data and the inverse original Stokes data, the following steps are included:
[0020] Step 110: Identify the data lengths of the original Stokes data and the reversed original Stokes data;
[0021] Step 120: Connect the Stokes raw data and reverse Stokes raw data corresponding to the same temperature measurement time and the same temperature measurement location to form the corresponding raw data;
[0022] Step 130: Based on the data lengths of the Stokes raw data and the anti-Stokes raw data, set a first identification window and a second identification window on each raw data. The first identification window is set at the Stokes part of each raw data, and the second identification window is set at the anti-Stokes part of each raw data.
[0023] Step 140: Use the original data with the first recognition window and the second recognition window set to establish the original two-dimensional matrix.
[0024] Furthermore, in step 700, when outputting Stokes denoised data and anti-Stokes denoised data based on the denoising two-dimensional matrix, the following steps are included:
[0025] Step 710: Extract the denoised data with the first recognition window and the second recognition window set from the denoised two-dimensional matrix one by one;
[0026] Step 720: Based on the window lengths of the first and second recognition windows, identify the Stokes portion and the anti-Stokes portion in each denoised data;
[0027] Step 730: Separate the Stokes part and the anti-Stokes part of each noise reduction data to form Stokes noise reduction data and anti-Stokes noise reduction data corresponding to the same temperature measurement time and the same temperature measurement location, respectively.
[0028] Furthermore, in step 300, when offsetting the original data within the original two-dimensional matrix according to the center offset between each neighborhood window and the search window to obtain multiple offset two-dimensional matrices, the following steps are included:
[0029] Step 310: Expand the outer perimeter of the original two-dimensional matrix to obtain an expanded two-dimensional matrix;
[0030] Step 320: Based on the center offset between each neighborhood window and the search window, set multiple offset windows with the same size as the original two-dimensional matrix within the extended two-dimensional matrix to obtain multiple offset two-dimensional matrices, with one offset two-dimensional matrix corresponding to one offset window.
[0031] Furthermore, in step 500, when calculating the neighborhood similarity between the neighborhood windows with the same center offset in the original two-dimensional matrix and the neighborhood windows with the same center position in each offset two-dimensional matrix, the following steps are included:
[0032] Step 510: Calculate the integral two-dimensional matrix corresponding to each offset two-dimensional matrix;
[0033] Step 520: Calculate the neighborhood similarity of each neighborhood window within the original two-dimensional matrix based on the integral two-dimensional matrix of each offset two-dimensional matrix.
[0034] Furthermore, in step 510, the integral two-dimensional matrix corresponding to each offset two-dimensional matrix is calculated using the following formula:
[0035]
[0036] Where I(i,j) is the original data in the i-th row and j-th column of each offset two-dimensional matrix, and Q(x,y) is the integral value in the x-th row and y-th column of the corresponding integral two-dimensional moment.
[0037] Furthermore, in step 510, when calculating the integral two-dimensional matrix corresponding to each offset two-dimensional matrix, the following steps are included:
[0038] Step 511: Subtract each offset two-dimensional matrix from the original two-dimensional matrix to obtain the difference two-dimensional matrix corresponding to each offset two-dimensional matrix;
[0039] Step 512: Calculate the square value of each difference two-dimensional matrix to obtain the squared two-dimensional matrix corresponding to each offset two-dimensional matrix;
[0040] Step 513: Calculate the integral value for each squared two-dimensional matrix to obtain the integral two-dimensional matrix corresponding to each offset two-dimensional matrix.
[0041] Furthermore, in step 513, the integral value is calculated for each squared two-dimensional matrix using the following formula:
[0042]
[0043] Where I(i,j) is the square value of the i-th row and j-th column in each squared two-dimensional matrix, and Q(x,y) is the integral value of the x-th row and y-th column in the corresponding integral two-dimensional moment.
[0044] Furthermore, in step 520, the neighborhood similarity (MSE) of each neighborhood window within the original two-dimensional matrix is calculated using the following formula:
[0045] MSE = (P4 - P2 - P3 + P1) / S
[0046] Wherein, P1, P2, P3 and P4 are the integral values of the four corners of the same neighborhood window in the original two-dimensional matrix in the integral two-dimensional matrix, and S is the area of the neighborhood window.
[0047] A DTS demodulation device includes the following steps:
[0048] The data acquisition module is used to acquire Stokes raw data and reverse Stokes raw data of the temperature measuring fiber at different calibration temperatures;
[0049] The aforementioned noise reduction algorithm module is used to perform noise reduction processing on the original Stokes data and the original anti-Stokes data to obtain Stokes noise reduction data and anti-Stokes noise reduction data at different calibration temperatures;
[0050] The demodulation calculation module is used to calculate the light intensity ratio of the Stokes noise-reduced data and the anti-Stokes noise-reduced data at different calibration temperatures, thereby determining the relationship curve between the light intensity ratio and the temperature value.
[0051] The present invention has the following beneficial effects:
[0052] The noise reduction algorithm module of this invention is based on the nonlocal mean algorithm. It first offsets the original data in the original two-dimensional matrix according to the center offset between each neighborhood window and the search window to obtain multiple offset two-dimensional matrices. When traversing the original two-dimensional matrix and each offset two-dimensional matrix using the search window and neighborhood window, it does not directly calculate the neighborhood similarity and weight values. Instead, it first determines the neighborhood windows with the same center offset between different search regions in the original two-dimensional matrix, as well as the neighborhood windows with the same center position between the original two-dimensional matrix and each offset two-dimensional matrix. Finally, it calculates the neighborhood similarity and weight values between the neighborhood windows with the same center offset in the original two-dimensional matrix and the neighborhood windows with the same center position in each offset two-dimensional matrix. This shortens the data traversal time in the early stage. The calculation of neighborhood similarity and weight values in the later stage can be carried out in parallel, trading computing power for time, thereby shortening the noise reduction processing time of DTS data and realizing the application of DTS system in long-distance sensing.
[0053] When the noise reduction algorithm module of the present invention transforms the Stokes original data and the anti-Stokes original data into the original two-dimensional matrix, it connects the corresponding Stokes original data and the anti-Stokes original data to form corresponding original data, so that the Stokes original data and the anti-Stokes original data can be denoised in the same original two-dimensional matrix. After the noise reduction is completed, each denoised data in the denoised two-dimensional matrix is disconnected to form the Stokes denoised data and the anti-Stokes denoised data respectively, so as to further shorten the noise reduction processing time of DTS data.
[0054] When calculating neighborhood similarity, the noise reduction algorithm module of the present invention pre-calculates a corresponding integral two-dimensional matrix for each offset two-dimensional matrix, and uses the integral value of each original data in the original two-dimensional matrix to quickly calculate neighborhood similarity, thereby further shortening the noise reduction processing time of DTS data. Attached Figure Description
[0055] Figure 1 The structural block diagram of the DTS system provided by the present invention.
[0056] Figure 2 This is a structural block diagram of the DTS demodulation device provided by the present invention.
[0057] Figure 3 This is a structural block diagram of the noise reduction algorithm module provided by the present invention.
[0058] Figure 4 This is a flowchart illustrating the steps of the DTS demodulation device provided by the present invention.
[0059] Figure 5 This is a flowchart illustrating the steps of the noise reduction algorithm module provided by the present invention.
[0060] Figure 6 This is a schematic diagram of the original two-dimensional matrix in the noise reduction algorithm module provided by the present invention.
[0061] Figure 7 This is a schematic diagram illustrating the offsetting of the original two-dimensional matrix in the noise reduction algorithm module provided by the present invention.
[0062] Figure 8 This is a step-by-step flowchart of step 300 in the noise reduction algorithm module provided by the present invention.
[0063] Figure 9 This is a schematic diagram of the denoising algorithm module provided by the present invention, which extracts an offset two-dimensional matrix from an extended two-dimensional matrix.
[0064] Figure 10This is a schematic diagram comparing the original two-dimensional matrix and the offset two-dimensional matrix in the noise reduction algorithm module provided by the present invention.
[0065] Figure 11 This is a schematic diagram of the two-dimensional noise reduction matrix in the noise reduction algorithm module provided by the present invention.
[0066] Figure 12 This is a step-by-step flowchart of step 100 in another noise reduction algorithm module provided by the present invention.
[0067] Figure 13 This is a step-by-step flowchart of step 700 in another noise reduction algorithm module provided by the present invention.
[0068] Figure 14 This is a step-by-step flowchart of step 500 in another noise reduction algorithm module provided by the present invention.
[0069] Figure 15 This is a step-by-step flowchart of step 510 in another noise reduction algorithm module provided by the present invention. Detailed Implementation
[0070] The present invention will now be described in detail with reference to the accompanying drawings and embodiments, examples of which are shown in the drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.
[0071] In the description of this invention, it should be understood that the terms "length", "width", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0072] Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first," "second," or "third" may explicitly or implicitly include one or more of that feature. In the description of this invention, "multiple" means two or more, unless otherwise explicitly specified.
[0073] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," "fixing," and "setting," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0074] Example 1
[0075] like Figure 1 As shown, a DTS system includes a DTS demodulation device 1, a data acquisition device 2, a temperature control device 3, and a temperature-sensing optical fiber 4. The temperature control device 3 has a reference optical fiber 31, which is connected between the data acquisition device 2 and the temperature-sensing optical fiber 4. The DTS demodulation device 1 is connected to both the data acquisition device 2 and the temperature control device 3 to obtain Stokes raw data and inverse Stokes raw data from the data acquisition device 2 for noise reduction and demodulation, and to control the temperature control device 3 to maintain the reference optical fiber 31 at a constant temperature so that the reference optical fiber 31 can output calibration data.
[0076] The data acquisition device 2 includes a high-speed pulsed light source 21, a Raman wavelength division multiplexer 22, an avalanche photodetector 23, a signal amplifier 24, a dual-channel high-speed signal acquisition device 25, and a synchronization signal controller 26. The Raman wavelength division multiplexer 22 is connected to the high-speed pulsed light source 21, the reference fiber 31, and the avalanche photodetector 23 to couple the pulsed light signal emitted by the high-speed pulsed light source 21 into the reference fiber 31, so that the pulsed light signal passes through the reference fiber 31 and enters the temperature-sensing fiber 4. It also couples the Stokes light and the reflected Stokes light output from the temperature-sensing fiber 4 through the reference fiber 31 into the avalanche photodetector 23. The avalanche photodetector 23 performs photoelectric conversion; the signal amplifier 24 is connected between the avalanche photodetector 23 and the dual-channel high-speed signal acquisition unit 25 to amplify the electrical signal output by the avalanche photodetector 23 and provide it to the dual-channel high-speed signal acquisition unit 25 for acquisition, so as to obtain the Stokes raw data and the reverse Stokes raw data and output them to the DTS demodulation device 1; the synchronization signal controller 26 is connected between the high-speed pulse light source 21 and the dual-channel high-speed signal acquisition unit 25 to control the signal acquisition timing of the dual-channel high-speed signal acquisition unit 25 according to the pulse emission timing of the high-speed pulse light source 21.
[0077] Example 2
[0078] like Figure 2 and 3 As shown, a DTS demodulation device is used in the DTS system described in Embodiment 1, and includes:
[0079] The data acquisition module is used to acquire Stokes raw data and reverse Stokes raw data of the temperature measuring fiber at different calibration temperatures;
[0080] The noise reduction algorithm module is used to perform noise reduction processing on the original Stokes data and the original anti-Stokes data to obtain Stokes noise reduction data and anti-Stokes noise reduction data at different calibration temperatures.
[0081] The demodulation calculation module is used to calculate the light intensity ratio of the Stokes noise-reduced data and the anti-Stokes noise-reduced data at different calibration temperatures, thereby determining the relationship curve between the light intensity ratio and the temperature value.
[0082] Example 3
[0083] like Figure 4 and 5 As shown, a noise reduction algorithm module based on a nonlocal means algorithm is used in the DTS demodulation device described in Embodiment 2. It includes a processor and a memory interconnected, with the memory storing a computer program for the processor to execute. When the processor executes the computer program, it performs the following steps:
[0084] Step 100: Construct an original two-dimensional matrix using the input Stokes raw data and the reverse Stokes raw data, wherein the original two-dimensional matrix includes multiple raw data.
[0085] In step 100, such as Figure 6 As shown, the original two-dimensional matrix includes M rows and N columns of original data, where M and N ≥ 2. Different rows of original data correspond to different temperature measurement times of the temperature-measuring optical fiber, and different columns of original data correspond to different temperature measurement positions of the temperature-measuring optical fiber. Each row of original data is arranged sequentially according to the temperature measurement position of the temperature-measuring optical fiber, and each column of original data is arranged sequentially according to the temperature measurement time of the temperature-measuring optical fiber.
[0086] In this embodiment, there are two original two-dimensional matrices, namely a first original two-dimensional matrix and a second original two-dimensional matrix. The first original two-dimensional matrix is established by the Stokes original data, and the second original two-dimensional matrix is established by the inverse Stokes original data. One original data in the first original two-dimensional matrix corresponds to one Stokes original data, and one original data in the second original two-dimensional matrix corresponds to one inverse Stokes original data.
[0087] Step 200: Set the size of the search window and the neighborhood window, as well as the movement step of the neighborhood window within the search window, to determine multiple neighborhood windows within the search window.
[0088] In step 200, the size of the search window is (2R+1)*(2R+1), where R is the radius of the search window, and the size of the neighborhood window is (2r+1)*(2r+1), where r is the radius of the neighborhood window. This ensures that regardless of the values of R and r, the number of rows and columns in both the search window and the neighborhood window is odd. Once the sizes of the search window and the neighborhood window, as well as the movement step size of the neighborhood window, are set, the number of neighborhood windows within the search window and the position of each neighborhood window within the search window can be determined.
[0089] The size of the search window and the neighborhood window, as well as the movement step size of the neighborhood window, need to be determined based on computing power resources and noise reduction accuracy. Theoretically, the larger the size of the search window, the smaller the neighborhood window, and the smaller the movement step size, the higher the noise reduction accuracy, but the greater the computing power requirement and the longer the calculation time. Conversely, the smaller the size of the search window, the larger the neighborhood window, and the larger the movement step size, the lower the noise reduction accuracy, but the less computing power requirement and the shorter the calculation time.
[0090] Step 300: Based on the center offset between each neighborhood window and the search window, offset the original data within the original two-dimensional matrix to obtain multiple offset two-dimensional matrices, with each offset two-dimensional matrix corresponding to a center offset.
[0091] In step 300, the center offset between the neighborhood window and the search window refers to the offset between the center position of the neighborhood window and the center position of the search window. The original data located at the center position of the search window is the data to be denoised, and all the original data within the search window are the neighborhood data of the data to be denoised. The neighborhood data located at the center position of the neighborhood window is used to calculate the denoising value of the data to be denoised, and all the neighborhood data within the neighborhood window are used to calculate the neighborhood similarity.
[0092] like Figure 7 As shown, assuming the center position of the search window is the original data in row i1 and column i1, and the center position of the neighborhood window is the original data in row i2 and column i2, then the row offset Δi = i1 - i2 and the column offset Δj = j1 - j2 between them can be obtained by simultaneously offsetting the original data in the original two-dimensional matrix by Δi rows and Δj columns.
[0093] Specifically, such as Figure 8 As shown, in step 300, when the original data within the original two-dimensional matrix is offset according to the center offset between each neighborhood window and the search window to obtain multiple offset two-dimensional matrices, the following steps are included:
[0094] Step 310: Expand the outer periphery of the original two-dimensional matrix to obtain an expanded two-dimensional matrix.
[0095] In step 310, such as Figure 9 As shown, R+r columns of original data are extended along the row direction on both sides of the original two-dimensional matrix (the inner solid line box on the right), and R+r rows of original data are extended along the column direction on both sides of the original two-dimensional matrix to obtain an extended two-dimensional matrix with (M+2R+2r) rows and (N+2R+2r) columns (the outer solid line box on the right). The specific extension method can be mirror reflection extension or edge repetition extension, which are existing technologies and will not be described in detail.
[0096] Step 320: Based on the center offset between each neighborhood window and the search window, set multiple offset windows with the same size as the original two-dimensional matrix within the extended two-dimensional matrix to obtain multiple offset two-dimensional matrices, with one offset two-dimensional matrix corresponding to one offset window.
[0097] In step 320, assuming that the row offset of a certain neighborhood window and the search window is Δi and the column offset is Δj, a corresponding offset window is set in the extended two-dimensional matrix. The row offset of this offset window and the original two-dimensional matrix is also Δi and the column offset is also Δj. Then, the original data in the offset window is extracted to form the corresponding offset two-dimensional matrix.
[0098] like Figure 9 As shown, assuming there are four neighboring windows within the search window, the first neighboring window has a first center offset (Δi1, Δi1) from the search window, the second neighboring window has a second center offset (Δi2, Δi2) from the search window, the third neighboring window has a third center offset (Δi3, Δi3) from the search window, and the fourth neighboring window has a fourth center offset (Δi4, Δi4) from the search window. Then, based on the first center offset, the second center offset, the third center offset, and the second center offset, corresponding first offset windows, second offset windows, third offset windows, and fourth offset windows are set within the extended two-dimensional matrix to obtain the first offset two-dimensional matrix, the second offset two-dimensional matrix, the third offset two-dimensional matrix, and the fourth offset two-dimensional matrix (the four dashed boxes on the right).
[0099] Step 400: Use the search window to traverse each original data in the original two-dimensional matrix and each offset two-dimensional matrix, and use the neighborhood window to step in each search window to determine the neighborhood windows with the same center offset between different search areas in the original two-dimensional matrix, and the neighborhood windows with the same center position between the original two-dimensional matrix and each offset two-dimensional matrix.
[0100] In step 400, the search window is used to traverse each original data within the original two-dimensional matrix to determine neighboring windows with the same center offset between different search regions within the original two-dimensional matrix; the search window is used to traverse each original data within each offset two-dimensional matrix to determine neighboring windows with the same center position between the original two-dimensional matrix and each offset two-dimensional matrix.
[0101] like Figure 10 As shown, assume the original two-dimensional matrix has four search windows, A, B, C, and D, and each search window has four neighboring windows, A1, A2, A3, A4, B1, B2, B3, B4, C1, C2, C3, C4, D1, D2, D3, and D4. The center offsets between neighboring window A1 and search window A, B1 and search window B, C1 and search window C, and D1 and search window D are all the same. Therefore, neighboring windows A1, B1, C1, and D1 are the neighboring windows with the same center offset within the original two-dimensional matrix.
[0102] Similarly, if the center offsets between neighboring windows A2 and search window A, B2 and search window B, C2 and search window C, and D2 and search window D are all the same, then neighboring windows A2, B2, C2, and D2 are the same neighboring windows with the same center offset within the original two-dimensional matrix. Similarly, if the center offsets between neighboring windows A3 and search window A, B3 and search window B, C3 and search window C, and D3 and search window D are all the same, then neighboring windows A3, B3, C3, and D3 are the same neighboring windows with the same center offset within the original two-dimensional matrix. If the center offsets between neighboring window A4 and search window A, between neighboring window B4 and search window B, between neighboring window C4 and search window C, and between neighboring window D4 and search window D are all the same, then neighboring windows A4, B4, C4, and D4 are the neighboring windows with the same center offset within the original two-dimensional matrix.
[0103] Suppose a certain offset 2D matrix has four search windows, A', B', C', and D', and each search window has four neighboring windows, A1', A2', A3', A4', B1', B2', B3', B4', C1', C2', C3', C4', D1', D2', D3', and D4'. The center position of neighboring window A1 in the original 2D matrix is at row i1 and column j1, and the center position of neighboring window A1' in the offset 2D matrix is also at row i1 and column j1. Therefore, neighboring windows A1 and A1' are the neighboring windows with the same center position between the original 2D matrix and the offset 2D matrix.
[0104] Similarly, neighboring window A2 is centered at row i2, column j2 in the original two-dimensional matrix, and neighboring window A2' is also centered at row i2, column j2 in the offset two-dimensional matrix. Therefore, neighboring windows A2 and A2' are neighboring windows with the same center position between the original two-dimensional matrix and the offset two-dimensional matrix. Similarly, neighboring window A3 is centered at row i3, column j3 in the original two-dimensional matrix, and neighboring window A3' is also centered at row i3, column j3 in the offset two-dimensional matrix. Therefore, neighboring windows A3 and A3' are neighboring windows with the same center position between the original two-dimensional matrix and the offset two-dimensional matrix. Likewise, neighboring window A4 is centered at row i4, column j4 in the original two-dimensional matrix, and neighboring window A4' is also centered at row i4, column j4 in the offset two-dimensional matrix. Therefore, neighboring windows A4 and A4' are neighboring windows with the same center position between the original two-dimensional matrix and the offset two-dimensional matrix.
[0105] Similarly, the neighboring windows B1 and B1', B2 and B2', B3 and B3', B4 and B4', C1 and C1', C2 and C2', C3 and C3', C4 and C4', D1 and D1', D2 and D2', D3 and D3', and D4 and D4' are also the neighboring windows with the same center position between the original two-dimensional matrix and the offset two-dimensional matrix.
[0106] Step 500: Calculate the neighborhood similarity between the neighborhood windows with the same center offset in the original two-dimensional matrix and the neighborhood windows with the same center position in each offset two-dimensional matrix, and assign weight values to the original data corresponding to each neighborhood window in the original two-dimensional matrix according to the neighborhood similarity.
[0107] In step 500, between the original two-dimensional matrix and the first offset two-dimensional matrix, the neighborhood similarity between neighborhood windows A1 and A1' is calculated, the neighborhood similarity between neighborhood windows B1 and B1' is calculated, the neighborhood similarity between neighborhood windows C1 and C1' is calculated, and the neighborhood similarity between neighborhood windows D1 and D1' is calculated. Based on their respective neighborhood similarities, weight values are assigned to the original data corresponding to neighborhood windows A1, B1, C1, and D1 (center positions).
[0108] Similarly, between the original two-dimensional matrix and the second offset two-dimensional matrix, the neighborhood similarity of neighborhood windows A2 and A2' is calculated, the neighborhood similarity of neighborhood windows B2 and B2' is calculated, the neighborhood similarity of neighborhood windows C2 and C2' is calculated, and the neighborhood similarity of neighborhood windows D2 and D2' is calculated. Based on their respective neighborhood similarities, weight values are assigned to the original data corresponding to neighborhood windows A2, B2, C2, and D2 (center positions).
[0109] Between the original two-dimensional matrix and the third offset two-dimensional matrix, the neighborhood similarity of neighborhood windows A3 and A3', neighborhood windows B3 and B3', neighborhood windows C3 and C3', and neighborhood windows D3 and D3' are calculated. Based on their respective neighborhood similarities, weight values are assigned to the original data corresponding to neighborhood windows A3, B3, C3, and D3 (center positions).
[0110] Between the original two-dimensional matrix and the fourth offset two-dimensional matrix, the neighborhood similarity is calculated for neighborhood windows A4 and A4', neighborhood windows B4 and B4', neighborhood windows C4 and C4', and neighborhood windows D4 and D4'. Based on their respective neighborhood similarities, weight values are assigned to the original data corresponding to the neighborhood windows A4, B4, C4, and D4 (center positions).
[0111] Step 600: Perform a weighted summation of the original data corresponding to each search window within the original two-dimensional matrix to obtain a denoised two-dimensional matrix. The denoised two-dimensional matrix includes multiple denoised data, with one denoised data corresponding to one original data.
[0112] In step 600, such as Figure 11 As shown, the noise reduction two-dimensional matrix has the same size as the original two-dimensional matrix and also includes noise reduction data of M rows and N columns, where M and N ≥ 2. Different rows of noise reduction data correspond to different temperature measurement times of the temperature measuring fiber, and different columns of noise reduction data correspond to different temperature measurement positions of the temperature measuring fiber. Each row of noise reduction data is arranged sequentially according to the temperature measurement position of the temperature measuring fiber, and each column of noise reduction data is arranged sequentially according to the temperature measurement time of the temperature measuring fiber.
[0113] In this embodiment, there are two noise reduction two-dimensional matrices, namely a first noise reduction two-dimensional matrix and a second noise reduction two-dimensional matrix. The first noise reduction two-dimensional matrix is obtained by the noise reduction processing of the first original two-dimensional matrix through steps 200-500, and the second noise reduction two-dimensional matrix is obtained by the noise reduction processing of the second original two-dimensional matrix through steps 200-500. One noise reduction data in the first noise reduction two-dimensional matrix corresponds to one Stokes noise reduction data, and one noise reduction data in the second noise reduction two-dimensional matrix corresponds to one inverse Stokes noise reduction data.
[0114] Step 700: Output Stokes denoising data and anti-Stokes denoising data based on the denoising two-dimensional matrix.
[0115] Example 4
[0116] As an optimization of Embodiment 3, in this embodiment, there is only one original two-dimensional matrix, and each original data is formed by connecting the original Stokes data and the reverse Stokes data corresponding to the same temperature measurement time and the same temperature measurement position of the temperature measuring fiber; there is also only one noise reduction two-dimensional matrix, and each noise reduction data can be disconnected to form the Stokes noise reduction data and the reverse Stokes noise reduction data corresponding to the same temperature measurement time and the same temperature measurement position of the temperature measuring fiber.
[0117] Specifically, such as Figure 12 As shown, in step 100, when constructing the original two-dimensional matrix based on the original Stokes data and the inverse original Stokes data, the following steps are included:
[0118] Step 110: Identify the data lengths of the original Stokes data and the reversed original Stokes data;
[0119] Step 120: Connect the Stokes raw data and reverse Stokes raw data corresponding to the same temperature measurement time and the same temperature measurement location to form the corresponding raw data;
[0120] Step 130: Based on the data lengths of the Stokes raw data and the anti-Stokes raw data, set a first identification window and a second identification window on each raw data. The first identification window is set at the Stokes part of each raw data, and the second identification window is set at the anti-Stokes part of each raw data.
[0121] Step 140: Use the original data with the first recognition window and the second recognition window set to establish the original two-dimensional matrix.
[0122] Specifically, such as Figure 13As shown, in step 700, when outputting Stokes denoised data and anti-Stokes denoised data based on the denoising two-dimensional matrix, the following steps are included:
[0123] Step 710: Extract the denoised data with the first recognition window and the second recognition window set from the denoised two-dimensional matrix one by one;
[0124] Step 720: Based on the window lengths of the first and second recognition windows, identify the Stokes portion and the anti-Stokes portion in each denoised data;
[0125] Step 730: Separate the Stokes part and the anti-Stokes part of each noise reduction data to form Stokes noise reduction data and anti-Stokes noise reduction data corresponding to the same temperature measurement time and the same temperature measurement location, respectively.
[0126] Example 5
[0127] As an optimization of Embodiments 3 and 4, in this embodiment, such as Figure 14 As shown, in step 500, when calculating the neighborhood similarity between the neighborhood windows with the same center offset in the original two-dimensional matrix and the neighborhood windows with the same center position in each offset two-dimensional matrix, the following steps are included:
[0128] Step 510: Calculate the integral two-dimensional matrix corresponding to each offset two-dimensional matrix.
[0129] In step 510, the integral two-dimensional matrix corresponding to each offset two-dimensional matrix is calculated using the following formula:
[0130]
[0131] Where I(i,j) is the original data in the i-th row and j-th column of each offset two-dimensional matrix, and Q(x,y) is the integral value in the x-th row and y-th column of the corresponding integral two-dimensional moment.
[0132] Step 520: Calculate the neighborhood similarity of each neighborhood window within the original two-dimensional matrix based on the integral two-dimensional matrix of each offset two-dimensional matrix.
[0133] In step 520, the neighborhood similarity (MSE) of each neighborhood window within the original two-dimensional matrix is calculated using the following formula:
[0134] MSE = (P4 - P2 - P3 + P1) / S
[0135] Wherein, P1, P2, P3 and P4 are the integral values of the four corners of the same neighborhood window in the original two-dimensional matrix in the integral two-dimensional matrix, and S is the area of the neighborhood window.
[0136] Example 6
[0137] As an optimization of Embodiment 5, in this embodiment, such as Figure 15 As shown, in step 510, when calculating the integral two-dimensional matrix corresponding to each offset two-dimensional matrix, the following steps are included:
[0138] Step 511: Subtract each offset two-dimensional matrix from the original two-dimensional matrix to obtain the difference two-dimensional matrix corresponding to each offset two-dimensional matrix.
[0139] In step 511, the original data in the i-th row and j-th column of the original two-dimensional matrix is subtracted from the original data in the i-th row and j-th column of an offset two-dimensional matrix to obtain the difference in the i-th row and j-th column of the two-dimensional matrix corresponding to the offset two-dimensional matrix.
[0140] Step 512: Calculate the square value of each difference two-dimensional matrix to obtain the squared two-dimensional matrix corresponding to each offset two-dimensional matrix.
[0141] In step 512, the square of the difference in the i-th row and j-th column of a certain offset two-dimensional matrix is obtained, which gives the square of the i-th row and j-th column of the square two-dimensional matrix corresponding to the offset two-dimensional matrix.
[0142] Step 513: Calculate the integral value for each squared two-dimensional matrix to obtain the integral two-dimensional matrix corresponding to each offset two-dimensional matrix.
[0143] In step 513, the integral value is calculated for each squared two-dimensional matrix using the following formula:
[0144]
[0145] Where I(i,j) is the square value of the i-th row and j-th column in each squared two-dimensional matrix, and Q(x,y) is the integral value of the x-th row and y-th column in the corresponding integral two-dimensional moment.
[0146] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention and not to limit them. Although the embodiments of the present invention have been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the embodiments of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A noise reduction algorithm module based on nonlocal means algorithm, characterized in that, The system includes an interconnected processor and a memory, the memory storing a computer program for the processor to execute; when the processor executes the computer program, it performs the following steps: Step 100: Construct an original two-dimensional matrix using the input Stokes raw data and the inverse Stokes raw data, wherein the original two-dimensional matrix includes multiple raw data; Step 200: Set the size of the search window and the neighborhood window, and the movement step size of the neighborhood window within the search window, so as to determine multiple neighborhood windows within the search window; Step 300: Based on the center offset between each neighborhood window and the search window, offset the original data in the original two-dimensional matrix to obtain multiple offset two-dimensional matrices, with each offset two-dimensional matrix corresponding to a center offset. Step 400: Use the search window to traverse each original data in the original two-dimensional matrix and each offset two-dimensional matrix, and use the neighborhood window to step in each search window to determine the neighborhood windows with the same center offset between different search areas in the original two-dimensional matrix, and the neighborhood windows with the same center position between the original two-dimensional matrix and each offset two-dimensional matrix. Step 500: Calculate the neighborhood similarity between the neighborhood windows with the same center offset in the original two-dimensional matrix and the neighborhood windows with the same center position in each offset two-dimensional matrix, and assign weight values to the original data corresponding to each neighborhood window in the original two-dimensional matrix according to the neighborhood similarity. Step 600: Perform a weighted summation of the original data corresponding to each search window within the original two-dimensional matrix to obtain a denoised two-dimensional matrix. The denoised two-dimensional matrix includes multiple denoised data, with one denoised data corresponding to one original data. Step 700: Output Stokes denoising data and anti-Stokes denoising data based on the denoising two-dimensional matrix.
2. The noise reduction algorithm module according to claim 1, characterized in that, Both the original two-dimensional matrix and the denoised two-dimensional matrix consist of M rows and N columns, where M and N ≥ 2. Different rows of original data and different rows of denoised data correspond to different temperature measurement times, and different columns of original data and different columns of denoised data correspond to different temperature measurement positions. Each row of original data and each row of denoised data is arranged in order according to the temperature measurement position, and each column of original data and each column of denoised data is arranged in order according to the temperature measurement time.
3. The noise reduction algorithm module according to claim 1 or 2, characterized in that, There are two original two-dimensional matrices, namely a first original two-dimensional matrix and a second original two-dimensional matrix. The first original two-dimensional matrix is established from the Stokes original data, and the second original two-dimensional matrix is established from the inverse Stokes original data. There are also two noise reduction two-dimensional matrices, namely a first noise reduction two-dimensional matrix and a second noise reduction two-dimensional matrix. The first noise reduction two-dimensional matrix is obtained by noise reduction processing of the first original two-dimensional matrix, and the second noise reduction two-dimensional matrix is obtained by noise reduction processing of the second original two-dimensional matrix.
4. The noise reduction algorithm module according to claim 1 or 2, characterized in that, There is only one original two-dimensional matrix. Each original data is formed by connecting Stokes original data and anti-Stokes original data corresponding to the same temperature measurement time and the same temperature measurement location. There is also only one noise reduction two-dimensional matrix. Each noise reduction data can be disconnected to form Stokes noise reduction data and anti-Stokes noise reduction data corresponding to the same temperature measurement time and the same temperature measurement location.
5. The noise reduction algorithm module according to claim 4, characterized in that, In step 100, when constructing the original two-dimensional matrix based on the original Stokes data and the inverse original Stokes data, the following steps are included: Step 110: Identify the data lengths of the original Stokes data and the reversed original Stokes data; Step 120: Connect the Stokes raw data and reverse Stokes raw data corresponding to the same temperature measurement time and the same temperature measurement location to form the corresponding raw data; Step 130: Based on the data lengths of the Stokes raw data and the anti-Stokes raw data, set a first identification window and a second identification window on each raw data. The first identification window is set at the Stokes part of each raw data, and the second identification window is set at the anti-Stokes part of each raw data. Step 140: Use the original data with the first recognition window and the second recognition window set to establish the original two-dimensional matrix.
6. The noise reduction algorithm module according to claim 5, characterized in that, In step 700, when outputting Stokes denoised data and anti-Stokes denoised data based on the denoising two-dimensional matrix, the following steps are included: Step 710: Extract the denoised data with the first recognition window and the second recognition window set from the denoised two-dimensional matrix one by one; Step 720: Based on the window lengths of the first and second recognition windows, identify the Stokes portion and the anti-Stokes portion in each denoised data; Step 730: Separate the Stokes part and the anti-Stokes part of each noise reduction data to form Stokes noise reduction data and anti-Stokes noise reduction data corresponding to the same temperature measurement time and the same temperature measurement location, respectively.
7. The noise reduction algorithm module according to claim 1, characterized in that, In step 300, when the original data within the original two-dimensional matrix is offset according to the center offset between each neighborhood window and the search window to obtain multiple offset two-dimensional matrices, the following steps are included: Step 310: Expand the outer perimeter of the original two-dimensional matrix to obtain an expanded two-dimensional matrix; Step 320: Based on the center offset between each neighborhood window and the search window, set multiple offset windows with the same size as the original two-dimensional matrix within the extended two-dimensional matrix to obtain multiple offset two-dimensional matrices, with one offset two-dimensional matrix corresponding to one offset window.
8. The noise reduction algorithm module according to claim 1, characterized in that, In step 500, when calculating the neighborhood similarity between the neighborhood windows with the same center offset in the original two-dimensional matrix and the neighborhood windows with the same center position in each offset two-dimensional matrix, the following steps are included: Step 510: Calculate the integral two-dimensional matrix corresponding to each offset two-dimensional matrix; Step 520: Calculate the neighborhood similarity of each neighborhood window within the original two-dimensional matrix based on the integral two-dimensional matrix of each offset two-dimensional matrix.
9. The noise reduction algorithm module according to claim 8, characterized in that, In step 510, the integral two-dimensional matrix corresponding to each offset two-dimensional matrix is calculated using the following formula: Where I(i,j) is the original data in the i-th row and j-th column of each offset two-dimensional matrix, and Q(x,y) is the integral value in the x-th row and y-th column of the corresponding integral two-dimensional moment.
10. The noise reduction algorithm module according to claim 8, characterized in that, In step 510, the calculation of the integral two-dimensional matrix corresponding to each offset two-dimensional matrix includes the following steps: Step 511: Subtract each offset two-dimensional matrix from the original two-dimensional matrix to obtain the difference two-dimensional matrix corresponding to each offset two-dimensional matrix; Step 512: Calculate the square value of each difference two-dimensional matrix to obtain the squared two-dimensional matrix corresponding to each offset two-dimensional matrix; Step 513: Calculate the integral value for each squared two-dimensional matrix to obtain the integral two-dimensional matrix corresponding to each offset two-dimensional matrix.
11. The noise reduction algorithm module according to claim 10, characterized in that, In step 513, the integral value is calculated for each squared two-dimensional matrix using the following formula: Where I(i,j) is the square value of the i-th row and j-th column in each squared two-dimensional matrix, and Q(x,y) is the integral value of the x-th row and y-th column in the corresponding integral two-dimensional moment.
12. The noise reduction algorithm module according to claim 8, characterized in that, In step 520, the neighborhood similarity (MSE) of each neighborhood window within the original two-dimensional matrix is calculated using the following formula: MSE = (P4 - P2 - P3 + P1) / S Wherein, P1, P2, P3 and P4 are the integral values of the four corners of the same neighborhood window in the original two-dimensional matrix in the integral two-dimensional matrix, and S is the area of the neighborhood window.
13. A DTS demodulation device, characterized in that, Includes the following steps: The data acquisition module is used to acquire Stokes raw data and reverse Stokes raw data of the temperature measuring fiber at different calibration temperatures; The noise reduction algorithm module of claim 1 is used to perform noise reduction processing on the original Stokes data and the original anti-Stokes data to obtain Stokes noise reduction data and anti-Stokes noise reduction data at different calibration temperatures; The demodulation calculation module is used to calculate the light intensity ratio of the Stokes noise-reduced data and the anti-Stokes noise-reduced data at different calibration temperatures, thereby determining the relationship curve between the light intensity ratio and the temperature value.
Citation Information
Patent Citations
High temperature sensing device and calibration method of high temperature sensing device
CN116105891B
High-resolution seawater distributed temperature monitoring method
CN120101971A
Method, system, device and medium for measuring temperature and reducing noise of distributed optical fiber
JP2025082817A
Data sparse projection algorithm and system, electronic device and storage medium
WO2022006734A1
Method for brillouin optical time domain analysis (BOTDA) based dynamic distributed strain sensing
WO2023182938A2