Method and device for measuring flow based on DSP according to correlation change time delay
By using a flow measurement method based on correlation-based time delay using a DSP chip, the problem of inaccurate flow measurement under the influence of the underwater environment is solved, and high-speed, high-precision flow velocity measurement is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-02
- Publication Date
- 2026-04-07
AI Technical Summary
Existing acoustic Doppler current meters are highly susceptible to environmental factors in underwater environments, resulting in inaccurate velocity measurements.
A flow measurement method based on correlation and changing the delay is adopted using a DSP chip. Through fast and high-precision floating-point arithmetic and fast shared memory communication between dual cores, the autocorrelation threshold and initial delay are preset, the autocorrelation ratio is calculated and the threshold is judged, and the optimal complex autocorrelation delay is determined to calculate the flow rate.
It enables high-speed and high-precision flow velocity measurement in complex underwater environments, improving the accuracy and adaptability of flow measurement.
Smart Images

Figure CN116819538B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a flow measurement method and apparatus based on DSP that modulates time delay according to correlation, belonging to the field of sonar signal processing technology. Background Technology
[0002] The Earth's oceans are rich in resources, and the exploration and development of these resources are of paramount importance. There are many methods and techniques for exploring ocean resources, among which measuring the changes in ocean currents at different times and depths is extremely important. This method is significant for controlling pollutants in seawater, studying ocean current energy, diluting and purifying seawater, meteorological research, and naval vessel research. The Acoustic Doppler Current Profiler (ADCP) is an instrument that can measure water flow velocity and other characteristics underwater using sound waves. Compared to other flow measurement instruments, it has many advantages, such as not interfering with the flow field, high measurement speed, multiple measurement parameters, and low measurement cost, thus gaining increasingly widespread application. The core of the ADCP is the signal processing board; the better the performance of the processing board, the better the flow measurement effect.
[0003] ADCP measures the Doppler frequency by processing the echo signals reflected from scattering objects in the water, and then calculates the relative velocity between the water flow and the ship based on the Doppler frequency offset principle. Frequency estimation algorithms are mainly divided into frequency domain estimation and time domain estimation. Frequency domain estimation algorithms are computationally complex and time-consuming, making them unsuitable for the fast and flexible measurement requirements of ADCP. Therefore, the complex autocorrelation algorithm based on the time-domain phase concept has become a suitable choice for flow velocity estimation. The main idea of the complex autocorrelation algorithm is to determine the amplitude and phase relationship between two echo signals, thereby determining the frequency between the two echo signals. The complex autocorrelation algorithm is suitable for measuring flow velocity under different signal conditions, and is therefore a widely used method. However, the accuracy of flow measurement is greatly affected by the underwater environment. The movement of scattering objects, ship speed, and changes in roll and pitch caused by wind and waves can all lead to inaccurate flow measurements. Summary of the Invention
[0004] Purpose of the invention: To address the problem of inaccurate velocity measurement caused by the significant environmental influences of existing flow measurement methods, this invention discloses a flow measurement method and device based on DSP that adjusts the delay according to correlation. This method utilizes the advantages of fast and high-precision floating-point arithmetic and fast shared memory communication between dual cores of the DSP chip. By pre-setting the autocorrelation threshold and initial delay, the optimal complex autocorrelation delay is determined by calculating the autocorrelation ratio and threshold of the real-time echo waveform, and the final flow velocity is calculated. This achieves high-speed and high-precision flow velocity measurement by adjusting the delay according to correlation.
[0005] Technical solution: A current measurement method based on DSP that modulates delay according to correlation, comprising the following steps:
[0006] Step 1: Determine the autocorrelation threshold and the transmitted signal length as criteria for subsequent judgments;
[0007] Step 2: Acquire echo data, which consists of I and Q signals;
[0008] Step 3: Segment the echo data and process each segment of the echo.
[0009] Step 4, set the initial delay, the initial delay value τ = L m L m The length of a single repeated transmission signal;
[0010] Step 5: Calculate the autocorrelation parameter L of the i-th echo segment. i The autocorrelation parameter L of the i-th echo segment is obtained using the complex autocorrelation algorithm. i ;
[0011] Step 6: Compare the autocorrelation parameter L of the i-th echo segment. i With respect to the set autocorrelation threshold, if L i If the autocorrelation parameter L is greater than or equal to the set autocorrelation threshold, proceed to step 7. i If the value is less than the set autocorrelation threshold, proceed to step 9;
[0012] Step 7, increase the delay by L, which is the length of a single repeated transmission signal. m Increasing in units;
[0013] Step 8: Determine the time delay and half the length of the transmitted signal. If the time delay is greater than half the length of the transmitted signal, proceed to step 9. If the time delay is less than or equal to half the length of the transmitted signal, proceed to step 5.
[0014] Step 9: Calculate the flow rate based on the determined time delay, using the complex autocorrelation algorithm;
[0015] Step 10: Determine if all segmented signals have been processed. If yes, end the process; otherwise, set i = i + 1 and return to step 5.
[0016] In the echo data segmentation, the echo signal is segmented according to the transmitted signal length, which is composed of the number of repetitions (repeat) and the length of a single repetition (L). m Confirmed, transmitted signal length = repeat × L m .
[0017] The autocorrelation parameter L of the i-th echo segment is calculated. i The autocorrelation parameter L of the i-th echo segment is obtained using the complex autocorrelation algorithm. i ,include:
[0018] Calculate the energy values power1 and power2 of the I and Q signals of the i-th echo segment, according to the initial time delay value τ = L. m Calculate the autocorrelation values corr1 and corr2 of the I and Q signals, the cross-correlation value corr3 of the I and Q signals, and the cross-correlation value corr4 of the Q and I signals for the i-th echo segment, respectively. Denote the autocorrelation parameter L. i The real part is re = corr1 + corr2, and the imaginary part is im = corr4 - corr3. Then the autocorrelation parameter L i for
[0019] The autocorrelation parameter L of the i-th echo segment is compared. i And the size of the set threshold, if L i Less than the set threshold, or L i If the signal velocity is greater than or equal to a set threshold or the delay is greater than half the length of the transmitted signal, then the segmented signal velocity is calculated.
[0020] Based on the determined time delay, the flow rate is calculated using the complex autocorrelation algorithm. The flow rate calculation formula is as follows: Where v i f is the segmented signal flow velocity. s The sampling frequency.
[0021] Determine if all segmented signals have been processed. If so, end the process; otherwise, calculate the flow rate of the next segment.
[0022] A DSP-based current measurement device that modulates delay based on correlation, comprising:
[0023] The first unit determines the autocorrelation threshold and the transmitted signal length;
[0024] The second unit is to acquire echo data, which consists of I and Q signals.
[0025] The third unit is echo data segmentation, which involves processing the echo data of each segment.
[0026] Unit 4: Set the initial time delay, the initial time delay value τ = L m L m The length of a single repeated transmission signal;
[0027] The computational processing unit executes the following process:
[0028] (1) Calculate the autocorrelation parameter L of the i-th echo segment. i ;
[0029] (2) Compare the autocorrelation parameter L of the i-th echo segment. i With respect to the set autocorrelation threshold, if L iIf the autocorrelation parameter L is greater than or equal to the set autocorrelation threshold, then proceed to (3). i If the value is less than the set autocorrelation threshold, proceed to (5);
[0030] (3) The delay increases, and the delay is equal to the length L of a single repeated transmission signal. m Increasing in units;
[0031] (4) Determine the difference between the delay and half the length of the transmitted signal. If the delay is greater than half the length of the transmitted signal, proceed to (5). If the delay is less than or equal to half the length of the transmitted signal, proceed to (1).
[0032] (5) Calculate the flow rate based on the determined time delay, and use the complex autocorrelation algorithm to calculate the flow rate;
[0033] (6) Determine whether all segmented signals have been processed. If yes, end; otherwise, set i = i + 1 and return to (1).
[0034] The implementation process and method of the device are the same and will not be described again.
[0035] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the DSP-based flow measurement method that changes delay based on correlation as described above.
[0036] A computer-readable storage medium storing a computer program that performs the DSP-based correlation-modified delay measurement method as described above.
[0037] Beneficial effects: The flow measurement method and device based on DSP and the time delay change according to correlation provided by this invention have the following advantages compared with the traditional flow measurement method: (1) The DSP chip can perform millions of floating-point operations per second at high-speed main frequency, with fast operation speed and high calculation accuracy; (2) This invention can adaptively adjust parameters to achieve better flow measurement effect. Attached Figure Description
[0038] Figure 1 This is a schematic diagram of the overall process of the method in an embodiment of the present invention;
[0039] Figure 2 The graph shows the flow velocity results calculated using a fixed time delay.
[0040] Figure 3 This is a graph showing the results of adaptively changing the delay calculation flow rate in an embodiment of the present invention. Detailed Implementation
[0041] The present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. After reading this invention, any modifications of the invention in various equivalent forms by those skilled in the art will fall within the scope defined by the appended claims.
[0042] Example:
[0043] This invention discloses a flow measurement method based on DSP that changes the delay according to correlation. This method utilizes the advantages of fast and high-precision floating-point arithmetic of DSP chips, pre-sets the autocorrelation threshold and initial delay, determines the optimal complex autocorrelation delay by calculating the autocorrelation ratio and threshold of the real-time echo waveform, and calculates the final flow velocity, thus realizing a flow velocity that changes the delay according to correlation, and achieves high speed and high precision.
[0044] This invention discloses a DSP-based method for measuring flow by varying the time delay based on correlation. The method is based on signals received by a four-beam Janus transducer and processed by FPGA sampling and down-conversion. The transducer in the flow measurement system transmits a phase-coded signal. The speed of sound in water is c = 1500 m / s, and the water flow velocity is set to -0.4 m / s. The transmission frequency is f. c =287kHz is used to mix the echo signal, and after filtering out high-frequency components, the following frequency conversion sampling rate f is used. s The low-frequency signal is sampled at 200kHz, and the sampling result is sent to the DSP used in this embodiment of the invention for echo calculation processing. Figure 1 As shown, the specific process of the method is as follows:
[0045] In step 1, the autocorrelation parameter threshold and the transmitted signal length are determined. The transmitted signal length is calculated by multiplying the number of repetitions (repeat) by the length L of a single repetition. m We obtain the number of repetitions (repeat) and the length L of a single repetition signal. m The parameters are obtained from the host computer. In this example, the repetition count is 6, the length of a single repetition signal is 0.245ms, and the corresponding number of sampling points for a single repetition signal is L. m =49, then the total transmitted signal length is 1.47ms, corresponding to a total number of transmitted signal sampling points of L. s =6×49=294, the autocorrelation parameter threshold is set to 0.5.
[0046] In step 2, echo data is acquired, consisting of I and Q signals. The echo data is received by a Janus transducer, sampled by the FPGA, and down-converted before being transmitted from the FPGA to the DSP. The I and Q signals are the results of down-converting the echo sampled signal after multiplying it by the local oscillator cosine and sine signals, respectively. The local oscillator frequency is 287kHz, and the down-conversion sampling frequency is 200kHz.
[0047] In step 3, the echo data is segmented according to the length of the transmitted signal. In this example, the echo signal length is 50ms, the total number of echo sampling points is L = 10000, the transmitted signal length is 1.47ms, and it is divided into 34 segments.
[0048] In step 4, an initial time delay is set, with an initial time delay value τ = L. m That is, the initial delay is the length of a single repeated transmission signal.
[0049] In step 5, the autocorrelation parameter L of the i-th echo segment is calculated. i The autocorrelation parameter L of the i-th echo segment is obtained using the complex autocorrelation algorithm. i Calculate the energy values power1 and power2 of the I and Q signals of the i-th echo segment.
[0050]
[0051]
[0052] I(j) and Q(j) represent the sampled values of the I and Q signals, respectively.
[0053] According to the initial time delay value τ = L m Calculate the autocorrelation values corr1 and corr2 of the I and Q signals of the i-th echo segment, the cross-correlation value corr3 of the I and Q signals, and the cross-correlation value corr4 of the Q and I signals, respectively.
[0054]
[0055]
[0056]
[0057]
[0058] Let the autocorrelation parameter L be... i The real part is re = corr1 + corr2, and the imaginary part is im = corr4 - corr3. Then the autocorrelation parameter L i for
[0059] In step 6, the autocorrelation parameter L of the i-th echo segment is compared. i With the autocorrelation threshold set to 0.5, if L i If L ≥ 0.5, then proceed to step 7. i If <0.5, proceed to step 9;
[0060] In step 7, the delay increases, with the delay being L... m It increases by one unit, i.e., τ = τ + L m ;
[0061] After step 7 is completed, step 8 is also included: determining the latency and The size, if Then proceed to step 9, if Proceed to step 5;
[0062] In step 9, the flow velocity is calculated based on the determined time delay τ, and the flow velocity corresponding to the i-th echo segment is calculated using the complex autocorrelation algorithm. The complex autocorrelation algorithm estimates the phase difference φ(i) between two echo segments with a time delay difference of τ, and uses the formula to determine the Doppler frequency offset f of the signal. d Combined with the speed conversion formula Get the flow velocity v i f c This represents the transmitted signal frequency. The time delay difference corresponding to the i-th echo segment is τ, which is combined with the autocorrelation parameter L obtained in step 5. i The phase difference is calculated from the real and imaginary parts. Doppler frequency deviation The corresponding flow rate is
[0063] After completing step 9, it is necessary to determine whether all segmented signals have been processed. If so, the process ends; otherwise, i = i + 1, return to step 5, and calculate the flow velocity of the next echo segment. Figure 2 To calculate the flow velocity of an echo with a fixed flow velocity value using a fixed time delay, Figure 3 This is the result of calculating the flow velocity using the adaptive time delay adjustment method of this invention. (Comparison) Figure 2 and Figure 3 It can be seen that, Figure 3 The calculated flow measurement results show smaller differences in flow velocity values at different sampling times, the overall flow velocity calculation value tends to be stable, the velocity measurement variance decreases, and the velocity measurement accuracy is high.
[0064] A DSP-based current measurement device that modulates delay based on correlation, comprising:
[0065] The first unit determines the autocorrelation threshold and the transmitted signal length;
[0066] The second unit is to acquire echo data, which consists of I and Q signals.
[0067] The third unit is echo data segmentation, which involves processing the echo data of each segment.
[0068] Unit 4: Set the initial time delay, the initial time delay value τ = L m L m The length of a single repeated transmission signal;
[0069] The computational processing unit executes the following process:
[0070] (1) Calculate the autocorrelation parameter L of the i-th echo segment. i ;
[0071] (2) Compare the autocorrelation parameter L of the i-th echo segment. i With respect to the set autocorrelation threshold, if L i If the autocorrelation parameter L is greater than or equal to the set autocorrelation threshold, then proceed to (3). i If the value is less than the set autocorrelation threshold, proceed to (5);
[0072] (3) The delay increases, and the delay is equal to the length L of a single repeated transmission signal. m Increasing in units;
[0073] (4) Determine the difference between the delay and half the length of the transmitted signal. If the delay is greater than half the length of the transmitted signal, proceed to (5). If the delay is less than or equal to half the length of the transmitted signal, proceed to (1).
[0074] (5) Calculate the flow rate based on the determined time delay, and use the complex autocorrelation algorithm to calculate the flow rate;
[0075] (6) Determine whether all segmented signals have been processed. If yes, end; otherwise, set i = i + 1 and return to (1).
[0076] Obviously, those skilled in the art should understand that the steps of the DSP-based flow measurement method for changing delay based on correlation, or the units of the DSP-based flow measurement device for changing delay based on correlation, as described in the above embodiments of the present invention, can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the embodiments of the present invention are not limited to any particular hardware and software combination.
Claims
1. A current measurement method based on DSP that modulates delay according to correlation, characterized in that, Includes the following steps: Step 1: Determine the autocorrelation threshold and the transmitted signal length; Step 2: Acquire echo data, which consists of I and Q signals; Step 3: Segment the echo data and process each segment of the echo. Step 4, set the initial delay, the initial delay value τ = L m L m The length of a single repeated transmission signal; Step 5: Calculate the autocorrelation parameter L of the i-th echo segment. i ; Step 6: Compare the autocorrelation parameter L of the i-th echo segment. i With respect to the set autocorrelation threshold, if L i If the autocorrelation parameter L is greater than or equal to the set autocorrelation threshold, proceed to step 7. i If the value is less than the set autocorrelation threshold, proceed to step 9; Step 7, increase the delay by L, which is the length of a single repeated transmission signal. m Increasing in units; Step 8: Determine the time delay and half the length of the transmitted signal. If the time delay is greater than half the length of the transmitted signal, proceed to step 9. If the time delay is less than or equal to half the length of the transmitted signal, proceed to step 5. Step 9: Calculate the flow rate based on the determined time delay, using the complex autocorrelation algorithm; Step 10: Determine if all segmented signals have been processed. If yes, end the process; otherwise, set i = i + 1 and return to step 5.
2. The current measurement method based on DSP and varying delay according to correlation as described in claim 1, characterized in that, In the echo data segmentation, the echo signal is segmented according to the transmitted signal length, which is composed of the number of repetitions (repeat) and the length of a single repetition (L). m Sure.
3. The current measurement method based on DSP and varying delay according to correlation as described in claim 1, characterized in that, The autocorrelation parameter L of the i-th echo segment is calculated. i The autocorrelation parameter L of the i-th echo segment is obtained using the complex autocorrelation algorithm. i ,include: Calculate the energy values power1 and power2 of the I and Q signals of the i-th echo segment, according to the initial time delay value τ = L. m Calculate the autocorrelation values corr1 and corr2 of the I and Q signals, the cross-correlation value corr3 of the I and Q signals, and the cross-correlation value corr4 of the Q and I signals for the i-th echo segment, respectively. Denote the autocorrelation parameter L. i The real part is re = corr1 + corr2, and the imaginary part is im = corr4 - corr3. Then the autocorrelation parameter L i for 4. The current measurement method based on DSP and varying delay according to correlation as described in claim 1, characterized in that, The autocorrelation parameter L of the i-th echo segment is compared. i And the size of the set threshold, if L i Less than the set threshold, or L i If the signal velocity is greater than or equal to a set threshold or the delay is greater than half the length of the transmitted signal, then the segmented signal velocity is calculated.
5. The current measurement method based on DSP and varying delay according to correlation as described in claim 1, characterized in that, Based on the determined time delay, the flow rate is calculated using the complex autocorrelation algorithm. The flow rate calculation formula is as follows: Where v i f is the segmented signal flow velocity. s The sampling frequency.
6. A current measurement device based on DSP that changes delay according to correlation, characterized in that, include: The first unit determines the autocorrelation threshold and the transmitted signal length; The second unit is to acquire echo data, which consists of I and Q signals. The third unit is echo data segmentation, which involves processing the echo data of each segment. Unit 4: Set the initial time delay, the initial time delay value τ = L m L m The length of a single repeated transmission signal; The computational processing unit executes the following process: (1) Calculate the autocorrelation parameter L of the i-th echo segment. i ; (2) Compare the autocorrelation parameter L of the i-th echo segment. i With respect to the set autocorrelation threshold, if L i If the autocorrelation parameter L is greater than or equal to the set autocorrelation threshold, then proceed to (3). i If the value is less than the set autocorrelation threshold, proceed to (5); (3) The delay increases, and the delay is proportional to the length L of a single repeated transmission signal. m Increasing in units; (4) Determine the difference between the delay and half the length of the transmitted signal. If the delay is greater than half the length of the transmitted signal, proceed to (5). If the delay is less than or equal to half the length of the transmitted signal, proceed to (1). (5) Calculate the flow rate based on the determined time delay, and use the complex autocorrelation algorithm to calculate the flow rate; (6) Determine whether all segmented signals have been processed. If yes, end; otherwise, i = i + 1 and return to (1).
7. A computer device, characterized in that: The computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the DSP-based flow measurement method for changing delay based on correlation as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program that performs a DSP-based flow measurement method for changing delay based on correlation as described in any one of claims 1-5.
Citation Information
Patent Citations
Broadband multiple correlation flow velocity measurement method
CN105572650A
Time delay estimation method based on cross-ambiguity function and waveform similarity comparison combination
CN106950532A