Arrival-Time Detection in Wind-Speed Measurement: Wavelet Transform and Bayesian Information Criteria

The time-difference method is a common one for measuring wind speed ultrasonically, and its core is the precise arrival-time determination of the ultrasonic echo signal. However, because of background noise and different types of ultrasonic sensors, it is difficult to measure the arrival time of the echo signal accurately in practice. In this paper, a method based on the wavelet transform (WT) and Bayesian information criteria (BIC) is proposed for determining the arrival time of the echo signal. First, the time-frequency distribution of the echo signal is obtained by using the determined WT and rough arrival time. After setting up a time window around the rough arrival time point, the BIC function is calculated in the time window, and the arrival time is determined by using the BIC function. The proposed method is tested in a wind tunnel with an ultrasonic anemometer. The experimental results show that, even in the low-signal-to-noise-ratio area, the deviation between mostly measured values and preset standard values is mostly within 5 μs, and the standard deviation of measured wind speed is within 0.2 m/s.


Introduction
Accurate measurement of wind speed is of considerable significance in many fields [1]. In atmospheric science, accurate measurement of wind speed has a direct impact on accurate weather forecasting [2]. In agriculture, accurate wind-speed measurements contribute to crop cultivation and growth [3]. On an entire high-speed rail line, one anemometer is placed at every mile to measure wind speed and direction for the safety of the trains using that line [4]. In the military, it is necessary to measure wind speed accurately in a complex environment, as it is vitally essential for the precise targeting of weapons [5]. In the manufacturing process of wind tunnels, accurate wind-speed measurement is needed to calibrate wind speed in wind tunnels [6]. At present, prevailing wind-measuring instruments include mechanical anemometers [7], thermal anemometers [8], pitot tube anemometers [9], and ultrasonic wind-measuring instruments [10,11]. A mechanical anemometer has a rotating part that is easily damaged in use. The measuring range of wind speed is limited because of the design principle of the thermal anemometer. When utilizing a pitot-tube anemometer, temperature must be measured, and its magnitude is greatly influenced by environmental factors, while the application conditions are too harsh. In contrast, ultrasonic anemometers are widely utilized because they have no mechanical structure, no start-up wind speed limitation, a wide measurement range, and many other advantages [12].
However, the frequency spectra of the noise and echo signal overlap significantly in frequency range. In a complex environment, noise sources, such as strong electromagnetic fields and high temperature, inevitably interfere with the instrument [26]. Figure 2 shows a group of typical echo signals in a wind tunnel with electromagnetic interference. In Figure 2a, the amplitude of background noise has exceeded the amplitude of the first wave, and because of the existence of electromagnetic interference, the echo waveform exhibits some distortion. The spectrum of background noise is uniformly distributed in the entire frequency domain, as is shown in Figure 2b, which demonstrates that the arrival time of the first wave cannot be clearly identified, and the filter cannot effectively eliminate the noise. However, the frequency spectra of the noise and echo signal overlap significantly in frequency range. In a complex environment, noise sources, such as strong electromagnetic fields and high temperature, inevitably interfere with the instrument [26]. Figure 2 shows a group of typical echo signals in a wind tunnel with electromagnetic interference. In Figure 2a, the amplitude of background noise has exceeded the amplitude of the first wave, and because of the existence of electromagnetic interference, the echo waveform exhibits some distortion. The spectrum of background noise is uniformly distributed in the entire frequency domain, as is shown in Figure 2b, which demonstrates that the arrival time of the first wave cannot be clearly identified, and the filter cannot effectively eliminate the noise. after receiving the ultrasonic signal, as shown in Figure 1. Therefore, the best way to recognize the ultrasonic echo signal is to determine the arrival time of the first wave. However, the frequency spectra of the noise and echo signal overlap significantly in frequency range. In a complex environment, noise sources, such as strong electromagnetic fields and high temperature, inevitably interfere with the instrument [26]. Figure 2 shows a group of typical echo signals in a wind tunnel with electromagnetic interference. In Figure 2a, the amplitude of background noise has exceeded the amplitude of the first wave, and because of the existence of electromagnetic interference, the echo waveform exhibits some distortion. The spectrum of background noise is uniformly distributed in the entire frequency domain, as is shown in Figure 2b, which demonstrates that the arrival time of the first wave cannot be clearly identified, and the filter cannot effectively eliminate the noise. To accurately determine the arrival time of the first wave in noise, we must utilize parameters with distinct characteristics when the first wave arrives. As mentioned above, it can be seen that the frequency of the signal changes significantly when the echo arrives, so the joint time-frequency analysis can be utilized to estimate the arrival time of the first wave. When the echo signal arrives, the frequency of the signal increases rapidly with time, which means that when the first wave arrives, the joint time-frequency analysis requires good time resolution to provide accurate time-frequency positioning. This can be achieved by pre-processing the signal using the WT. That involves using a signal scalogram to carry out time-frequency analysis and obtain the distribution relationship between time, frequency, and energy.
The WT, proposed by Morlet [26], can provide a time-frequency window that changes with frequency. The definition of a continuous WT is expressed as where is a scale factor associated with frequency and is a displacement factor that describes wavelet movement in the time domain. A mother wavelet generates a function family , ( ) = 1 √ ( − ) by changing and . ( ) is an echo signal that changes persistently and ( ) is the mother wavelet that must satisfy the following conditions: In addition, a Fourier transform (FT) ( ) of wavelet function ( ) must satisfy the following conditions: The selection of the wavelet function is essential in the WT, which is related to whether good resolution can be obtained in the time-frequency domain. The frequency of the echo signal received by the sensor is a single one, which means a high temporal resolution is required for time localization of this single frequency. The Morlet WT (MWT), which utilizes the Morlet wavelet function, is an ideal option [27], and its analytic formula is where 0 is the wavelet central frequency and an imaginary number unit. Therefore, Equation (1) can be rewritten as To accurately determine the arrival time of the first wave in noise, we must utilize parameters with distinct characteristics when the first wave arrives. As mentioned above, it can be seen that the frequency of the signal changes significantly when the echo arrives, so the joint time-frequency analysis can be utilized to estimate the arrival time of the first wave. When the echo signal arrives, the frequency of the signal increases rapidly with time, which means that when the first wave arrives, the joint time-frequency analysis requires good time resolution to provide accurate time-frequency positioning. This can be achieved by pre-processing the signal using the WT. That involves using a signal scalogram to carry out time-frequency analysis and obtain the distribution relationship between time, frequency, and energy.
The WT, proposed by Morlet [26], can provide a time-frequency window that changes with frequency. The definition of a continuous WT is expressed as where a is a scale factor associated with frequency and b is a displacement factor that describes wavelet movement in the time domain. A mother wavelet generates a function family ψ a,b (t) = 1 √ a ψ t−b a by changing a and b. x(t) is an echo signal that changes persistently and ψ(t) is the mother wavelet that must satisfy the following conditions: In addition, a Fourier transform (FT) Ψ(ω) of wavelet function ψ(t) must satisfy the following conditions: The selection of the wavelet function is essential in the WT, which is related to whether good resolution can be obtained in the time-frequency domain. The frequency of the echo signal received by the sensor is a single one, which means a high temporal resolution is required for time localization of Sensors 2020, 20, 269 5 of 16 this single frequency. The Morlet WT (MWT), which utilizes the Morlet wavelet function, is an ideal option [27], and its analytic formula is where ω 0 is the wavelet central frequency and j an imaginary number unit. Therefore, Equation (1) can be rewritten as where Wx(a, b) 2 is a scalogram of the echo signal that denotes the energy distribution by displacement factor b and scale factor a. The scale factor a is related to the frequency f as expressed by where f S is the sampling frequency. Thus, Equation (5) can be rewritten as according to which the time-frequency relationship of the typical echo signal can be obtained and the time-frequency distribution of the echo signal drawn as in Figure 3.
Sensors 2020, 20, 269 5 of 15 where | ( , )| 2 is a scalogram of the echo signal that denotes the energy distribution by displacement factor and scale factor . The scale factor is related to the frequency as expressed by where is the sampling frequency. Thus, Equation (5) can be rewritten as according to which the time-frequency relationship of the typical echo signal can be obtained and the time-frequency distribution of the echo signal drawn as in Figure 3.   Figure 3, the time window clearly shows that the energy changes significantly with signal frequency when the echo signal arrives. Tests on numerous amounts of noise show the same regularity. Based on this characteristic, sampling points that change with abrupt energy can be found on the echo signal, which can be utilized as a reference to find the precise arrival time of the echo signal.

