CN116990541A - Method, device and medium for measuring same-frequency signal phase difference of ultrasonic water meter - Google Patents

Method, device and medium for measuring same-frequency signal phase difference of ultrasonic water meter Download PDF

Info

Publication number
CN116990541A
CN116990541A CN202310973173.0A CN202310973173A CN116990541A CN 116990541 A CN116990541 A CN 116990541A CN 202310973173 A CN202310973173 A CN 202310973173A CN 116990541 A CN116990541 A CN 116990541A
Authority
CN
China
Prior art keywords
pulse signal
uplink
downlink
phase difference
signal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310973173.0A
Other languages
Chinese (zh)
Inventor
王建华
郭桂雨
刘国梁
王明兴
刘振
牟伟擎
史海彬
王邵琪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Dingxin Communication Power Engineering Co ltd
Qingdao Topscomm Communication Co Ltd
Original Assignee
Qingdao Dingxin Communication Power Engineering Co ltd
Qingdao Topscomm Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qingdao Dingxin Communication Power Engineering Co ltd, Qingdao Topscomm Communication Co Ltd filed Critical Qingdao Dingxin Communication Power Engineering Co ltd
Priority to CN202310973173.0A priority Critical patent/CN116990541A/en
Publication of CN116990541A publication Critical patent/CN116990541A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01PMEASURING LINEAR OR ANGULAR SPEED, ACCELERATION, DECELERATION, OR SHOCK; INDICATING PRESENCE, ABSENCE, OR DIRECTION, OF MOVEMENT
    • G01P5/00Measuring speed of fluids, e.g. of air stream; Measuring speed of bodies relative to fluids, e.g. of ship, of aircraft
    • G01P5/24Measuring speed of fluids, e.g. of air stream; Measuring speed of bodies relative to fluids, e.g. of ship, of aircraft by measuring the direct influence of the streaming fluid on the properties of a detecting acoustical wave
    • G01P5/245Measuring speed of fluids, e.g. of air stream; Measuring speed of bodies relative to fluids, e.g. of ship, of aircraft by measuring the direct influence of the streaming fluid on the properties of a detecting acoustical wave by measuring transit time of acoustical waves
    • G01P5/248Measuring speed of fluids, e.g. of air stream; Measuring speed of bodies relative to fluids, e.g. of ship, of aircraft by measuring the direct influence of the streaming fluid on the properties of a detecting acoustical wave by measuring transit time of acoustical waves by measuring phase differences
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01PMEASURING LINEAR OR ANGULAR SPEED, ACCELERATION, DECELERATION, OR SHOCK; INDICATING PRESENCE, ABSENCE, OR DIRECTION, OF MOVEMENT
    • G01P1/00Details of instruments

Abstract

The application discloses a method, a device and a medium for measuring the phase difference of same-frequency signals of an ultrasonic water meter, relates to the field of ultrasonic measurement, and aims at solving the problem that the traditional phase difference measurement scheme can not well meet the requirement of the ultrasonic measurement field on precision. The correlation method can inhibit noise, has the bandpass effect, has particularly obvious effect of inhibiting low-frequency noise, and is well suitable for phase difference measurement in the application field of ultrasonic water meters. In addition, the correlation method is insensitive to the change of the signal amplitude, so that the influence of errors of the signal amplitude on a measurement result is radically avoided, and the accuracy is further improved.

Description

