Gas ultrasonic flow measurement method and device, electronic device and storage medium
By adopting an improved cross-correlation method based on Hilbert transformation in gas ultrasonic flowmeters, the problem of difficulty in accurately measuring the time of flight difference in the prior art in the environment of high noise or complex signals is solved, and higher measurement accuracy and stability are achieved.
Patent Information
- Application Number
- CN202510335526.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2025-06-20
AI Technical Summary
Existing gas ultrasonic flowmeters are difficult to accurately measure the time of flight difference in environments with high noise or complex signals, resulting in inaccurate flow measurement.
Using an improved cross-correlation method based on Hilbert transform, the ultrasonic downstream echo signal and counter-current echo signal are obtained, and its cross-correlation function is calculated, and the Hilbert transform is performed to obtain the envelope function of the analytical function, determine the target moment point, and then calculate the flight time and flow.
It improves the measurement accuracy and stability of gas ultrasonic flowmeters in environments with high noise or complex signals, reduces measurement error and repeatability, and significantly improves the performance of flowmeters.
Smart Images

Figure CN120176791A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of flow measurement, and in particular to a method, device, electronic device and storage medium for measuring gas ultrasonic flow. Background Art
[0002] Gas ultrasonic flowmeter technology, with its advantages of non-invasiveness, high measurement accuracy, low pressure loss, simple structure, wide range ratio, etc., is widely used in natural gas transportation pipeline metering, large-scale industrial gas metering management, energy conservation and emission reduction gas emission metering and other fields. The flow measurement methods of ultrasonic gas flowmeters include Doppler method, correlation method, beam deviation method, velocity difference method, etc., among which the velocity difference method includes time difference method, frequency difference method, phase difference method, etc. The time difference method is a technology that uses one or more pairs of ultrasonic sensors to measure flow. Because the propagation time of ultrasonic echo signals in the downstream and upstream directions of the fluid will be different, the time difference of the echo signal in the upstream and downstream directions can be used to calculate the flow velocity of the gas and then the flow rate.
[0003] At present, the main methods for determining the time difference of flight are the threshold method and the cross-correlation method. However, in actual use, due to the complex working conditions at the installation site, the echo signal of the ultrasonic gas flowmeter is easily interfered by noise, and the attenuation degree of the transmission process is large, which can easily affect the accurate measurement of the ultrasonic flight time, resulting in a decrease in the accuracy and stability of the gas ultrasonic flowmeter flow measurement. The threshold method relies on a specific amplitude threshold, which may cause misjudgment due to signal fluctuations or noise. The cross-correlation method determines the time delay by analyzing the similarity of the signal, thereby enhancing the accuracy and robustness of the measurement, and can effectively reduce the impact of noise interference and provide a more stable time delay estimation, especially for environments with large noise or complex signals. The cross-correlation method generally determines the time difference between the upstream and downstream echoes by finding the peak of the cross-correlation function. However, when the flight time difference is less than one sampling period, the cross-correlation function will not be able to distinguish the flight time with sub-sampling accuracy, which will have a serious impact on the accurate measurement of the flow.
[0004] However, traditional peak location algorithms all require selecting several points around the peak and assuming that the data near the peak conforms to a predetermined mathematical model. However, these methods may not be accurate enough when the peak shape is distorted by noise or other signal characteristics, resulting in inaccurate measurement of gas ultrasonic flow. Summary of the invention
[0005] In this embodiment, a method, device, electronic device and storage medium for measuring gas ultrasonic flow are provided to solve the problem of inaccurate measurement of gas ultrasonic flow in the related art.
[0006] In a first aspect, a method for measuring gas ultrasonic flow rate is provided in this embodiment, the method comprising:
[0007] Obtain the ultrasonic downstream echo signal and the ultrasonic upstream echo signal;
[0008] Calculate the cross-correlation function of the ultrasonic downstream echo signal and the ultrasonic upstream echo signal;
[0009] Perform Hilbert transform on the cross-correlation function to obtain the analytic function of the cross-correlation function;
[0010] Calculate the phase function of the cross-correlation function according to the analytic function of the cross-correlation function;
[0011] Calculate the envelope function of the analytic function of the cross-correlation function;
[0012] Determine the target time point according to the envelope function;
[0013] Determine the first time point and the second time point according to the target time point and the phase function;
[0014] Determine the flight time according to the first time point and the second time point;
[0015] Determine the ultrasonic flow rate according to the flight time.
[0016] In some embodiments, determining the target time point according to the envelope function includes:
[0017] Determine the maximum value of the envelope function;
[0018] Determine the time point corresponding to the maximum value of the envelope function as the target time point.
[0019] In some embodiments, determining the first time point and the second time point according to the target time point and the phase function includes:
[0020] The first time point and the second time point are the zero-crossing time points of the phase function.
[0021] In some embodiments, determining the first time point and the second time point according to the target time point and the phase function includes:
[0022] The first time point and the second time point are the zero-crossing time points of two phase functions adjacent to the target time point.
[0023] In some embodiments, determining the flight time according to the first time point and the second time point includes: determining the flight time according to the first time point and the second time point by means of linear interpolation.
[0024] In some embodiments, determining the ultrasonic flow rate according to the flight time includes:
[0025] Calculate the ultrasonic flow rate according to the following formula;
[0026]
[0027] Wherein, Q is the ultrasonic flow rate, S is the cross-sectional area of the pipeline, c is the sound velocity of the ultrasonic wave in the pipeline fluid, L is the length of the ultrasonic propagation path, θ is the incident angle of the ultrasonic wave, D is the diameter of the pipeline, ΔT is the flight time, and τ precise is the flight time.
[0028] In a second aspect, a gas ultrasonic flow measurement device is provided in this embodiment. The device includes:
[0029] An acquisition module for acquiring an ultrasonic wave downstream echo signal and an ultrasonic wave upstream echo signal;
[0030] A first calculation module for calculating the cross-correlation function of the ultrasonic wave downstream echo signal and the ultrasonic wave upstream echo signal;
[0031] A processing module for performing a Hilbert transform on the cross-correlation function to obtain an analytic function of the cross-correlation function;
[0032] A second calculation module for calculating the phase function of the cross-correlation function according to the analytic function of the cross-correlation function;
[0033] A third calculation module for calculating the envelope function of the analytic function of the cross-correlation function;
[0034] A first determination module for determining a target time point according to the envelope function;
[0035] A second determination module for determining a first time point and a second time point according to the target time point and the phase function;
[0036] A third determination module for determining the flight time according to the first time point and the second time point;
[0037] A fourth determination module for determining the ultrasonic flow rate according to the flight time.
[0038] In some of these embodiments, the first determination module is further configured to
[0039] determine the maximum value of the envelope function;
[0040] Determine the time point corresponding to the maximum value of the envelope function as the target time point.
[0041] In a third aspect, an electronic device is provided in this embodiment, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the gas ultrasonic flow measurement method described in the first aspect.
[0042] Fourthly, in this embodiment, a computer-readable storage medium is provided, on which a computer program is stored. It is characterized in that when the computer program is executed by a processor, the steps of the gas ultrasonic flow measurement method described in the first aspect are realized.
[0043] Compared with the related art, in a gas ultrasonic flow measurement method, device, electronic device and storage medium provided in this embodiment, by acquiring ultrasonic downstream echo signals and ultrasonic upstream echo signals, calculating the cross-correlation function of the ultrasonic downstream echo signals and the ultrasonic upstream echo signals, performing Hilbert transform on the cross-correlation function to obtain the analytic function of the cross-correlation function, calculating the phase function of the cross-correlation function according to the analytic function of the cross-correlation function, calculating the envelope function of the analytic function of the cross-correlation function, determining the target time point according to the envelope function, determining the first time point and the second time point according to the target time point and the phase function, determining the flight time according to the first time point and the second time point, and determining the ultrasonic flow according to the flight time, the accurate measurement of gas ultrasonic flow is realized.
[0044] Details of one or more embodiments of the present application are set forth in the following drawings and description, so that other features, objects, and advantages of the present application will become more comprehensible. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The drawings described herein are used to provide a further understanding of the present application and form a part of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation of the present application. In the drawings:
[0046] Figure 1 is a hardware structure block diagram of a terminal of a gas ultrasonic flow measurement method provided in this embodiment;
[0047] Figure 2 is a flowchart of a gas ultrasonic flow measurement method provided in an embodiment of the present application;
[0048] Figure 3 is a schematic flow diagram of a gas ultrasonic flow measurement method provided in an embodiment of the present application;
[0049] Figure 4 is a schematic diagram of a cross-correlation principle provided in an embodiment of the present application;
[0050] Figure 5 is a schematic diagram of an envelope signal provided in an embodiment of the present application;
[0051] Figure 6 is a schematic diagram of a zero-crossing point provided in an embodiment of the present application;
[0052] Figure 7(a) is a schematic diagram of a zero-crossing point provided in an embodiment of the present application;
[0053] Figure 7(b) is a schematic diagram of linear interpolation provided by an embodiment of the present application;
[0054] Figure 8 is a schematic diagram of a flowmeter provided by an embodiment of the present application;
[0055] Figure 9(a) is an analysis schematic diagram between the flow rate calculated by using the CCF method and the reference flow rate provided by an embodiment of the present application;
[0056] Figure 9(b) is an analysis schematic diagram between the flow rate calculated by using the HTCCF method and the reference flow rate provided by an embodiment of the present application;
[0057] Figure 10(a) is a schematic diagram of the relative error of a flowmeter provided by an embodiment of the present application;
[0058] Figure 10(b) is a schematic diagram of repeatability provided by an embodiment of the present application;
[0059] Figure 11 is a schematic diagram of an envelope shape provided by an embodiment of the present application;
[0060] Figure 12 is a schematic diagram of the selection of the echo signal period provided by an embodiment of the present application. Detailed implementation manners
[0061] To more clearly understand the purpose, technical solution and advantages of the present application, the present application will be described and illustrated below with reference to the accompanying drawings and embodiments.
[0062] Unless otherwise defined, technical terms or scientific terms involved in this application shall have the general meanings understood by those with ordinary skills in the technical field to which this application belongs. In this application, words such as "a", "one", "a kind of", "the", "these" and the like do not indicate a limitation in quantity, and they can be singular or plural. The terms "including", "containing", "having" and any variants thereof involved in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product or device containing a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent in these processes, methods, products or devices. The words such as "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether directly or indirectly connected. The "plurality" involved in this application means two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships may exist. For example, "A and / or B" may represent: A exists alone, A and B exist simultaneously, and B exists alone. Usually, the character " / " indicates that the objects associated before and after are in an "or" relationship. The terms "first", "second", "third" and the like involved in this application only distinguish similar objects and do not represent a specific order for the objects.
[0063] The method embodiment provided in this embodiment can be executed on a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 is a hardware structure block diagram of a terminal for a method of measuring gas ultrasonic flow provided in this embodiment. As Figure 1 shown, the terminal may include one or more ( Figure 1 only one is shown in the figure) processors 102 and a memory 104 for storing data. Among them, the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only schematic and does not limit the structure of the above terminal. For example, the terminal may further include more or fewer components than those shown in Figure 1 the figure, or have a different configuration from that shown in Figure 1 the figure.
[0064] The memory 104 can be used to store computer programs, such as software programs and modules of application software, such as the computer program corresponding to a method for measuring gas ultrasonic flow in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely set relative to the processor 102, and these remote memories can be connected to the terminal through a network. Examples of the above network include but are not limited to the Internet, intranet, local area network, mobile communication network, and combinations thereof.
[0065] The transmission device 106 is used to receive or send data via a network. The above network includes the wireless network provided by the communication provider of the terminal. In one instance, the transmission device 106 includes a network adapter (Network Interface Controller, abbreviated as NIC), which can be connected to other network devices through a base station and thus can communicate with the Internet. In one instance, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0066] In this embodiment, a method for measuring gas ultrasonic flow is provided. Figure 2 It is a flowchart of a method for measuring gas ultrasonic flow provided by an embodiment of the present application, as Figure 2 shown, and the process includes the following steps:
[0067] Step S210, obtain the ultrasonic downstream echo signal and the ultrasonic upstream echo signal.
[0068] Among them, the ultrasonic downstream echo signal refers to the echo signal generated when the propagation direction of ultrasonic waves in the fluid is the same as the fluid flow direction. The ultrasonic upstream echo signal refers to the echo signal generated when the propagation direction of ultrasonic waves in the fluid is opposite to the fluid flow direction.
[0069] Step S220, calculate the cross-correlation function of the ultrasonic downstream echo signal and the ultrasonic upstream echo signal.
[0070] Step S230, perform a Hilbert transform on the cross-correlation function to obtain the analytic function of the cross-correlation function.
[0071] Step S240, calculate the phase function of the cross-correlation function according to the analytic function of the cross-correlation function.
[0072] Step S250, calculate the envelope function of the analytical function of the cross-correlation function.
[0073] Step S260, determine the target time point according to the envelope function.
[0074] Among them, determine the maximum value of the envelope function of the analytical function, and determine the time point corresponding to the maximum value of the envelope function of the analytical function as the target time point.
[0075] Step S270, determine the first time point and the second time point according to the target time point and the phase function.
[0076] Among them, the first time point and the second time point are the zero-crossing time points of the phase function, and the first time point and the second time point are the zero-crossing time points of two phase functions adjacent to the target time point. If there are multiple zero-crossing time points of the phase function, after the target time point is determined, the first time point and the second time point are the zero-crossing time points of two phase functions adjacent to the target time point. The zero-crossing time point here is the transition point where the phase changes from positive to negative or from negative to positive.
[0077] Step S280, determine the flight time according to the first time point and the second time point.
[0078] Among them, the flight time is determined by linear interpolation according to the first time point and the second time point.
[0079] Step S290, determine the ultrasonic flow rate according to the flight time.
[0080] Among them, calculate the ultrasonic flow rate according to formula (1);
[0081]
[0082] Among them, Q is the ultrasonic flow rate, S is the cross-sectional area of the pipeline, c is the sound speed of ultrasonic waves in the pipeline fluid, L is the length of the ultrasonic propagation path, θ is the incident angle of ultrasonic waves, D is the diameter of the pipeline, ΔT is the flight time, and τ precise is the flight time.
[0083] Through the above steps, obtain the ultrasonic downstream echo signal and the ultrasonic upstream echo signal, calculate the cross-correlation function of the ultrasonic downstream echo signal and the ultrasonic upstream echo signal, perform Hilbert transform on the cross-correlation function to obtain the analytical function of the cross-correlation function, calculate the phase function of the cross-correlation function according to the analytical function of the cross-correlation function, calculate the envelope function of the analytical function of the cross-correlation function, determine the target time point according to the envelope function, determine the first time point and the second time point according to the target time point and the phase function, determine the flight time according to the first time point and the second time point, and determine the ultrasonic flow rate according to the flight time, so as to achieve accurate measurement of the gas ultrasonic flow rate.
[0084] As shown Figure 3 in the figure, the overall measurement method includes three parts: echo data import, time-of-flight calculation, and flow rate calculation. Among them, echo data import includes obtaining echo data x(t) and y(t), where x(t) and y(t) are two consecutive time signals, which are ultrasonic downstream echo signal and upstream echo signal respectively. Time-of-flight calculation includes cross-correlation operation, Hilbert transform, and zero-crossing linear interpolation to calculate the time-of-flight τ, and then calculate the accurate flow rate.
[0085] In this embodiment, a method for measuring gas ultrasonic flow rate is also provided, and this method includes the following steps:
[0086] Step S310, calculate the cross-correlation function.
[0087] Specifically, analyze the principle of cross-correlation method and the optimal time delay. Figure 4 is a schematic diagram of the cross-correlation principle. Among them, x(t) and y(t) are two consecutive time signals, which are ultrasonic downstream echo signal and upstream echo signal respectively. Their cross-correlation function R xy (τ) is defined as Equation (2):
[0088]
[0089] where τ is the time delay parameter, and R xy (τ) represents the integral of the product of the two signals when the signal y(t) is delayed by τ relative to the signal x(t). When τ = 0, R xy (τ) reflects the correlation degree of the two signals at the same moment; when τ is not 0, R xy (τ) describes the correlation degree of the two signals when they are relatively shifted by τ.
[0090] The peak position of the cross-correlation function R xy (τ) can be used to estimate the relative time delay between the two signals. The optimal matching time delay τ0 between the signals can be determined by finding the τ value that maximizes R xy (τ), as shown in Equation (3):
[0091] τ0 = argmax τ R xy (τ) (3)
[0092] This means that when the signal y(t) is delayed by τ max relative to the signal x(t), the similarity of the two signals reaches the highest.
[0093] Step S320, use Hilbert transform and analyze the analytic signal.
[0094] For any real-valued time signal x(t), the Hilbert transform H[x(t)] is defined as the convolution of each point of the original signal x(t) with the function as shown in Equation (4):
[0095]
[0096] Using the Hilbert transform, the analytic representation of the signal x(t) can be constructed, as shown in Equation (5), and its expression is:
[0097]
[0098] The analytic signal x a (t) in the complex plane contains all the information of the original signal, where the real part is the original signal x(t) and the imaginary part is the Hilbert transform of the signal as Figure 5 shown. The modulus of the analytic signal is called the envelope of the signal x(t), and its expression is as shown in Equation (6):
[0099]
[0100] Step S330, calculate the phase of the cross-correlation function after Hilbert transform.
[0101] The third step of this embodiment is to calculate the phase of the cross-correlation function after Hilbert transform. Apply the Hilbert transform to the cross-correlation function R xy (τ) to obtain its analytic representation, which can be expressed as a combination of the original function and its Hilbert transform.
[0102] The specific steps are as shown in Equation (7), and R xy,a (τ) is an analytic function:
[0103]
[0104] where is the Hilbert transform of R xy (τ), and the calculation method is as follows:
[0105]
[0106] The phase φ(τ) of the analytic cross-correlation function can provide important information about the time delay between signals, and the phase calculation is as follows:
[0107]
[0108] The zero-crossing points (i.e., the transition points where the phase changes from positive to negative or from negative to positive) in the phase φ(τ) of the analytical function indicate the precise time delay between signals. By finding the value of τ for which φ(τ) is zero, the time delay τ0 between the signals can be estimated. When the cross-correlation function reaches its maximum value, its Hilbert transform will cross the zero point, as Figure 6 shown. Among them, HTCCF is the gas ultrasonic flow measurement method based on the improved cross-correlation method using the Hilbert transform, and CCF is the traditional cross-correlation method.
[0109] Step S340: Analyze the envelope of the analytical signal and determine its peak points.
[0110] Based on the analytical signal of the cross-correlation function obtained in step S330, analyze the envelope of the analytical signal and determine its peak points.
[0111] Using the envelope of the cross-correlation function, the two zero-crossing points of the analytical signal R xy,a (τ) that are closest to the peak point of the cross-correlation function can be conveniently obtained directly. The envelope A(τ) of the cross-correlation function is defined as shown in formula (10):
[0112]
[0113] The peak point τ peak of CCF (traditional cross-correlation method) is determined by finding the maximum value of the envelope A(τ), as shown in formula (11):
[0114] τ peak = argmax τ A(τ) (11)
[0115] Assume τ peak is the peak position of CCF, and select the two phase zero-crossing points τ peak and τ z1 and τ z2 that are closest to τ
[0116] and satisfy, as shown in formula (12): z1 ,τ z2 ) = φ(τ z2 ) - φ(τ z1 ) ≈ 0 (12)
[0117] and ensure τ z1 < τ peak < τ z2 .
[0118] Step S350: Calculate the precise flight time through linear interpolation.
[0119] The final time delay τ precise is obtained by linearly interpolating between τ z1 and τz2 is obtained by performing linear interpolation therebetween, as shown in Equation (13):
[0120] τ precise = τ zero ·T (13)
[0121] τ is the horizontal axis offset value of the zero point of linear interpolation, and T is the sampling interval of the FPGA. This zero
[0122] interpolation method is used because there is an approximately linear relationship in the phase change within the range from τ z1 to τ z2 interval. Therefore, linear interpolation is performed between the zero points to accurately calculate the actual delay between echo signals. As shown in Fig. 7(a), the peak of the CCF corresponds to the zero point of the HTCCF. Here, 100-fold linear interpolation is adopted. The schematic diagram of linear interpolation is shown in Fig. 7(b).
[0123] As Figure 8 shown, for a pipeline with a diameter of D, ultrasonic transducers A and B are respectively installed on the upper and lower sides of the pipeline. Among them, L is the length of the ultrasonic propagation path, V is the linear average flow velocity of the gas in the pipeline, and is the incident angle of the ultrasonic wave. Therefore, the flow rate Q can be calculated as follows:
[0124]
[0125] where S is the cross-sectional area of the pipeline, c is the sound velocity of the ultrasonic wave in the pipeline fluid, ΔT is the flight time, and τ precise is the flight time.
[0126] Fig. 9(a) is the Bland-Altman plot between the flow rate calculated by using the CCF method and the reference flow rate. The 95% confidence interval range of this method is -0.39970 to 0.47769 (i.e., 0.87739). The Bland-Altman plot shows that the calculation error of the flow rate points with a small flow rate of 2 m 3 / h is relatively large. And Fig. 9(b) is the Bland-Altman plot between the flow rate calculated by using the HTCCF method and the reference flow rate. The results show that the method based on HTCCF has a narrower confidence interval (-0.24711 to 0.31157, i.e., 0.55868), which is 36.32% lower than the flow rate estimation using the CCF method. The problem of large calculation error of the flow rate points with 2 m 3 / h is solved, and the errors at 16 m 3 / h and 40 m 3 / h are also improved. Compared with the CCF method, the flow rate calculation using HTCCF has higher accuracy at small flow rates.
[0127] As can be seen from the experimental results in Figures 10(a) and 10(b), the measurement relative errors of the ultrasonic gas flowmeter using the HTCCF method are all within 1%, and the repeatabilities are all within 0.2%. Moreover, under the test flow conditions, both the relative error and the repeatability are better than those of the CCF method.
[0128] The embodiment of the present application also proposes a method capable of accurately intercepting the echo period, which effectively reduces the amount of computation required for intercepting the echo period.
[0129] Due to the inherent characteristics of ultrasonic wave propagation in the medium, the ultrasonic echo signal shows a stable rising edge feature. This is because the propagation and reflection of the ultrasonic wave signal are mainly controlled by the physical properties of the medium rather than the magnitude of the flow rate. When the ultrasonic pulse propagates along the measurement path, the medium characteristics it encounters, such as density, elastic modulus, and sound velocity, remain constant under certain conditions. These physical parameters jointly affect the propagation behavior of the ultrasonic wave signal, thus forming a stable waveform feature in the echo signal. And by normalizing and adjusting the amplitude of the signal to a unified ratio, the difference in signal intensity is eliminated, making the shape feature of the envelope more obvious. In this way, even under different flow conditions, due to the consistent propagation characteristics of the signal, the shape of the rising edge envelope of the echo signal also shows relative consistency, as Figure 11 shown. Therefore, by utilizing this characteristic above, a fixed threshold can be set to accurately select the partial forward and reverse flow echoes for cross-correlation operation, achieving the purpose of reducing the amount of computation. The specific steps are as follows:
[0130] Step 1, perform normalization processing on the echo data of the ultrasonic flowmeter collected.
[0131] Step 2, obtain the envelopes of the forward and reverse flow echo signals through Hilbert transform.
[0132] Step 3, set a threshold. When the envelope reaches this threshold, extract the characteristic point sequence from the corresponding echo period.
[0133] Step 4, by analyzing the envelope line, a threshold μ can be set. This threshold is used to determine the characteristic points of the echo signal and is selected as a certain proportion of the maximum value of the envelope line E(t), as shown in formula (15):
[0134] μ = k × max(E(t)) (15)
[0135] where k is a proportionality coefficient less than 1 and is used to capture the starting point of the period. Through the threshold μ, the starting characteristic point of the third period can be accurately selected;
[0136] Step 5, based on the starting point of the third period, intercept the waveforms of the third, fourth, and fifth periods of the forward and reverse flow echo signals behind for cross-correlation operation.Figure 12 It is a schematic diagram of the selection of the echo signal period.
[0137] An embodiment of the present application further provides an echo acquisition device for a gas ultrasonic flowmeter. The device includes: a memory; and a processor connected to the memory, and the processor is configured to execute the above method.
[0138] It should be noted that the steps shown in the above process or the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0139] In this embodiment, a measurement device for gas ultrasonic flow is further provided. This device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated here. The following terms such as "module", "unit", "sub-unit", etc. can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0140] This embodiment further provides a structural block diagram of a measurement device for gas ultrasonic flow. The device includes:
[0141] An acquisition module, configured to acquire an ultrasonic downstream echo signal and an ultrasonic upstream echo signal;
[0142] A first calculation module, configured to calculate the cross-correlation function of the ultrasonic downstream echo signal and the ultrasonic upstream echo signal;
[0143] A processing module, configured to perform a Hilbert transform on the cross-correlation function to obtain an analytical function of the cross-correlation function;
[0144] A second calculation module, configured to calculate the phase function of the cross-correlation function according to the analytical function of the cross-correlation function;
[0145] A third calculation module, configured to calculate the envelope function of the analytical function of the cross-correlation function;
[0146] A first determination module, configured to determine a target time point according to the envelope function;
[0147] A second determination module, configured to determine a first time point and a second time point according to the target time point and the phase function;
[0148] A third determination module, configured to determine the flight time according to the first time point and the second time point;
[0149] A fourth determination module, configured to determine the ultrasonic flow according to the flight time.
[0150] It should be noted that each of the above modules can be a functional module or a program module, and can be implemented either by software or by hardware. For the modules implemented by hardware, each of the above modules can be located in the same processor; or each of the above modules can also be located in different processors in any combined form.
[0151] In this embodiment, an electronic device is further provided, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0152] Optionally, the above electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the above processor, and the input / output device is connected to the above processor.
[0153] Optionally, in this embodiment, the above processor may be configured to execute the following steps by a computer program:
[0154] S1, obtain an ultrasonic downstream echo signal and an ultrasonic upstream echo signal;
[0155] S2, calculate the cross-correlation function of the ultrasonic downstream echo signal and the ultrasonic upstream echo signal;
[0156] S3, perform a Hilbert transform on the cross-correlation function to obtain an analytic function of the cross-correlation function;
[0157] S4, calculate the phase function of the cross-correlation function according to the analytic function of the cross-correlation function;
[0158] S5, calculate the envelope function of the analytic function of the cross-correlation function;
[0159] S6, determine the target time point according to the envelope function;
[0160] S7, determine a first time point and a second time point according to the target time point and the phase function;
[0161] S8, determine the flight time according to the first time point and the second time point;
[0162] S9, determine the ultrasonic flow rate according to the flight time.
[0163] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation manners, and will not be repeated in this embodiment.
[0164] In addition, in combination with the method for measuring gas ultrasonic flow provided in the above embodiments, a storage medium can also be provided in this embodiment to implement it. A computer program is stored on the storage medium; when the computer program is executed by a processor, any of the methods for measuring gas ultrasonic flow in the above embodiments is implemented.
[0165] The advantages of the embodiments of the present application lie in the method for measuring gas ultrasonic flow using an improved cross-correlation method based on Hilbert transform. The test results show that it can achieve lower measurement errors and better repeatability than the traditional cross-correlation method, indicating that the performance of this method is more stable and reliable. Therefore, the embodiments of the present application can significantly improve the measurement accuracy of ultrasonic gas flowmeters, which is of great significance for the development of precision flow measurement technology.
[0166] It should be understood that the specific embodiments described here are only used to explain this application, rather than to limit it. According to the embodiments provided in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work belong to the protection scope of the present application.
[0167] Obviously, the drawings are only some examples or embodiments of the present application. For those of ordinary skill in the art, the present application can also be applied to other similar situations based on these drawings without creative work. Additionally, it can be understood that although the work done during the development process here may be complex and time-consuming, for those of ordinary skill in the art, certain design, manufacturing, or production changes based on the technical content disclosed in the present application are only conventional technical means and should not be regarded as insufficient disclosure of the present application.
[0168] The term "embodiment" in the present application means that the specific features, structures, or characteristics described in combination with the embodiments can be included in at least one embodiment of the present application. The phrase appears in various positions in the specification does not necessarily mean the same embodiment, nor does it mean being independent or alternative to other embodiments and mutually exclusive. Those of ordinary skill in the art can clearly or implicitly understand that the embodiments described in the present application can be combined with other embodiments without conflict.
[0169] The above-described embodiments only represent several implementation manners of the present application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of patent protection. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A method for measuring gas ultrasonic flow, characterized in that: The method comprises: Acquire ultrasonic downstream echo signals and ultrasonic upstream echo signals; Calculating a cross-correlation function between the ultrasonic downstream echo signal and the ultrasonic upstream echo signal; Performing Hilbert transform on the cross-correlation function to obtain an analytical function of the cross-correlation function; Calculating a phase function of the cross-correlation function according to an analytical function of the cross-correlation function; Calculating an envelope function of an analytical function of the cross-correlation function; Determining a target time point according to the envelope function; Determining a first time point and a second time point according to the target time point and the phase function; Determine the flight time according to the first time point and the second time point; Based on the flight time, the ultrasonic flow rate is determined.
2. The method for measuring gas ultrasonic flow rate according to claim 1, characterized in that: Determining the target time point according to the envelope function includes: determining a maximum value of the envelope function; The time point corresponding to the maximum value of the envelope function is determined as the target time point.
3. The method for measuring gas ultrasonic flow rate according to claim 2, characterized in that: The determining the first time point and the second time point according to the target time point and the phase function includes: The first time point and the second time point are zero-crossing time points of the phase function.
4. The method for measuring gas ultrasonic flow rate according to claim 3, characterized in that: The determining the first time point and the second time point according to the target time point and the phase function comprises: The first time point and the second time point are two zero-crossing time points of the phase function adjacent to the target time point.
5. The method for measuring gas ultrasonic flow rate according to claim 1, characterized in that: Determining the flight time according to the first time point and the second time point includes: determining the flight time according to the first time point and the second time point by a linear interpolation method.
6. The method for measuring gas ultrasonic flow rate according to claim 1, characterized in that: Determining the ultrasonic flow rate according to the flight time includes: The ultrasonic flow rate is calculated according to the following formula; Where Q is the ultrasonic flow rate, S is the cross-sectional area of the pipe, c is the speed of sound of the ultrasonic wave in the pipe fluid, L is the length of the ultrasonic propagation path, θ is the incident angle of the ultrasonic wave, D is the diameter of the pipe, ΔT is the flight time, and τ precise For flight time.
7. A gas ultrasonic flow measurement device, characterized in that: The device comprises: An acquisition module, used for acquiring an ultrasonic downstream echo signal and an ultrasonic upstream echo signal; A first calculation module, used for calculating the cross-correlation function of the ultrasonic downstream echo signal and the ultrasonic upstream echo signal; A processing module, used for performing Hilbert transform on the cross-correlation function to obtain an analytical function of the cross-correlation function; A second calculation module, used for calculating the phase function of the cross-correlation function according to the analytical function of the cross-correlation function; A third calculation module, used for calculating the envelope function of the analytical function of the cross-correlation function; A first determination module, used to determine a target time point according to the envelope function; A second determining module, used to determine a first time point and a second time point according to the target time point and the phase function; A third determining module, used to determine the flight time according to the first time point and the second time point; The fourth determination module is used to determine the ultrasonic flow rate according to the flight time.
8. The gas ultrasonic flow measurement device according to claim 7, characterized in that: The first determining module is further configured to: determining a maximum value of the envelope function; The time point corresponding to the maximum value of the envelope function is determined as the target time point.
9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the gas ultrasonic flow measurement method according to any one of claims 1 to 6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for measuring gas ultrasonic flow rate according to any one of claims 1 to 9 are implemented.
Citation Information
Cited By
Ultrasonic echo signal modulation method and ultrasonic flowmeter
CN120800508A