A water leakage location method based on mutual spectrum information
By adopting a method based on mutual spectrum information in water leakage positioning, selecting the optimal frequency band and eliminating noise interference, the problem of low leakage positioning accuracy in the prior art is solved, and a higher precision leakage positioning is achieved.
Patent Information
- Application Number
- CN202210992867.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-18
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2042-08-18
AI Technical Summary
The existing leak positioning methods have deviations in the positioning of the leak point due to noise interference, making it difficult to accurately locate.
The leak positioning method based on mutual spectrum information is adopted. By collecting acoustic signals at two different locations, performing time-frequency transformation, calculating the coherent function value and mutual power spectrum, combining the expert system to select the leaking sound band, eliminate noise interference, and performing positioning and solution.
By extracting the mutual power spectrum and coherence function characteristics of the multi-band frequency band, combining the phase change linearity of the mutual phase spectrum, the expert voting model is used to select the optimal frequency band, improve the accuracy of leakage positioning and eliminate noise interference.
Smart Images

Figure CN115681831B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of water leakage location, and in particular relates to a water leakage location method based on mutual spectrum information. Background Art
[0002] The existing methods for detecting water leakage all determine the location of the water leakage by locating the sound source of the water leakage sound. Since the propagation speed of the sound of the pipeline leakage is independent of the distance from the leakage point, there is a time difference between the sound wave propagating from the leakage point to the two probes. Therefore, the time delay difference of multiple sound collection points can be used for positioning and calculation. Combined with the pipe length between the two probes and the sound wave propagation speed, the sound source position of the water leakage sound can be indirectly obtained. At present, two vibration sensor probes are generally used to be adsorbed on the exposed points of the pipeline such as fire hydrants and valves through a magnetic seat, and then the water leakage sound is collected to calculate the delay.
[0003] However, there is continuous and occasional noise in the pipeline, and the noise sound waves will interfere with the positioning solution of the water leakage sound, causing deviations in the positioning of the leakage point. Therefore, a water leakage positioning method that can reduce the impact of noise is needed. Summary of the invention
[0004] Based on the above-mentioned shortcomings and deficiencies in the prior art, one of the objects of the present invention is to at least solve one or more of the above-mentioned problems in the prior art. In other words, one of the objects of the present invention is to provide a water leakage location method based on mutual spectrum information that meets one or more of the above-mentioned needs.
[0005] In order to achieve the above-mentioned object of the invention, the present invention adopts the following technical solutions:
[0006] A water leakage location method based on mutual spectrum information comprises the following steps:
[0007] S1, collecting acoustic signals at two different positions to obtain a first received signal and a second received signal respectively;
[0008] S2. Performing time-frequency transformation on the first received signal and the second received signal to obtain frequency band data of the first received signal and the second received signal;
[0009] S3, calculating a coherence function value according to the frequency band data of the first received signal and the second received signal, selecting a plurality of maximum values of the coherence function value, and dividing the frequency band data of the first received signal and the second received signal into a plurality of frequency bands according to the plurality of maximum values;
[0010] S4, calculating the cross-power spectrum and the cross-bit spectrum of the first received signal and the second received signal in each frequency band;
[0011] S5, using an expert system to vote and select the water leakage sound frequency band in the first receiving signal and the second receiving signal according to the cross-power spectrum, the cross-potential spectrum and the coherence function value;
[0012] S6. Calculate the sound source position of the water leakage sound according to the frequency bands of the water leakage sound in the first received signal and the second received signal.
[0013] As a preferred solution, step S6 specifically includes the following steps:
[0014] S61, setting a cutoff frequency according to a frequency band of water leakage sound, filtering the first received signal and the second received signal, to obtain a first water leakage sound signal and a second water leakage sound signal;
[0015] S62, performing fast Fourier transformation on the first water leakage sound signal and the second water leakage sound signal and multiplying them to obtain a cross-correlation function of the water leakage sound signal;
[0016] S63. Calculate the time delay of the first water leakage sound signal and the second water leakage sound signal according to the cross-correlation function.
[0017] As a further preferred solution, after step S62 and before step S63, step S621 is further included:
[0018] The cross-correlation function is weighted with a phase-shift weighting function to make it smoother.
[0019] As a further preferred solution, step S6 specifically includes the following steps:
[0020] S61, setting a cutoff frequency according to a frequency band of water leakage sound, filtering the first received signal and the second received signal, to obtain a first water leakage sound signal and a second water leakage sound signal;
[0021] S611, segmenting the first water leakage sound signal and the second water leakage sound signal using a sliding window to obtain a plurality of first water leakage sound signal segments and second water leakage sound signal segments;
[0022] S62, selecting a first water leakage sound signal segment and a second water leakage sound signal segment corresponding to a segment, performing fast Fourier transformation on the first water leakage sound signal segment and the second water leakage sound signal segment and multiplying them to obtain a cross-correlation function of the water leakage sound signal segment;
[0023] S63, calculating the time delay of the first water leakage sound signal segment and the second water leakage sound signal segment according to the cross-correlation function;
[0024] S64, return to step S62, select another segment, and after all segments are selected, obtain a number of delays, and enter step S65;
[0025] S65. Classify several time delays to obtain an optimal value of the time delay.
[0026] As a further preferred solution, step S65 specifically includes:
[0027] S651, clustering a number of time delays using the DBSCAN clustering algorithm;
[0028] S652: Select the largest set class, and calculate the arithmetic mean of all delays in the largest set class as the optimal value of the delay.
[0029] As a preferred solution, step S4 specifically includes the following steps:
[0030] S41, using the Welch average periodogram method to calculate the mutual bit spectrum of the first received signal and the second received signal, and calculating the phase change linearity of the mutual bit spectrum in each frequency band;
[0031] S42, extracting the upper and lower limits, amplitude, and width of the coherence function in each frequency band;
[0032] S43: Calculate the cross-power spectrum of the first received signal and the second received signal, and extract the spectrum peak of the cross-power spectrum at the center of each frequency band.
[0033] As a further preferred solution, the expert system selects the water leakage sound frequency band by voting according to the phase change linearity of each frequency band, the upper and lower limits of the coherence function, the amplitude, the width and the spectrum peak at the center.
[0034] Compared with the prior art, the present invention has the following beneficial effects:
[0035] The method of the present invention extracts the cross-power spectrum corresponding to multiple frequency bands, the amplitude and width of the coherence function as feature quantities, combines the phase change linearity characteristics of the frequency bands corresponding to the cross-power spectrum, and uses an expert voting model to score each frequency band, and selects the optimal frequency band of the water leakage sound according to the score, thereby eliminating noise interference and using the frequency band that is most conducive to water leakage positioning for positioning and solving;
[0036] Multiple positioning results are classified and aggregated to eliminate the influence of outliers on the final position calculation and further improve the accuracy of water leak positioning. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 is a flow chart of a water leakage location method based on mutual spectrum information according to an embodiment of the present invention;
[0038] Figure 2 is a mutual bit spectrum diagram of an embodiment of the present invention;
[0039] Figure 3 is a schematic diagram of the lateral distribution of the mutual bit spectrum diagram of an embodiment of the present invention;
[0040] Figure 4 4 is a flow chart of calculating the generalized cross-correlation function according to an embodiment of the present invention. DETAILED DESCRIPTION
[0041] In order to more clearly illustrate the embodiments of the present invention, the specific implementation methods of the present invention will be described below with reference to the accompanying drawings. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those of ordinary skill in the art, other accompanying drawings and other implementation methods can be obtained based on these accompanying drawings without creative work.
[0042] Embodiment: This embodiment provides a water leakage location method based on mutual spectrum information, and its flow chart is shown in FIG1 . The method specifically includes the following steps:
[0043] First, in step S1, a vibration sensor probe is used as a collection device, and two probes are respectively attached to the pipeline exposure points at different positions in the same pipeline, so as to collect the acoustic signals in the pipeline at two different positions. The acoustic signals collected by the first vibration sensor probe and the second vibration sensor probe are respectively named as the first received signal and the second received signal.
[0044] Since the acoustic signals collected by the two probes contain noise, the key to ensuring the accuracy of leak location is to correctly select the frequency band corresponding to the water leakage sound and eliminate the interference of irrelevant frequency bands. Therefore, after collecting the signal, step S2 is entered to perform time-frequency transformation on the first received signal and the second received signal to obtain the frequency band data of the first received signal and the second received signal with frequency as the horizontal coordinate.
[0045] Then, in step S3, the initial water leakage sound frequency band is selected according to the coherence between the two signals, and the coherence function value is calculated according to the frequency band data of the first received signal and the second received signal.
[0046] Specifically, the coherence function value is calculated using the following method:
[0047] Assume that the first received signal and the second received signal are x(n) and y(n) respectively. Use the Welch average periodogram method to perform spectrum estimation. Divide x(n) and y(n) into K segments, and the overlap rate between each segment is 50%. Then add a hamming window to each segment, and perform fast Fourier transform on each segment to obtain the cross spectrum (X i (f)Y i * (f)), and finally calculate the cross-power spectrum estimate of the two signals:
[0048]
[0049] Where * represents complex conjugate, G xx (f) is the auto-power spectrum of the source signal. Since both received signals contain water leakage sound signals, the reflection on the cross-power spectrum is a spectrum peak with a certain width formed in the common frequency band.
[0050] As shown in the above formula, there is a time delay difference τ between x(n) and y(n) o , and the mutual potential spectrum has the following relationship:
[0051] θ xy (f)=2πfτ o ;
[0052] Calculate θ xy (f) can be obtained from the double-sided spectrum G xy (f) Transformed into a single-sided spectrum S xy (f), namely
[0053] S xy (f) = I xy (f)+jQ xy (f).
[0054] Using a similar process, we can also calculate the single-sided spectrum S of the two-way signal xx (f) and S yy (f), after obtaining the single-sided spectra of the two signals, the coherence function is calculated by the following formula:
[0055]
[0056] The correlation function characterizes the correlation between the two signals in the frequency domain. If both signals contain water leakage, the larger the value of the coherence function in the corresponding frequency band, the frequency band where the water leakage signal is located can be estimated based on its amplitude.
[0057] The vertical axis of the coherence function is a value between 0 and 1, and the horizontal axis is the frequency. Theoretically, if x(n) and y(n) are pure water leakage sound signals, then γ 2 xy (f) = 1, that is, strong correlation; if x(n) and y(n) are completely uncorrelated, that is, neither contains a water leakage signal or the water leakage signal is so weak that the device cannot perceive it, then γ 2 xy (f) = 0; if x(n) and y(n) contain both water leakage and environmental noise, then 0 < γ 2 xy (f)<1, and the correlation function presents a spectral peak with a certain width.
[0058] Since the larger the coherence function, the higher the correlation, the first N maximum values with the largest amplitudes are selected in the coherence function, and the frequency bands are separated by the frequencies of these maximum values as separation points, thereby obtaining multiple frequency bands with the largest coherence functions.
[0059] After the frequency band separation is completed, step S4 is performed to calculate the scoring factors of each frequency band for judging the water leakage sound signal. The scoring factors include the value or eigenvalue of the cross-power spectrum, the cross-potential spectrum and the coherence function in each frequency band. Here, step S4 calculates the cross-potential spectrum, the coherence function eigenvalue and the cross-power spectrum in three parts. First, step S41 is performed to calculate the phase change linearity of the cross-potential spectrum in each frequency band separated by S3. The linearity is calculated by the following method:
[0060] First calculate the mutual spectrum of the signal, based on the above formula, with I xy (f) and jQ xy (f) are the real and imaginary parts of the cross spectrum, respectively, then the cross spectrum:
[0061]
[0062] Because under a certain signal-to-noise ratio, θ xy (f) Figure 2 As shown, it changes approximately linearly with frequency, and the slope is 2πτ o , so the cross-spectral phase spectrum θ xy (f) It can characterize the correlation between the phase relationship between the two signals as the frequency changes, and the change trend will not change with time. However, the phase spectrum of the corresponding frequency band of other noise in the signal will have obvious differences as time changes. Therefore, by comparing whether the phase of the mutual phase spectrum of different frequency bands changes linearly and the trend is consistent, it can be judged whether the frequency band is the water leakage sound band. If the phase is Figure 2 The target frequency band selected in the middle box shows a linear change, which means that the probability of the water leakage sound band is relatively high, while there is no fixed phase relationship between other noises, and there is no stable trend of phase change in the frequency bands of these noises.
[0063] Based on the above reasons, the linearity of the mutual potential spectrum can be used as a condition for the water leakage sound scoring. After obtaining the mutual potential spectrum, the gradient of the mutual potential spectrum is calculated, that is, the original mutual potential spectrum is calculated as follows: Figure 2 The oblique distribution shown is transformed into Figure 3 The lateral distribution shown in the figure uses the fluctuation degree in each frequency band, i.e., the standard deviation, to characterize the linearity of the phase curve in that frequency band. After the calculation is completed, the linearity of each frequency band is saved as one of the scoring conditions for the subsequent water leakage sound frequency band.
[0064] Step S4 also includes step S42, extracting the upper and lower limits, amplitude and width of the coherence function in each frequency band based on the separation of each frequency band according to the maximum value of the coherence function in step S3, and also leaving them as scoring conditions for each frequency band.
[0065] In addition, the method further includes step S43, using the cross power spectrum G calculated in step S3 xy (f), the cross power spectrum Gxy (f) Similarly, the frequency bands are divided into several segments according to the above-mentioned separation, and then the spectrum peak value corresponding to the center frequency of each frequency band is extracted and saved as the scoring condition of each frequency band.
[0066] After the calculation of the scoring conditions is completed, step S5 is performed, using the expert system to generate a total score table for each frequency band based on the cross-spectral linearity, coherence function amplitude, width, and central spectrum peak of the cross-power spectrum calculated in the above step S4 as the scoring characteristic value, and select the frequency band with the highest score, that is, the frequency band that best meets the characteristics of water leakage sound as the water leakage sound frequency band. The evaluation algorithm model of the expert system is based on existing data and cases.
[0067] After the frequency band of the water leakage sound is selected, step S6 may be performed to calculate the sound source position of the water leakage sound according to the frequency band of the water leakage sound in the first received signal and the second received signal.
[0068] Specifically, step S6 is implemented in the following process:
[0069] S61. Use the water leakage sound frequency band to perform band-pass filtering on the first received signal and the second received signal, and only retain the signal belonging to the water leakage sound frequency band to obtain the first water leakage sound signal and the second water leakage sound signal.
[0070] S62, calculate the cross-correlation function of the first water leakage sound signal and the second water leakage sound signal. Since the method of calculating the cross-correlation function by time domain convolution is computationally intensive, according to the theorem that time domain convolution is frequency domain product, the water leakage sound signal is converted to the frequency domain for operation. That is, x(n) and y(nm) are fast Fourier transformed respectively to obtain X(ω) and Y(ω). Therefore, the frequency domain R of the cross-correlation function of the first water leakage sound signal and the second water leakage sound signal is xy (m) equals X(ω)Y * (ω).
[0071] Furthermore, due to the presence of reverberation and noise, R xy The peak of (m) is not obvious, which reduces the accuracy of delay estimation. In order to sharpen R xy The peak value of (m) makes the cross-correlation function smoother, thereby eliminating noise and reverberation interference. After step S62, step S621 is also included, in which the cross-power spectrum is weighted in the frequency domain using a phase transform weighting function - PHAT weighting function, so that the cross-power spectrum between signals is smoother by using a whitening filter, thereby sharpening the generalized cross-correlation function.
[0072] The above operation is as follows Figure 4 The process shown in the figure is carried out, and the specific formula finally obtained is as follows:
[0073]
[0074] in is the phase transformation weighting function,
[0075] Then use the generalized cross-correlation function R xy (m) Calculate the time delay between the first water leakage sound signal and the second water leakage sound signal. In the original signals x(n) and y(nm), m is the time delay, y(nm) represents the time shift of the second water leakage sound signal, and then when the generalized cross-correlation function reaches the maximum value, it means that the shifted second water leakage sound signal is aligned with the first water leakage sound signal to achieve the maximum similarity. Therefore, the value of m when the generalized cross-correlation function obtains the maximum value is the time delay between the first water leakage sound signal and the second water leakage sound signal.
[0076] After the time delay is obtained, step S64 is performed to calculate the distance between the leak point and the two probes in combination with the pipe length D between the probes, the sound wave propagation speed v and the time delay τ.
[0077] Specifically, the calculation formulas for the distance between the leak point and the two probes are:
[0078] L1 = (Dv.τ) / 2 L2 = D - L1.
[0079] Although the above steps have been frequency band filtered, the delay calculated by the above steps S61-S64 will still be affected by noise. As an improved solution, in order to further improve the accuracy of position calculation, this embodiment also provides another specific implementation of step S6, and step S6 is implemented as follows:
[0080] After the same step S61 as above, an additional step S611 is performed to segment the first water leakage sound signal and the second water leakage sound signal in the form of a sliding window of a specified width, with an overlap rate of 50% between the segments, so as to calculate the delay on each segment respectively, and finally integrate the delay results of each segment and eliminate the abnormal values therein.
[0081] After step S611, one of the segments is selected, and the above steps S62-S63 are executed to calculate the delay of the segment. After step S63 is executed, a segment that has not been calculated is selected in step S64, and the process returns to step S62 to obtain the delay of a segment again, until the delays of all segments are calculated.
[0082] Then, step S65 is executed to count all time delays, classify them, remove abnormal values, and obtain the optimal value of the time delay to optimize the calculation of the sound source position.
[0083] Specifically, step S65 may use the DBSCAN clustering algorithm to select a suitable time delay cluster, which may be implemented in the following way:
[0084] S651. First, set the neighborhood distance threshold Eps and the sample number threshold min_samples required for a sample point to become a core object. Randomly select a delayed point and find all stores whose distance to this point is less than or equal to Eps. If the number of delayed points within Eps from the starting point is less than min_samples, then this point is marked as noise. If the number of delayed points within Eps is greater than min_samples, then this point is marked as a core sample and is assigned a new cluster label.
[0085] Visit all the delay points within the distance Eps of the core samples. If they have not been assigned a cluster, assign the newly created cluster label to them. If they are core samples, visit their neighbors in turn, and so on; the cluster gradually increases until there are no more core samples within the eps distance of the cluster.
[0086] Then select another delay point that has not been visited and repeat the same process until all points are in a cluster.
[0087] Through the above DBSCAN algorithm, areas with sufficient density are divided into clusters, and clusters of arbitrary shapes are found in noisy spatial data sets. A cluster is defined as the largest set of density-connected points, and the separated high-density area is treated as an independent class, and the low-density area data is treated as an outlier.
[0088] After all delay results are clustered in step S651, step S652 is executed to select the largest cluster and use the cluster as the optimal delay cluster, while the delays in other clusters are outliers.
[0089] The arithmetic mean of all delays in the largest cluster is taken to obtain the optimal delay value.
[0090] Then, the optimal value of the time delay is used to perform step S66, and the distance between the water leakage point and the two probes is calculated using the optimal value of the time delay, so as to determine the sound source position of the water leakage sound.
[0091] The method of this embodiment starts from the correlation characteristics of the two leakage signals, selects the initial leakage sound frequency band based on the amplitude and width value of the coherence function, combines the peak value of the mutual power spectrum and the linearity of the phase change of the mutual spectrum, adopts the expert voting algorithm to select the target filtering frequency band, and then improves the signal-to-noise ratio in the form of bandpass filtering. In the process of delay estimation, the delay is calculated by data segmentation, and the DBSCAN clustering algorithm is used to eliminate abnormal delay values caused by environmental influences, thereby further improving the accuracy of leak point positioning. In this way, high-precision leakage-related positioning is achieved on the basis of adaptively selecting the filtering frequency band.
[0092] It should be noted that the above embodiments are only detailed descriptions of the preferred embodiments and principles of the present invention. For ordinary technicians in this field, there will be changes in the specific implementation methods based on the ideas provided by the present invention, and these changes should also be regarded as the scope of protection of the present invention.
Claims
1. A water leakage location method based on mutual spectrum information, It is characterized in that The steps include: S1, collecting acoustic signals at two different positions to obtain a first received signal and a second received signal respectively; S2. Performing time-frequency transformation on the first received signal and the second received signal to obtain frequency band data of the first received signal and the second received signal; S3, calculating a coherence function value according to the frequency band data of the first received signal and the second received signal, selecting a plurality of maximum values of the coherence function value, and dividing the frequency band data of the first received signal and the second received signal into a plurality of frequency bands according to the plurality of maximum values; S4, calculating the cross-power spectrum, cross-bit spectrum, and coherence function eigenvalue of the first received signal and the second received signal in each frequency band; S5, using an expert system to vote and select the water leakage sound frequency band in the first receiving signal and the second receiving signal according to the cross-power spectrum, the cross-potential spectrum, and the coherence function eigenvalue; S6. Calculating the sound source position of the water leakage sound according to the frequency bands of the water leakage sound in the first received signal and the second received signal; The step S6 specifically includes the following steps: S61, setting a cutoff frequency according to the water leakage sound frequency band, filtering the first received signal and the second received signal, to obtain a first water leakage sound signal and a second water leakage sound signal; S611, segmenting the first water leakage sound signal and the second water leakage sound signal using a sliding window to obtain a plurality of first water leakage sound signal segments and second water leakage sound signal segments; S62, selecting the first water leakage sound signal segment and the second water leakage sound signal segment corresponding to a segment, performing fast Fourier transform on the first water leakage sound signal segment and the second water leakage sound signal segment and multiplying them to obtain a cross-correlation function of the water leakage sound signal segment; S63, calculating the time delay between the first water leakage sound signal segment and the second water leakage sound signal segment according to the cross-correlation function; S64, return to step S62, select another segment, and after all segments are selected, obtain a number of delays, and enter step S65; S65, classifying the plurality of time delays to obtain an optimal value of the time delay; S66, calculating the sound source position of the water leakage sound according to the time delay; The step S65 specifically includes: S651, clustering the plurality of time delays using a DBSCAN clustering algorithm; By using the DBSCAN clustering algorithm, the regions with sufficient density are divided into clusters, and clusters of arbitrary shapes are found in the noisy spatial data set. The cluster is defined as the maximum set of density-connected points, the separated high-density regions are regarded as an independent class, and the low-density area data are regarded as outliers; S652: Select a maximum set class, and calculate the arithmetic mean of all delays in the maximum set class as the optimal value of the delay.
2. A water leakage location method based on mutual spectrum information as claimed in claim 1, It is characterized in that After step S62 and before step S63, step S621 is also included: The cross-correlation function is weighted with a phase transformation weighting function to make it smoother.
3. A water leakage location method based on mutual spectrum information as claimed in claim 1, It is characterized in that The step S4 specifically includes the following steps: S41, using the Welch average periodogram method to calculate the mutual bit spectrum of the first received signal and the second received signal, and calculating the phase change linearity of the mutual bit spectrum in each frequency band; S42, extracting the upper and lower limits, amplitude, and width of the coherence function in each frequency band; S43: Calculate the cross-power spectrum of the first received signal and the second received signal, and extract the spectrum peak of the cross-power spectrum at the center of each frequency band.
4. A water leakage location method based on mutual spectrum information as claimed in claim 3, It is characterized in that The expert system selects the water leakage sound frequency band by voting according to the phase change linearity, upper and lower limits of the coherence function, amplitude, width and the spectrum peak at the center of each frequency band.