Method, device and medium for measuring same-frequency signal phase difference of ultrasonic water meter
Technical Field
The application relates to the field of ultrasonic metering, in particular to a method, a device and a medium for measuring the phase difference of same-frequency signals of an ultrasonic water meter.
Background
In the current industrial measurement and control field, the phase difference is a parameter which is frequently required to be measured, and the phase difference has wide application in signal analysis, circuit parameter debugging, industrial automation control and power electronic technology, and particularly for detecting the flow velocity of fluid, the flow velocity of the fluid can be conveniently determined by detecting the ultrasonic phase difference of the forward flow and the backward flow of the fluid. The traditional phase measurement method comprises a zero crossing detection method, a harmonic analysis method and the like, but is mainly applied to calculating interphase voltage in a power system, is less applied to the field of ultrasonic measurement, and cannot well meet the requirement of ultrasonic measurement of fluid flow velocity.
More specifically, the zero-crossing detection method comprises a zero-crossing time method, a zero-crossing voltage comparison method and other branches. The zero-crossing time method is a method for detecting the time difference of zero crossing points of two periodic signals, and a high-precision timing device is needed to precisely determine the zero-crossing point time, so that a large error exists in the conventional method. The zero-crossing voltage comparison method is to measure the voltage difference of two sine waves near the zero crossing point and calculate the phase difference through the sine relation, and under the condition of harmonic waves, the phase angle and the voltage amplitude measured by the zero-crossing voltage method are the phase angle and the voltage amplitude of the vector superposition waveform of each subharmonic wave and do not accord with the sine characteristic. The method has the problems of low precision and easy interference.
Similarly, for measuring the phase by the harmonic analysis method, the input signal is sampled by modulus (analog to digital, a/D), and then the sampled discrete sequence is subjected to fast fourier transform (fast Fourier transform, FFT) operation, so that the values of all harmonic component points can be obtained, each point in the FFT calculation can be represented by a complex number, the phase of the point can be obtained by a complex value, and the phase difference can be obtained by making a difference after determining the phases of two harmonic component points.
Therefore, a method for measuring the same-frequency signal phase difference of an ultrasonic water meter is needed by those skilled in the art at present, and the problem that the conventional phase difference measurement scheme at present cannot well meet the requirement of the ultrasonic metering field on precision is solved.
Disclosure of Invention
The application aims to provide a common-frequency signal phase difference measuring method, device and medium of an ultrasonic water meter, so as to solve the problem that the traditional phase difference measuring scheme at present cannot well meet the requirement of the ultrasonic metering field on precision.
In order to solve the technical problems, the application provides a common-frequency signal phase difference measuring method of an ultrasonic water meter, which comprises the following steps:
the method comprises the steps of obtaining an uplink pulse signal and a downlink pulse signal by receiving ultrasonic pulses emitted by ultrasonic transducers respectively arranged at the upstream and the downstream of a fluid pipeline and inclined to the fluid; the frequency and the amplitude of the uplink pulse signal are the same as those of the downlink pulse signal;
sampling the uplink pulse signal and the downlink pulse signal based on a preset sampling rate to obtain sampling points; the preset sampling rate is an integral multiple of the frequencies of the uplink pulse signal and the downlink pulse signal, and the multiple is more than 2;
respectively carrying out periodic accumulation on sampling points of an uplink pulse signal and a downlink pulse signal to obtain accumulated sampling points, and obtaining an uplink signal sequence and a downlink signal sequence which are formed by corresponding accumulated sampling points;
performing circular cross-correlation on the uplink signal sequence and the downlink signal sequence to obtain a correlation value;
and determining a phase difference result according to the correlation value.
On the other hand, determining the phase difference result from the correlation value includes:
fitting each correlation value to determine a sliding correlation function;
and solving the phase angle of the sliding correlation function, and obtaining a phase difference result according to the phase angle.
Correspondingly, after obtaining the correlation value, the method further comprises:
sorting from small to large according to the shift times of the correlation value corresponding to the cyclic cross correlation;
performing cyclic shift on each correlation value until the maximum correlation value moves to the middle position;
correspondingly, obtaining the phase difference result according to the phase angle includes:
superposing a cyclic shift compensation quantity on the basis of the phase angle to obtain a phase difference result;
wherein, cyclic shift compensation amount is:
m*2π/K;
m represents the number of times of cyclic shift; k is the multiple of the preset sampling rate relative to the frequency of the uplink pulse signal and the downlink pulse signal.
On the other hand, the method respectively carries out periodic accumulation on the sampling points of the uplink pulse signal and the downlink pulse signal to obtain accumulated sampling points, and obtains an uplink signal sequence and a downlink signal sequence which are formed by the corresponding accumulated sampling points, and comprises the following steps:
respectively carrying out accumulation summation on sampling points with the same sampling position in a preset period in an uplink pulse signal and a downlink pulse signal to obtain accumulation sampling points;
an uplink signal sequence is obtained according to each accumulated sampling point determined by the uplink pulse signal, and a downlink signal sequence is obtained according to each accumulated sampling point determined by the downlink pulse signal.
On the other hand, performing cyclic cross-correlation on the uplink signal sequence and the downlink signal sequence to obtain a correlation value includes:
fixing the downlink signal sequence/the uplink signal sequence, and performing cyclic shift in a fixed direction on the uplink signal sequence/the downlink signal sequence;
and performing correlation operation on the uplink signal sequence and the downlink signal sequence every time the uplink signal sequence/the downlink signal sequence is shifted by one unit, so as to obtain corresponding correlation values until the cyclic shift is not generating a new uplink signal sequence/a new downlink signal sequence.
On the other hand, fitting the correlation values to determine the sliding correlation function includes:
performing fixed frequency fitting on each correlation value by a triangular interpolation method to obtain a sliding correlation function;
wherein, the fixed frequency in the fixed frequency fitting is:
k is the multiple of the preset sampling rate relative to the frequency of the uplink pulse signal and the downlink pulse signal.
On the other hand, the ultrasonic transducers for transmitting ultrasonic pulses to obtain an uplink pulse signal and a downlink pulse signal share the same clock source.
In order to solve the technical problem, the application also provides a common-frequency signal phase difference measuring device of the ultrasonic water meter, which comprises:
the ultrasonic measuring module is used for obtaining an uplink pulse signal and a downlink pulse signal by receiving ultrasonic pulses emitted by ultrasonic transducers which are respectively arranged at the upstream and the downstream of the fluid pipeline and incline to the fluid; the frequency and the amplitude of the uplink pulse signal are the same as those of the downlink pulse signal;
the signal sampling module is used for sampling the uplink pulse signal and the downlink pulse signal based on a preset sampling rate to obtain sampling points; the preset sampling rate is an integral multiple of the frequencies of the uplink pulse signal and the downlink pulse signal, and the multiple is more than 2;
the period accumulating module is used for respectively carrying out period accumulation on sampling points of the uplink pulse signals and the downlink pulse signals so as to obtain accumulated sampling points and obtain an uplink signal sequence and a downlink signal sequence which are formed by the corresponding accumulated sampling points;
the cyclic correlation module is used for carrying out cyclic cross correlation on the uplink signal sequence and the downlink signal sequence to obtain a correlation value;
and the parameter estimation module is used for determining a phase difference result according to the correlation value.
In order to solve the technical problem, the application also provides a common-frequency signal phase difference measuring device of the ultrasonic water meter, which comprises:
a memory for storing a computer program;
and the processor is used for realizing the same-frequency signal phase difference measuring method of the ultrasonic water meter when executing the computer program.
In order to solve the technical problem, the application also provides a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and the computer program realizes the steps of the same-frequency signal phase difference measuring method of the ultrasonic water meter when being executed by a processor.
The application provides a common-frequency signal phase difference measuring method of an ultrasonic water meter, which is a method for determining the relation between two things through measurement by carrying out phase difference operation based on a correlation method on ultrasonic pulse signals acquired in forward flow and backward flow. The correlation method is equivalent to a digital filter, so that the method can inhibit noise, has the bandpass effect, has a particularly remarkable effect of inhibiting low-frequency noise, and is well suitable for the application field of ultrasonic water meters. In addition, the correlation method is insensitive to the amplitude of the signals, so that the influence of the intensity variation of the uplink and downlink pulse signals on the result caused by various reasons such as signal fluctuation, transducer performance, temperature variation and the like is radically avoided, the interference of the errors on the phase difference result is smaller, and the accuracy of the obtained phase difference result is higher. In addition, the application also samples the ultrasonic pulse signals to convert the continuous ultrasonic pulse signals into discrete forms, thereby remarkably reducing the operation complexity of the phase difference, and improving the signal-to-noise ratio of the uplink and downlink signal sequences for calculating the phase difference by a periodic and cyclic superposition mode, thereby further improving the accuracy of measuring the phase difference.
The same-frequency signal phase difference measuring device and the computer readable storage medium of the ultrasonic water meter correspond to the method and have the same effects.
Drawings
For a clearer description of embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described, it being apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to the drawings without inventive effort for those skilled in the art.
FIG. 1 is a flow chart of a method for measuring the phase difference of the same-frequency signals of an ultrasonic water meter;
fig. 2 is a schematic diagram of an application scenario of phase difference measurement provided by the present application;
FIG. 3 is a schematic diagram of sampling an ultrasonic pulse signal according to the present application;
fig. 4 is a block diagram of the same-frequency signal phase difference measuring device of the ultrasonic water meter.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. Based on the embodiments of the present application, all other embodiments obtained by a person of ordinary skill in the art without making any inventive effort are within the scope of the present application.
The application provides a method, a device and a medium for measuring the phase difference of the same-frequency signals of an ultrasonic water meter.
In order to better understand the aspects of the present application, the present application will be described in further detail with reference to the accompanying drawings and detailed description.
Ultrasonic velocimetry is a method of flow rate measurement suitable for fluids. The basic principle of ultrasonic flow measurement is that ultrasonic transducers respectively arranged at the upstream and downstream of a pipeline and inclined to fluid emit acoustic pulses, and the difference between propagation times of the acoustic pulses emitted from the upstream direction to the downstream direction and the acoustic pulses emitted from the downstream direction to the upstream direction (namely, the difference between forward and backward propagation times) is known, so that the channel average flow velocity can be obtained, and the average flow velocity of the fluid and the flow through the full section are calculated.
However, in practical application, because the time interval between the transmission and the reception of the ultrasonic pulse in the pipeline is very short, it is difficult to obtain the time difference with the accuracy meeting the requirement by the existing measurement means, so that the accuracy of the measurement of the fluid flow velocity is not high, and the stability is poor. Therefore, in the current application scenario of ultrasonic measurement of fluid flow velocity, the time difference is determined mainly by measuring the phase difference between forward flow ultrasonic signals and backward flow ultrasonic signals, and finally the fluid flow velocity result is obtained.
At present, various phase measurement methods, such as a zero-crossing detection method and a harmonic analysis method, exist, but the phase measurement method is mainly applied to calculating interphase voltage in an electric power system and cannot well meet the accuracy requirement of ultrasonic measurement of fluid flow velocity. In the current ultrasonic speed measurement field, improvement of phase difference measurement precision is still a problem to be solved.
Based on the above problems, the present application provides a method for measuring the phase difference of the same-frequency signal of an ultrasonic water meter, as shown in fig. 1, comprising:
s11: the up pulse signal and the down pulse signal are obtained by receiving ultrasonic pulses emitted by ultrasonic transducers respectively arranged upstream and downstream of the fluid pipeline and inclined to the fluid.
Wherein, the frequency and the amplitude of the uplink pulse signal and the downlink pulse signal are the same.
S12: and sampling the uplink pulse signal and the downlink pulse signal based on a preset sampling rate to obtain sampling points.
The preset sampling rate is an integer multiple of the frequencies of the uplink pulse signal and the downlink pulse signal, and the multiple is more than 2.
S13: and respectively carrying out periodic accumulation on sampling points of the uplink pulse signal and the downlink pulse signal to obtain accumulated sampling points, and obtaining an uplink signal sequence and a downlink signal sequence which are formed by the corresponding accumulated sampling points.
S14: and performing circular cross-correlation on the uplink signal sequence and the downlink signal sequence to obtain a correlation value.
S15: and determining a phase difference result according to the correlation value.
First, the present embodiment provides a specific application scenario of the above phase difference measurement method, as shown in fig. 2:
the flow velocity of the fluid in a certain section of pipeline is measured, wherein the ultrasonic measuring part comprises an upstream transmitting end TRANS1, a downstream receiving end XDCR1, a downstream transmitting end TRANS2 and an upstream receiving end XDCR2.v denotes the water flow velocity in the pipe, L denotes the acoustic path length, c denotes the hydrostatic sound velocity, and r denotes the pipe radius.
As can be readily seen in fig. 2, the upstream transmitting end TRANS1 and the downstream receiving end XDCR1 are used for realizing the ultrasonic detection along the flow direction of the fluid, and the ultrasonic signal emitted by the upstream TRANS1 propagates through the flow channel to reach the XDCR1, and the propagation time is denoted as t UD The method comprises the following steps:
the downstream transmitting end TRANS2 and the upstream receiving end XDCR2 are used for realizing ultrasonic detection of reverse fluid flow direction, and an ultrasonic signal emitted by the downstream TRANS2 propagates to the XDCR2 through the flow channel, and the propagation time is recorded as t DU The method comprises the following steps:
the time difference Δt between the propagation of the upstream and downstream ultrasonic waves is:
as is clear from the above equation (3), when the acoustic path length L is fixed and the time difference Δt and the still water sound velocity c are known, the water flow velocity v in the pipe can be obtained by calculation, and the flow rate of the pipe can be obtained by integration over time.
It has been described that in the current practical engineering implementation, it is difficult to directly measure the real value of the time difference Δt, so that the measurement and calculation are mainly performed by converting the time difference into the phase difference. The specific flow is as follows:
the signal sent upstream is denoted as S UP The downstream signal is denoted S DOWN . From S DOWN The start of the emission takes a fixed time t 1 The detection system then starts a digital-to-analog converter (ADC) at the upstream receiver to begin sampling and convert the continuous ultrasonic signal to a discontinuous digital signal. For the upstream-transmitted signal S UP After the same time delay t 1 Thereafter, sampling is performed at the downstream receiving end. Thus, when the signal propagation time changes little, the time difference Δt between the two signal propagation times can be obtained by calculating the signal phase difference obtained by the two sampling.
Furthermore, the same-frequency signal phase difference measuring method of the ultrasonic water meter provided by the application is used for measuring the upstream and downstream ultrasonic signals S UP And S is DOWN The phase difference of (2) results in a time difference Δt, and the process of ultimately determining the fluid flow rate is described in more detail:
for step S11, i.e., as described above and shown in FIG. 2, the up-pulse signal and the down-pulse signal (i.e., the above-described up-and down-stream ultrasonic signals S are obtained by an ultrasonic detection device such as a transducer UP And S is DOWN ). Wherein it is considered that the purpose of the method is to measure the difference between the two signalsThe phase difference is not concerned with other parameters, so that the application ensures that the frequencies and the amplitudes of the uplink pulse signal and the downlink pulse signal are the same when the corresponding pulse signals are transmitted through the transducer. In one possible embodiment, the above pulse signals each use a sinusoidal signal as the transmitted pulse signal.
Further, for step S12, the uplink and downlink pulse signals transmitted in step S11 are sampled, and the continuous signal received at the destination time of this step is converted into a digital signal to facilitate the subsequent data processing, and at the same time, the continuous signal is converted into a discrete signal to also help reduce the complexity of the subsequent computation.
Since the number of sampling points is directly determined by the sampling rate, the preset sampling rate needs to be an integer multiple of the frequencies of the uplink pulse signal and the downlink pulse signal, and the multiple is more than 2. The present example proposes a possible implementation of a preset sampling rate of 5 times the pulse signal frequency, i.e. 5 samples per cycle of the pulse signal.
For example, x is sampled for the 0 th period of the uplink pulse signal 0,0 、x 1,0 、x 2,0 、x 3,0 、x 4,0 5 points, 1 st period samples x 0,1 、x 1,1 、x 2,1 、x 3,1 、x 4,1 The same applies for 5 points followed by 3 periods, and fig. 3 is a schematic diagram of sampling at 5 times the sampling rate.
Next, as can be seen from step S13, the above sampling is required to be periodically accumulated, and the following description will be given by taking the period accumulation of the uplink pulse signal as an example, that is, the sampling points with the same sampling position in each period are accumulated and summed, and five accumulated sampling points are finally reserved as a total as can be seen from the sampling rate of 5 times, and are respectively named as x 0 、x 1 、x 2 、x 3 And x 4 Wherein the accumulation of each point can be expressed as:
it is easy to know that the above is just an example at a sampling rate of 5 times, and in practice the application is not limited to the processing of 5 times the sampling point. Assuming that K points are sampled for each period, and N periods are total, the period accumulation flow is as follows:
wherein x is n Representing accumulated sample points, x, corresponding to the nth position in the upstream pulse signal n,i Representing the sampling point corresponding to the nth sampling position of the ith period in the uplink pulse signal.
Such an extension based on the number of sampling points and the sampling period is easily known to those skilled in the art, and will not be repeated later, and the following example will also be described with 5 cycles at a sampling rate of 5 times, for convenience of explanation.
In the above embodiment, to facilitate the calculation of the phase difference, the sine signal is taken as the uplink and downlink pulse signals, so that the pulse signal satisfies the standard unit amplitude condition, and the sampling point x is therefore n,i Can be expressed as:
wherein, the liquid crystal display device comprises a liquid crystal display device,representing the initial phase angle of the upstream pulse signal.
And because the sampling point size values of the same sampling position in each period are consistent, x is the same as x 0 Is x 0,0 5 times of (a), there are:
similarly, in a wider scenario according to the above form, assuming that K points are sampled per period and N periods are sampled altogether, the amplitude of the uplink pulse signal x is a, then there is:
the application of the downlink pulse signal y is the same as that described above, so this embodiment is not repeated here.
Through step S13, an uplink signal sequence and a downlink signal sequence obtained after the periodic accumulation can be obtained:
thereafter, the cyclic cross-correlation of the uplink signal sequence and the downlink signal sequence required in step S14 is performed.
Before describing the implementation flow of step S14 specifically, the present embodiment first briefly describes the principle of solving the phase difference between two ultrasonic pulse signals by the relative method:
wherein g (τ) represents the correlation signal between signal x and signal y, τ represents the number of sampling points;indicating phase difference, and->Representing the phase angle of signal x +.>Representing the phase angle of the signal y.
As can be seen from the above, the correlated signal g (τ) after correlation of the two sinusoidal signals is still a sine wave, and the frequency is identical to the frequency of the two correlated original sinusoidal signals, both of which arePhase->I.e. the phase difference of the two original sinusoidal signalsTherefore, the phase angle of the correlated signal can be obtained, and the phase difference of the correlated signal and the correlated signal can be obtained.
After the principle of determining the phase difference between the uplink pulse signal x and the downlink pulse signal y by the correlation method is clarified, the cyclic correlation of step S14 will be further described:
for the uplink signal sequence and the downlink signal sequence obtained in step S13, cyclic correlation is performed, that is, the phase of one signal is kept unchanged, and the phase of the other signal is increased/rotated by a fixed phase.
For a sample rate of five times the frequency, assuming that the downstream signal sequence y is fixed and the upstream signal sequence x is shifted cyclically to the right, the spreading is as follows:
wherein s is 0 Is the correlation value of direct correlation between the uplink signal sequence and the downlink signal sequence; s is(s) 1 After shifting the uplink signal sequence by 1 unit to the right, i.e. x 4 ,x 0 ,x 1 ,x 2 ,x 3 A correlation value obtained after correlation with the downlink signal sequence is carried out; s is(s) 2 The uplink signal sequence is shifted to the right by 2 units, i.e. x 3 ,x 4 ,x 0 ,x 1 ,x 2 A correlation value obtained after correlation with the downlink signal sequence is carried out; correlation value s 3 Sum s 4 The same applies to the same.
Thus, for the correlation value result obtained in step S14, the present embodiment further provides a possible implementation manner, that is, the result ranking is further performed on each of the obtained correlation values, specifically:
after obtaining the correlation value through step S14, and before step S15, the method further includes:
s16: sorting from small to large according to the shift times of the correlation value corresponding to the cyclic cross correlation;
s17: performing cyclic shift on each correlation value until the maximum correlation value moves to the middle position;
correspondingly, the obtaining the phase difference result according to the phase angle in step S15 includes:
superposing a cyclic shift compensation quantity on the basis of the phase angle to obtain a phase difference result;
wherein, cyclic shift compensation amount is:
m*2π/K;
m represents the number of times of cyclic shift; k is the multiple of the preset sampling rate relative to the frequency of the uplink pulse signal and the downlink pulse signal.
The purpose of this embodiment is to find out the phase difference between the uplink pulse signal and the downlink pulse signal, which is equivalent to matched filtering, and the correlation value result of the maximum value in the correlation results is shifted to the center in a cyclic shift register manner, so that when the correlation values are fitted subsequently, the correlation peak is located at the center of the fitted curve, and a more accurate fitting effect is achieved.
Exemplary, assume that the maximum value of the five correlation results is s 1 After the cyclic shift register, the following results are obtained:
obtaining a new correlation value sequence { f } -2 ,f -1 ,f 0 ,f 1 ,f 2 }。
In general, the phase difference between two signals to be correlated is 0 by default, and the maximum value of the correlation result is s 0 And the obtained phase differenceAnd also 0. However, if a maximum value other than s is present 0 The situation of (1) indicates that the phase difference is larger at this moment, the absolute value is more than 2 pi/5 (the generalized formula is 2 pi/K), the result obtained by direct calculation is inaccurate at this moment, the cyclic shift register is needed to be firstly carried out for matching, the shift of a plurality of units and the shift direction are recorded, one unit is needed to be added with 2 pi/5 (2 pi/K) on the basis of the finally determined phase difference result every time the unit is shifted leftwards, and similarly, the shift to the right is to be subtracted by one 2 pi/5 (2 pi/K).
In addition, in the application scenario in the above embodiment, the application scenario needs to be subjected to cyclic shift register to perform matching, and more specifically, the following cases may exist:
1. the preset sampling rate is odd multiple (namely, the K value is odd);
since the preset sampling rate is used for sampling the sine wave signal, when the K value is odd, only one maximum value can exist in each correlation value obtained by sampling and subsequent correlation calculation.
Further, since the number of correlation values is an odd number, the intermediate position in the above step S17 uniquely refers to one position.
As in the above example, assume s 1 For maximum value, position 2, and position 3, the cyclic shift process is one unit to the left, so that subtracting one 2π/5 based on the phase difference obtained in step S15 results in accurate final result.
2. The preset sampling rate is even-numbered (namely even-numbered K value), and a maximum value is found;
since the preset sampling rate is sampling for the sine wave signal, when the K value is even, one or two identical maximum values may exist in each correlation value obtained by sampling and subsequent correlation calculation, and when two identical maximum values exist, the positions of the two maximum values are necessarily adjacent.
Since the number of correlation values is even, the intermediate positions in step S17 are two positions. For example, K takes 6, then the intermediate position refers to both position 3 and position 4.
Therefore, when the maximum value is two, the movement of the correlation value up to the maximum in step S17 to the intermediate position means: two identical maxima are shifted to two intermediate positions, position 3 and position 4 in the example, respectively.
When the maximum value is only one, the maximum value can be shifted to any intermediate position on the premise of minimum shift times. When example K takes 6 above, the shift mode with the smallest shift number to the intermediate position is one shift right and shifts to position 3 when the maximum value is the correlation value corresponding to position 2. The final phase difference result should be subtracted by one pi/3 (2 pi/6). When the maximum value is the correlation value corresponding to the position 4, the shift mode with the minimum shift frequency to the middle position is one shift left, and the shift is to the position 4. The final phase difference result should be added with a pi/3 (2 pi/6)
After the above 5 correlation values are obtained in step S14, a curve of the correlation values is obtained by fitting the correlation values, that is, determining a sliding correlation function, thereby determining the position of the correlation peak, solving the phase angle of the sliding correlation function, and finally determining the phase difference.
Also based on the above-mentioned result sorting scheme, more specifically, step S15 needs to construct a cosine curve f (t) as a sliding correlation function, assuming that the sliding correlation function is continuous and substituting the data points to be fitted (i.e. the above-mentioned 5 correlation value results) satisfy:
t -2 <t -1 <t 0 <t 1 <t 2 ,f(t -1 )<f(t 0 ),f(t 0 )>f(t 1 );
constructing a cosine curve:
where a is the amplitude, t is the variable, ω is the angular frequency,is the phase angle.
And (3) recording:
f i =f(i),(i=-2,-1,0,1,2);
substituting i= -2, -1,0,1,2 into formula (10), and obtaining:
for the angular frequency ω, the frequency of the received ultrasonic pulse signal is known to be f RX The sampling frequency being 5 times, i.e. 5f RX . A sine wave samples 5 points, and when sliding correlation is performed, one point is moved each time, and after 5 movements, one period of the correlation function is obtained, then
The present example also provides a preferred embodiment: the ultrasonic transducers are used for transmitting ultrasonic pulses to obtain an uplink pulse signal and a downlink pulse signal, and share the same clock source.
When clocks used by the transmitting end and the receiving end of the ultrasonic pulse signal are homologous, ω is a fixed value even if crystal oscillator polarization occurs:the influence of clock jitter on the phase difference determination result of the method is avoided.
After the angular frequency ω is determined, a least squares fitting operation may be performed after an arbitrary number of points N (N > =3) is given to find an optimal solution.
After the arbitrary point number N is given, the cosine signal model constructed as described above is:
its corresponding Least Squares (LS) error J is obtained from equation (12):
this is a nonlinear LS problem as seen in equation (13). According to trigonometric function and difference product formula:
and (3) making:
equation (12) can then be expressed as follows:
f(t)=α 1 cosωt+α 2 sinωt (14)
using the matrix expression (14), we obtain:
f=Hα (15)
wherein:
so far, the LS error and the new parameter are in linear relation, and the LS error of alpha is as follows:
α=(H T H) -1 H T x (16)
wherein:
further, taking the above 5-frequency multiplied samples as an example (n=3, n= -2, -1,0,1,2 for 5 points), the angular frequency is also takenSubstituting into a matrix H to obtain:
accordingly, α is as follows:
wherein:
solving the formula (18) to obtain:
further, a phase is obtainedThe solution of (2) is:
since the cyclic shift process is shifted left once in the sorting of the correlation value results in the above example, the final result needs to be obtainedOn the basis of (2 pi/5) and the final phase difference result +.>The method comprises the following steps:
further generalize, phase difference resultThe method comprises the following steps:
as can be seen from equation (21), the final phase difference result is related only to the frequency of the ultrasonic pulse signal and the sampling point, irrespective of the amplitude of the signal. It can be appreciated from this that the phase difference measurement achieved by the correlation-based method provided above is insensitive to signal amplitude and has less impact on the accuracy of the result due to signal strength variations caused by various reasons such as signal fluctuations, transducer performance, temperature variations, etc.
According to the method for measuring the same-frequency signal phase difference of the ultrasonic water meter, disclosed by the application, the upstream pulse signal flowing in the downstream fluid direction and the downstream pulse signal flowing in the upstream fluid direction in ultrasonic measurement are processed by a correlation method, so that a phase difference result of the upstream pulse signal and the downstream pulse signal is obtained, and the flow velocity of the fluid is determined. It is easy to know that the correlation method has noise suppression effect, which is equivalent to a digital filter, and particularly has bandpass effect, so that the suppression effect on low-frequency noise is more remarkable, and the correlation method is well suitable for the scene of measuring the pipeline water flow of the water meter. In addition, as can be seen from the formula (21) in the deduction process, the final phase difference result obtained by the correlation method is insensitive to the amplitude of the ultrasonic signal, so that the influence on the measurement of the phase difference result is very small due to the intensity change of the ultrasonic pulse signal generated by various reasons such as signal fluctuation, transducer performance, temperature change and the like in the actual scene, and the anti-interference capability in the phase difference measurement process can be effectively improved, thereby obtaining more accurate measurement results. In addition, the method also converts the continuous ultrasonic signals into discrete forms in a periodic sampling mode so as to reduce the subsequent calculated amount, and improves the signal-to-noise ratio of the discrete signals in a periodic superposition mode so as to remarkably reduce the calculation difficulty on the premise of hardly influencing the calculation accuracy in order to compensate the calculation accuracy.
In the above embodiments, a method for measuring the same-frequency signal phase difference of an ultrasonic water meter is described in detail, and the application also provides a corresponding embodiment of the same-frequency signal phase difference measuring device of the ultrasonic water meter. It should be noted that the present application describes an embodiment of the device portion from two angles, one based on the angle of the functional module and the other based on the angle of the hardware.
Based on the angle of the functional module, as shown in fig. 4, this embodiment provides a common-frequency signal phase difference measuring device of an ultrasonic water meter, including:
an ultrasonic measurement module 21 for obtaining an uplink pulse signal and a downlink pulse signal by receiving ultrasonic pulses emitted from ultrasonic transducers respectively disposed upstream and downstream of the fluid pipe and inclined to the fluid; the frequency and the amplitude of the uplink pulse signal are the same as those of the downlink pulse signal;
the signal sampling module 22 is configured to sample the uplink pulse signal and the downlink pulse signal based on a preset sampling rate, so as to obtain sampling points; the preset sampling rate is an integral multiple of the frequencies of the uplink pulse signal and the downlink pulse signal, and the multiple is more than 2;
the period accumulating module 23 is configured to respectively perform period accumulation on sampling points of the uplink pulse signal and the downlink pulse signal, so as to obtain accumulated sampling points, and obtain an uplink signal sequence and a downlink signal sequence that are formed by corresponding accumulated sampling points;
a cyclic correlation module 24, configured to perform cyclic cross-correlation on the uplink signal sequence and the downlink signal sequence to obtain a correlation value;
the parameter estimation module 25 is configured to determine a phase difference result according to the correlation value.
Since the embodiments of the apparatus portion and the embodiments of the method portion correspond to each other, the embodiments of the apparatus portion are referred to the description of the embodiments of the method portion, and are not repeated herein.
Further, this embodiment also provides a common-frequency signal phase difference measuring device of an ultrasonic water meter, including: a memory for storing a computer program;
and the processor is used for realizing the same-frequency signal phase difference measuring method of the ultrasonic water meter when executing the computer program.
The processor may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor may be implemented in hardware in at least one of a digital signal processor (Digital Signal Processor, DSP), a Field programmable gate array (Field-Programmable Gate Array, FPGA), a programmable logic array (Programmable Logic Array, PLA). The processor may also include a main processor, which is a processor for processing data in an awake state, also called a central processor (Central Processing Unit, CPU), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor may be integrated with an image processor (Graphics Processing Unit, GPU) for use in responsible for rendering and rendering of content to be displayed by the display screen. In some embodiments, the processor may also include an artificial intelligence (Artificial Intelligence, AI) processor for processing computing operations related to machine learning.
The memory may include one or more computer-readable storage media, which may be non-transitory. The memory may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory is at least used for storing a computer program, where after the computer program is loaded and executed by the processor, the relevant steps of the method for measuring the phase difference of the same-frequency signal of the ultrasonic water meter disclosed in any of the foregoing embodiments can be implemented. In addition, the resources stored in the memory can also comprise an operating system, data and the like, and the storage mode can be short-term storage or permanent storage. The operating system may include Windows, unix, linux, among others. The data may include, but is not limited to, a common frequency signal phase difference measurement method of an ultrasonic water meter, and the like.
In some embodiments, the same-frequency signal phase difference measuring device of the ultrasonic water meter can further comprise a display screen, an input/output interface, a communication interface, a power supply and a communication bus.
It will be appreciated by those skilled in the art that the above-described structure of the present embodiment does not constitute a limitation of the same-frequency signal phase difference measuring apparatus of an ultrasonic water meter, and may include more or less components than those described above.
The common-frequency signal phase difference measuring device of the ultrasonic water meter provided by the embodiment of the application comprises a memory and a processor, wherein the processor can realize the following method when executing a program stored in the memory: a method for measuring the phase difference of the same-frequency signals of an ultrasonic water meter.
Finally, the application also provides a corresponding embodiment of the computer readable storage medium. The computer-readable storage medium has stored thereon a computer program which, when executed by a processor, performs the steps as described in the method embodiments above.
It will be appreciated that the methods of the above embodiments, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored on a computer readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium for performing all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The method, the device and the medium for measuring the same-frequency signal phase difference of the ultrasonic water meter provided by the application are described in detail. In the description, each embodiment is described in a progressive manner, and each embodiment is mainly described by the differences from other embodiments, so that the same similar parts among the embodiments are mutually referred. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section. It should be noted that it will be apparent to those skilled in the art that various modifications and adaptations of the application can be made without departing from the principles of the application and these modifications and adaptations are intended to be within the scope of the application as defined in the following claims.
It should also be noted that in this specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. The common-frequency signal phase difference measuring method of the ultrasonic water meter is characterized by comprising the following steps of:
the method comprises the steps of obtaining an uplink pulse signal and a downlink pulse signal by receiving ultrasonic pulses emitted by ultrasonic transducers respectively arranged at the upstream and the downstream of a fluid pipeline and inclined to the fluid; the frequency and the amplitude of the uplink pulse signal are the same as those of the downlink pulse signal;
sampling the uplink pulse signal and the downlink pulse signal based on a preset sampling rate to obtain sampling points; the preset sampling rate is an integer multiple of the frequencies of the uplink pulse signal and the downlink pulse signal, and the multiple is more than 2;
respectively carrying out periodic accumulation on the sampling points of the uplink pulse signal and the downlink pulse signal to obtain accumulated sampling points, and obtaining an uplink signal sequence and a downlink signal sequence which are formed by the corresponding accumulated sampling points;
performing circular cross correlation on the uplink signal sequence and the downlink signal sequence to obtain a correlation value;
and determining a phase difference result according to the correlation value.
2. The method for measuring the phase difference of co-frequency signals of an ultrasonic water meter according to claim 1, wherein determining the phase difference result according to the correlation value comprises:
fitting each correlation value to determine a sliding correlation function;
and solving the phase angle of the sliding correlation function, and obtaining a phase difference result according to the phase angle.
3. The method for measuring the phase difference of co-frequency signals of an ultrasonic water meter according to claim 2, further comprising, after the obtaining the correlation value:
sorting from small to large according to the shift times of the correlation value corresponding to the cyclic cross correlation;
performing cyclic shift on each correlation value until the maximum correlation value moves to a middle position;
correspondingly, obtaining a phase difference result according to the phase angle includes:
superposing a cyclic shift compensation amount on the basis of the phase angle to obtain the phase difference result;
wherein the cyclic shift compensation amount is:
m*2π/K;
m represents the number of times of cyclic shift; k is the multiple of the preset sampling rate relative to the frequencies of the uplink pulse signal and the downlink pulse signal.
4. The method for measuring the same-frequency signal phase difference of the ultrasonic water meter according to claim 1, wherein the steps of periodically accumulating the sampling points of the uplink pulse signal and the downlink pulse signal to obtain accumulated sampling points, and obtaining an uplink signal sequence and a downlink signal sequence composed of the corresponding accumulated sampling points, respectively, include:
respectively accumulating and summing the sampling points with the same sampling position in the preset number period in the uplink pulse signal and the downlink pulse signal to obtain accumulated sampling points;
and obtaining the uplink signal sequence according to each accumulated sampling point determined by the uplink pulse signal, and obtaining the downlink signal sequence according to each accumulated sampling point determined by the downlink pulse signal.
5. The method for measuring the same-frequency signal phase difference of the ultrasonic water meter according to claim 1, wherein the performing the cyclic cross-correlation on the uplink signal sequence and the downlink signal sequence to obtain the correlation value comprises:
fixing the downlink signal sequence/uplink signal sequence, and performing cyclic shift in a fixed direction on the uplink signal sequence/downlink signal sequence;
and performing correlation operation on the uplink signal sequence and the downlink signal sequence every time the uplink signal sequence/the downlink signal sequence is shifted by one unit, so as to obtain the corresponding correlation value until the cyclic shift does not generate a new uplink signal sequence/a new downlink signal sequence.
6. The method of claim 2, wherein said fitting each of said correlation values to determine a sliding correlation function comprises:
performing fixed frequency fitting on each correlation value by a triangular interpolation method to obtain the sliding correlation function;
wherein, the fixed frequency in the fixed frequency fitting is:
k is the multiple of the preset sampling rate relative to the frequencies of the uplink pulse signal and the downlink pulse signal.
7. The method of claim 6, wherein the ultrasonic transducers for transmitting ultrasonic pulses to obtain the up pulse signal and the down pulse signal share a common clock source.
8. The common-frequency signal phase difference measuring device of the ultrasonic water meter is characterized by comprising:
the ultrasonic measuring module is used for obtaining an uplink pulse signal and a downlink pulse signal by receiving ultrasonic pulses emitted by ultrasonic transducers which are respectively arranged at the upstream and the downstream of the fluid pipeline and incline to the fluid; the frequency and the amplitude of the uplink pulse signal are the same as those of the downlink pulse signal;
the signal sampling module is used for sampling the uplink pulse signal and the downlink pulse signal based on a preset sampling rate to obtain sampling points; the preset sampling rate is an integer multiple of the frequencies of the uplink pulse signal and the downlink pulse signal, and the multiple is more than 2;
the period accumulating module is used for respectively carrying out period accumulation on the sampling points of the uplink pulse signals and the downlink pulse signals so as to obtain accumulated sampling points and obtain an uplink signal sequence and a downlink signal sequence which are formed by the corresponding accumulated sampling points;
the circulating correlation module is used for carrying out circulating cross correlation on the uplink signal sequence and the downlink signal sequence to obtain a correlation value;
and the parameter estimation module is used for determining a phase difference result according to the correlation value.
9. The common-frequency signal phase difference measuring device of the ultrasonic water meter is characterized by comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method for measuring the same-frequency signal phase difference of the ultrasonic water meter according to any one of claims 1 to 7 when executing the computer program.
10. A computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the computer program realizes the steps of the same-frequency signal phase difference measuring method of the ultrasonic water meter according to any one of claims 1 to 7.
CN202310973173.0A 2023-08-03 2023-08-03 Method, device and medium for measuring same-frequency signal phase difference of ultrasonic water meter Pending CN116990541A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310973173.0A CN116990541A (en) 2023-08-03 2023-08-03 Method, device and medium for measuring same-frequency signal phase difference of ultrasonic water meter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310973173.0A CN116990541A (en) 2023-08-03 2023-08-03 Method, device and medium for measuring same-frequency signal phase difference of ultrasonic water meter