Accurate Arrival-Time Determination of Echo Signal Based on BIC
The sampling points obtained by the WT in the time window contain the precise arrival time of the echo signal, and the real arrival time needs further precise positioning. As mentioned in the Introduction, the BIC function is applied to the pre-processed result using a certain method that is defined as where is a likelihood function, the order of the model, and the number of sampling points   Figure 3, the time window clearly shows that the energy changes significantly with signal frequency when the echo signal arrives. Tests on numerous amounts of noise show the same regularity. Based on this characteristic, sampling points that change with abrupt energy can be found on the echo signal, which can be utilized as a reference to find the precise arrival time of the echo signal.

Accurate Arrival-Time Determination of Echo Signal Based on BIC
The sampling points obtained by the WT in the time window contain the precise arrival time of the echo signal, and the real arrival time needs further precise positioning. As mentioned in the Introduction, the BIC function is applied to the pre-processed result using a certain method that is defined as where L is a likelihood function, k the order of the model, and n the number of sampling points [28].
To distinguish noise from the echo signal, one ideal method combines the AR model and BIC to obtain accurate sampling points of first wave [28][29][30]. The mth-order AR model is expressed as [30] where: ε t is Gaussian white noise with zero mean, and its variance is σ 2 ; a i is the AR coefficient; and u t denotes the discrete ultrasonic echo signal acquired by an analog-to-digital converter. ε t also obeys the normal distribution, which means that the probability density function of it is [31] ρ The rough sampling point P, which corresponds to the arrival time of the first wave and is obtained by the MWT, is defined as S 2 . Before and after the point P, part of the echo signal is cut out as the time window that contains sampling points, and its length is N. Thus, the starting point of the acquisition window, which is defined as S 1 , is P − 0.5N, and the ending point of the window, which is defined as S 3 , is P + 0.5N. M(1) and M(2) denote the orders of the AR model before and after the P point, respectively.
Therefore, according to Equations (9) and (10) and the definition of the likelihood function [32,33], the likelihood function of all sampling points in the entire time window is where ∆N i is defined as S i − S i−1 , h 1 is P − 0.5N, h 2 is P + 1, x t is the discrete ultrasonic echo signal, and σ i is the variance of the noise corresponding to the AR model of order M(i). The maximum value of Equation (11) is the maximum likelihood estimation of the echo signal [31,33], which is where σ 2 i equals 1 when the derivative of Equation (11) is 0 [31].
Thus, according to Equations (8) and (12), the AR-BIC picker of the echo signal can be obtained as where K is the range through all sampling signal points in the time window. According to references [21,28,31,34], the echo signal received by sensors can be considered as the pure echo signal with added Gaussian white noise, and the noise is uncorrelated with the echo signal. Thus, the where var(x(S 1 , K)) denotes the variance of the corresponding interval from S 1 to K in the time series x(t). When Equation (14) takes minimum values, it determines the arrival time of the echo signal accurately, which is shown in Figure 4. Figure 4a shows the time window containing the precise arrival time of the echo signal and Figure 4b is the corresponding BIC function. The arrival time of the echo signal indicated by the dotted line is 0.124 ms, which is measured by the proposed method, while the actual determined time of the echo signal without noise is 0.125 ms, which is indicated by a vertical straight line. It can be seen from Figure 4a that the noise has a major influence on the echo signal, so that the characteristics of the signal cannot be identified directly. However, the BIC function can effectively identify the original characteristics of the signal from the noise and accurately find the arrival time of the echo signal, as shown in Figure 4b. The result indicates the satisfactory precision of our method. Figure 5 summarizes the proposed method. where ( ( 1 , )) denotes the variance of the corresponding interval from 1 to in the time series ( ). When Equation (14) takes minimum values, it determines the arrival time of the echo signal accurately, which is shown in Figure 4. Figure 4a shows the time window containing the precise arrival time of the echo signal and Figure 4b is the corresponding BIC function. The arrival time of the echo signal indicated by the dotted line is 0.124 ms, which is measured by the proposed method, while the actual determined time of the echo signal without noise is 0.125 ms, which is indicated by a vertical straight line. It can be seen from Figure 4a that the noise has a major influence on the echo signal, so that the characteristics of the signal cannot be identified directly. However, the BIC function can effectively identify the original characteristics of the signal from the noise and accurately find the arrival time of the echo signal, as shown in Figure 4b. The result indicates the satisfactory precision of our method. Figure 5 summarizes the proposed method.

Experimental Platform
To test the proposed method, a three-dimensional ultrasonic anemometer was designed, consisting of a three-dimensional nonorthogonal ultrasonic sensor array, echo signal acquisition circuit, control and computing core, ultrasonic sensor drive circuit, and host computer, which is shown in Figure 6c. The ultrasonic sensor array is composed of three pairs of ultrasonic sensors that emit the ultrasound in sequence and receive it from the corresponding sensors. All sensors are Airmar AT200 type sensors with a working frequency of 200 kHz. As shown in Figure 6a, the experiment was carried out in the Low-Speed Wind Tunnel at the China Aerodynamics Research and Development Center.

Performance under Different Signal-To-Noise Ratios
To test the stability of the proposed method, we designed several actual tests. We fixed the distance of one pair of sensors and measured the standard arrival time of the echo signal in the noiseless environment. Then, 500 tests were carried out under different signal-to-noise ratios (SNRs) to obtain the measured arrival times using the proposed method. For comparison, the Kurz, TKEO, and high-order statistics methods were carried out in the same test environment. Figures 7-9 show the distribution of deviation between measured time T measured and standard time T standard denoted by ∆t = T standard − T measured , which is obtained from the proposed, the Kurz, and the TKEO methods, as well as the high-order statistics method under experimental conditions of 10, 5, and 0 dB, respectively. The abscissa denotes t ∆t, and the ordinate denotes the number of each ∆t in Figures 7-9. circuit, control and computing core, ultrasonic sensor drive circuit, and host computer, which is shown in Figure 6c. The ultrasonic sensor array is composed of three pairs of ultrasonic sensors that emit the ultrasound in sequence and receive it from the corresponding sensors. All sensors are Airmar AT200 type sensors with a working frequency of 200 kHz. As shown in Figure 6a, the experiment was carried out in the Low-Speed Wind Tunnel at the China Aerodynamics Research and Development Center.

Performance under Different Signal-To-Noise Ratios
To test the stability of the proposed method, we designed several actual tests. We fixed the distance of one pair of sensors and measured the standard arrival time of the echo signal in the noiseless environment. Then, 500 tests were carried out under different signal-to-noise ratios (SNRs) to obtain the measured arrival times using the proposed method. For comparison, the Kurz, TKEO, and high-order statistics methods were carried out in the same test environment. Figures 7-9 show the distribution of deviation between measured time Tmeasured and standard time Tstandard denoted by Δt shows great stability as the SNR decreases. In contrast, the distributions of Δt are out of the range of ±15 μs using the Kurz, TKEO, and high-order statistics methods, which means that the measured results acquired from the three methods are more dispersive than those obtained utilizing the proposed method, and are more likely to have a relatively larger error in determining the arrival time of the echo signal.  As shown in Figures 7-9, most of the deviations distribute close to zero and are less than ±5 µs using the proposed method, while the distribution is quite intensive. In addition, the distribution shows great stability as the SNR decreases. In contrast, the distributions of ∆t are out of the range of ±15 µs using the Kurz, TKEO, and high-order statistics methods, which means that the measured results acquired from the three methods are more dispersive than those obtained utilizing the proposed method, and are more likely to have a relatively larger error in determining the arrival time of the echo signal.

Stability and Accuracy Tests of Wind Speed in Wind Tunnel
To test the stability and accuracy of the proposed method in actual wind-speed measurements, three pre-set wind speeds were measured with the above-described ultrasonic anemometer in a wind tunnel. The wind speeds were preset to four separate levels in the wind tunnel: 0, 10, 15, and 20 m/s. Eight tests were carried out at each wind speed, and 150 wind speed data continuously measured in each test. The ambient temperature and relative humidity in the wind tunnel were 16.3 °C and 58%, respectively. The average and standard deviations of a series of wind speeds obtained from each continuous test were calculated, as shown in Figure 10 and Table 1.

Stability and Accuracy Tests of Wind Speed in Wind Tunnel
To test the stability and accuracy of the proposed method in actual wind-speed measurements, three pre-set wind speeds were measured with the above-described ultrasonic anemometer in a wind tunnel. The wind speeds were preset to four separate levels in the wind tunnel: 0, 10, 15, and 20 m/s. Eight tests were carried out at each wind speed, and 150 wind speed data continuously measured in each test. The ambient temperature and relative humidity in the wind tunnel were 16.3 • C and 58%, respectively. The average and standard deviations of a series of wind speeds obtained from each continuous test were calculated, as shown in Figure 10 and Table 1.   Figure 10a shows the experiment without opening the wind tunnel, in which the theoretical wind speed was 0 m/s. According to reference [35], when the wind tunnel is not opened, the measured wind speed within 0.1 m/s can be regarded as being 0 m/s. The results shown in Figure 10a indicate that this method can accurately measure the arrival time of the echo signal and has a strong anti-noise ability for background noise. Figure 10b-d show the results of testing the actual wind speed in the wind tunnel when the pre-set wind speeds were 10, 15, and 20 m/s, respectively. In each wind-speed test, seen from the viewpoints of the average and standard deviation of those experiments, the deviation between the mean value and the wind speed produced by the wind tunnel is within 0.16 m/s, and the standard deviation is within 0.2 m/s, which means that the proposed method has great accuracy and stability.

Discussion of Results of Wind-Speed Tests
It can be found from Figure 10 that the standard deviation of test results increases with increasing wind speed in the wind tunnel. After carefully checking the anemometer, it is found that   Figure 10a shows the experiment without opening the wind tunnel, in which the theoretical wind speed was 0 m/s. According to reference [35], when the wind tunnel is not opened, the measured wind speed within 0.1 m/s can be regarded as being 0 m/s. The results shown in Figure 10a indicate that this method can accurately measure the arrival time of the echo signal and has a strong anti-noise ability for background noise. Figure 10b-d show the results of testing the actual wind speed in the wind tunnel when the pre-set wind speeds were 10, 15, and 20 m/s, respectively. In each wind-speed test, seen from the viewpoints of the average and standard deviation of those experiments, the deviation between the mean value and the wind speed produced by the wind tunnel is within 0.16 m/s, and the standard deviation is within 0.2 m/s, which means that the proposed method has great accuracy and stability.

Discussion of Results of Wind-Speed Tests
It can be found from Figure 10 that the standard deviation of test results increases with increasing wind speed in the wind tunnel. After carefully checking the anemometer, it is found that the bracket carrying the ultrasonic sensors has installation tolerance. With an increasing wind speed, the bracket oscillates to a certain extent, which leads to waveform distortion when the sensor receives the ultrasonic echo signal.
Since the anemometer is a prototype instrument utilized to verify the method, we plan to redesign a new bracket with ultrasonic sensors installed to ensure that this phenomenon will not re-occur.

Conclusions
In this paper, a new method is proposed to determine the precise arrival time of an ultrasonic echo signal. The method is based on the WT and BIC. The time-frequency distribution of echo signals with strong background noise is obtained by the WT, and the time corresponding to the beginning of frequency variation is determined as the rough position of arrival time. Then, based on the rough position, a segment containing sampled points is cut out before and after the rough point as the time window. Finally, the BIC function of the echo signal in the time window is calculated, and the time corresponding to the minimum BIC-function value is determined as the precise arrival time of the ultrasonic echo signal.
To verify the proposed method, we designed an ultrasonic anemometer and tested it in a wind tunnel. To demonstrate the stability and anti-noise ability of the proposed method, the Kurz, TKEO, and high-order statistics methods were compared. After 500 experiments, the distribution of the deviation between the statistical measured value and pre-supposed standard value show that our method is much more accurate in determining the arrival time. Moreover, the actual different wind speeds in the wind tunnel were measured by the proposed method, and the results also verify that the proposed method performs satisfactorily in terms of stability and accuracy.
Author Contributions: W.Z. and Z.L. designed the method in this paper; Z.L. embedded the method in the anemometer; X.G. designed the structure of the anemometer; Y.L. built the hardware platform of the anemometer; and Y.S. revised the paper. All authors have read and agreed to the published version of the manuscript.