Publications (1)

Publication Number Publication Date
CN116990541A true CN116990541A (en) 2023-11-03

Family

ID=88529700

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310973173.0A Pending CN116990541A (en) 2023-08-03 2023-08-03 Method, device and medium for measuring same-frequency signal phase difference of ultrasonic water meter

Country Status (1)

Country Link
CN (1) CN116990541A (en)

Similar Documents

Publication Publication Date Title
US11467014B2 (en) Method and system for fluid flow rate measurement
RU2182315C2 (en) Method of acoustic measurement of fluid medium flow rate
AU2018208683B2 (en) Flow meter configuration and calibration
RU98107816A (en) METHOD OF ACOUSTIC MEASUREMENT OF FLUID FLOW
CN106461437B (en) Extended range ADC flow meter
JP2005241546A (en) Doppler ultrasonic flowmeter, processing device thereof and program
KR100195576B1 (en) Apparatus for measuring the velocity of moving body
US7958786B2 (en) Flow measurement system and method using enhanced phase difference detection
CN110646042A (en) Cross-correlation interpolation method for calculating flight time difference of low-power-consumption ultrasonic flowmeter
KR101121914B1 (en) Arithmetic unit, arithmetic method and flowmeter having an arithmetic unit
US4616510A (en) Fluid velocity measuring method and apparatus
CN105115552B (en) The ultrasonic flow measuring method and device of phase are surveyed based on sidetone
EP0375441B1 (en) Ultrasonic doppler blood flow velocity detection apparatus
CN101556173A (en) Coriolis mass flowmeter digital resolver based on wavelet de-noising and method thereof
CN116990541A (en) Method, device and medium for measuring same-frequency signal phase difference of ultrasonic water meter
CN111829601B (en) Multi-state parameter synchronous measurement method and device of fluid, electronic equipment and medium
JP2000162317A (en) Measurement method for doppler frequency and doppler sonar
Gerasimov et al. Subsample time delay estimation by quadratic interpolation of correlation function of digitized ultrasonic probing signals
Bo et al. High-speed and precise measurement for ultrasonic liquid flow metering based on a single FPGA
CN115824394B (en) Weak signal phase alignment method in noise measurement
JP6273487B2 (en) Method and apparatus for measuring pulsating flow rate
Gerasimov et al. Determination of propagation times of finite ultrasonic signals in the UFM measuring path
CN116412864A (en) Ultrasonic flow detection method and device, electronic equipment and storage medium
RU2281461C2 (en) Method of measurement of sea waves&#39; height
CN117686734A (en) Flow velocity measurement method, device, equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination