The On-Chip D-LMS Filter Design Method of Wireless Sensor Node Based on FPGA

In the real-time position technology of underground shallow source, the signal denoising performance of wireless sensor nodes directly determines the location speed and accuracy of underground burst point. Because of the complexity and randomness of the underground medium and the fact that underground explosion is a nonstationary transient process, the problems of low convergence rate and poor steady-state performance of the filter exist when the existing LMS algorithm is used for signal denoising. In light of the above concerns, this paper comes up with a signal denoising algorithm and hardware implementation method based on D-LMS (delay-LMS). Firstly, according to the autocorrelation function characteristic of random signal, using the principle that the autocorrelation function time delay characteristic of narrowband signal such as explosion vibration signal is better than that of wideband random signal such as ground noise, the D-LMS filter algorithm is constructed by introducing the time delay parameter. Secondly, the selection method of key parameters in D-LMS hardware implementation is analyzed.-irdly, the corresponding hardware circuit is designed by FPGA, and the simulation is carried out. Numerical simulation and experimental verification show that compared with the existing LMS improved algorithm, the D-LMS algorithm proposed in this paper has higher denoising stability and better denoising effect. Compared with the signal postprocessing method based on the host computer, the signal denoising speed of this method is significantly improved. -is method will provide a powerful theoretical method to solve the problem of high-precision and fast source positioning and provide technical support for the development of high-speed and real-time source positioning instruments.


Introduction
Distributed source location in shallow underground spaces is a positioning technique that integrates sensing, networking, transmission, and positioning [1,2]. It works by placing a large number of wireless sensor nodes on the ground, which are tasked with collecting vibration signals generated by explosions [3]. Following the explosion, the wireless transmission network transmits the sensor node data to the control center, where the position of the burst point is determined, as shown in Figure 1.
Quick location of a range of seismic sources is an emerging application, such as in real-time monitoring of underground chamber blasting, rapid location of fuze firing, and rapid prediction of rock burst, water burst, and mud burst [4]. In this context, effort on improving the processing speed of the wireless sensor nodes themselves has become a hot subject in the field of rapid location of underground seismic sources [5].
When a wireless sensor node processes data, a key step in achieving accurate and fast positioning is denoising the vibration signal. Conventional methods for denoising underground seismic signals include wavelet threshold denoising [6], Gabor transform [7], weighted moving average filtering [8], singular value decomposition matrix analysis [9], and HHT [10]. Although these methods improve the signal-to-noise ratio of the vibration signal, they take up a great amount of hardware resource due to their computational complexity, which makes them difficult to implement on wireless sensor nodes and are thus inapplicable. LMS (least mean square) is a typical adaptive filtering algorithm. Despite its low convergence speed, it is simple in structure and involves a small amount of calculation and is easy to implement. Besides, it involves no extra calculation complexity if there are changes in the working environment. erefore, from the perspective of VLSI (very large scale integration) hardware implementation, the LMS algorithm is the best way to complete wireless sensor node on-chip data preprocessing.
Continuing from the LMS algorithm, researchers have changed the principle of selecting the step size to come up with a variety of modified algorithms such as SVS-LMS [11], VS-LMS [12], Witch-LMS [13], Tanh-LMS [14], and Atan-LMS [15]. ese algorithms, by constructing a functional relationship between the step factor and the error signal power, have worked with good results in the field of noise detection and noise cancellation. e underground vibration signal is a nonstationary transient time-varying signal, while the noise signal is a broadband random signal, and hence the error signal power spectrum is time-varying, with the result that when a step factor is used to adjust the filter coefficients, the filter convergence rate decreases, the filter's steady-state performance deteriorates, and the denoising effect worsens.
In view of the above problems, this paper introduces a delay parameter and proposes to build a D-LMS filter algorithm (delay least mean square), which leverages the characteristics of the autocorrelation function of the random signal; in terms of the time delay of the autocorrelation function, narrowband signals, such as the explosive vibration signal, are better than broadband random signals, such as the ground noise [16,17]. By means of simulation, the denoising performance of D-LMS and existing LMS improved filter is compared in this paper, which also discusses about the key filter parameters for engineering implementations. A field experiment was performed to verify the performance of the proposed filter. e result suggests that the proposed filter circuit improves greatly the SNR of the input signal and accelerates the location process. is method adds some engineering value to the field of underground space applications [18][19][20].

Principle of D-LMS Adaptive Filters
According to the underground explosion fluctuation theory and the characteristics of the autocorrelation function of random signals, of which the ground noise is a type, the autocorrelation function of the ground noise attenuates fast, while narrowband random signals, such as explosion vibration signals, have an autocorrelation function that attenuates slow [21].
at means that the explosion vibration signal has a wider autocorrelation function than the ground noise. erefore, with an appropriate delay length, the noise signal will no longer be correlated with the original signal, but the useful signal still keeps a good correlation with it [22,23], as shown in Figure 2. Autocorrelation operation is performed on Part A and Part B, the former containing only noise signal while the latter containing both noise and useful signal. e result of the operation is shown in Figure 2.
It can be seen from Figures 2(b) and 2(c) that the autocorrelation of the noise signal in Part B decreases rapidly as the length Δ of the time delay changes, while the autocorrelation of the useful signal in Part A remains at a high level. erefore, it is possible to extract the effective signal in the explosive vibration signal by introducing the time delay parameter and taking advantage of the autocorrelation characteristics of the signal. e specific structure of the proposed D-LMS (delay least mean square) is shown in Figure 3.
Let the signal collected by a wireless sensor node be x(n) � s(n) + N(n), where s(n) is the explosion vibration signal and N(n) is the environmental noise. x(n) is the expected signal, w(n) is the adaptive filter coefficient, d(n) is the filter input signal, y(n) is the filter output signal, e(n) is the error signal, μ is the step factor, and Δ is the delay amount. e D-LMS filter expression is as follows: e explosion vibration signal s(n) has an autocorrelation function with a longer attenuation characteristic than the environmental noise N(n) [24]. erefore, if an appropriate delay time Δ is chosen, the signals N(n) and N(n − Δ) are no longer correlated, while s(n) and s(n − Δ) are still correlated to a good degree. So, the adaptive filter's output y(n) is the best estimate of s(n).    Shock and Vibration LMS filters, a study was made that used explosion shock waves generated by artificial simulation. e signal sampling rate was set at 10 kHz, and the sampling time was set to 10 s. e useful explosive signal was a damped stretched sine wavelet. e setting frequency was 150 Hz, the arrival time of first break was at 1 s, the attenuation factor was e − i/160 (i � 0, 1,. . ., n), the noise source was white Gaussian noise, and the initial SNR was −5 dB. e D-LMS filter delay points were set to be 10, and the filter order was set to be 12. Five modified LMS algorithms, namely, SVS-LMS, VS-LMS, Witch-LMS, Tanh-LMS, and Atan-LMS, were used to filter adaptively the explosive vibration signals 1200 times. e resulting error convergence curves are shown in Figure 4.

Simulation Verification
As can be seen from Figure 4, during 1200 iterations, the convergence speed and convergence accuracy of the D-LMS algorithm are significantly better than other algorithms.

Choice of Key Parameters in Hardware Implementation of D-LMS.
As can be seen from the previous section, among the modified LMS algorithms, the D-LMS algorithm gives the best filtering effect when dealing with explosion vibration signals. In the hardware implementation of the D-LMS filter, the choice of the length of time delay Δ, the filter order N, and the step factor μ is critical to the performance of the filter.

Length of Time Delay Δ.
e length of time delay Δ is a key parameter of the D-LMS algorithm to bring about good filtering [25,26]. Due to the high explosion intensity, the SNRs of the explosion vibration signals collected by the wireless sensor nodes were all greater than 0 dB. erefore, the emphasis was on the choice of the length of time delay under SNR � 0 dB condition. e signal sampling rate was set at 10 kHz, and the sampling time was set to 10 s. e useful explosive signal was a damped stretched sine wavelet. e setting frequency was 150 Hz, and the arrival time of first break was at 1 s. e noise source was white Gaussian noise, with an SNR of 0 dB. e underground explosion data containing the useful signal and also the data containing only the noise were extracted; autocorrelation was performed on them, respectively. e values thus found were normalized, which are shown in Figure 5(a). e results of the correlation computation are shown in Figure 5 It can be seen from the Figure 5(b) that at a sampling rate of 10 kHz, when the time delay Δ is greater than 6, the correlation coefficient between noises N(n) and N(n − Δ) is less than 0.2, while that between the useful signals S(n) and S(n − Δ) is greater than 0.9. erefore, the delay points were set to 6.

Filter Order N.
e filter order N determines the complexity of the design of the circuit. With too small an N, the filtering error will be great and the filter just will not serve its filtering purpose or even result in unconvergence of the LMS algorithm. Too great an N, on the other hand, will increase the computational complexity and thus take up more hardware computing resources [27,28]. e explosion seismic signal was simulated by a damped stretched sine wavelet, to which a noise with an SNR of 0 dB was added. With the step factor μ kept constant, the filter order N was changed in the process of simulation; the simulation results are shown in Figures 6(a)-6(c).
With the step factor kept constant, the filtering performance improves gradually as the filter order N increases. When the filter order is greater than 12, the filtering effect stabilizes, and the SNR is greater than 30 dB. For subsequent positioning, when the SNR is greater than 30 dB, subsequent data processing requirements can be satisfied. To strike a balance between the filtering effect and the hardware implementation difficulty, this paper settles on an order N � 12.

Step Factor μ.
e size of the step factor μ affects the convergence speed and steady-state error of the LMS algorithm [29]. A small step size gives a smaller steady-state error and a slower convergence rate; with a large step size, the convergence rate is faster, but the steady-state error becomes larger too [30].
Below is a filtering test of the measured signal, with the filter order being kept constant at N � 12 and the step factor μ being varied. e simulation results in Figure 7(a) show that with too small a μ value, the convergence rate is slow, and the tracking performance of the filter coefficient is poor at the first break of the vibration, resulting in blurred jump point of the first break signal. In Figure 7(c), where the μ value is too large, the convergence rate becomes fast, but the filtering effect deteriorates. For adaptive filtering of transient vibration signals, it is necessary to prioritize the convergence rate, and after that, the filtering effect should be then improved. To cater to both needs, the choice falls on a μ � 1/2.

General Hardware Design of FPGA-Based Wireless Sensor
Nodes. e specific design diagram of the system is shown in Figure 8. is system incorporates ARM + FPGA architecture in its design of the wireless sensor nodes, and its D-LMS filter is implemented in an FPGA. e FPGA is responsible for explosion vibration signal collection, data filtering, and data storage; the ARM works as the control core, transferring the data collected by the FPGA to the WIFI module. e indicators of key devices are shown in Table 1.
In this study, the node control system was based on the FPGA + ARM architecture, whose core circuit board is shown in Figure 9. Major indices were as follows: (1) data storage capacity: 16 GB (expandable); (2) wireless transmission rate: 6.4 Mbps; (3) Beidou clock synchronization accuracy: 20 ns; (4) the system was powered by a 12 V/ 20000 mAh lithium battery; when the system was in the standby mode, the power consumption was 0.15 W, and when the system was in the working mode, the power consumption was 0.8 W

Deciding the Length of the LMS Filter System Coefficient w(n).
In digital signal processing systems, especially those that include feedback, the extra word length arising from multiplication can be truncated or limited by quantifying the results [31]. e DSP multiplier core integrated in the Xilinx series of FPGA is generally a 18 bit × 18 bit multiplier. erefore, for the ease of engineering implementation, the design should be ideally implemented based on a maximum of 18-bit fixed-point number system [32].
e input data are treated as 12-bit integer data, expressed as {1 sign bit + 2 integer bits + 9 decimal digits}, or as ×(3, 9) for short. e weight coefficient is regarded as 18bit integer data, expressed as {1 sign bit + 2 integer bits + 15 decimal places}, or w (3, 15) for short. A large amount of addition and multiplication is involved in the filtering calculation process [33]. With a fixed finite word length, if two fixed-point numbers of N bits each are added, the result is of N + 1 bit; if they are multiplied with each other, the result is of 2N digits. Hence, y (6, 24) � w (3, 15) × (3, 9).

Actual Hardware Design of the LMS Filter.
is system, following the top-down design principle, included a D-LMS filter consisting of 4 circuit modules, including a data latch module, a data filtering module, an error calculation module, and a coefficient update module. e data latch module was used to latch the input data and perform time delay operation on the data; the data filtering module worked to perform 12-order filtering operation on the data; the error calculation module was used to output the filtered result and estimate the error; the coefficient update module had a function of computing the filter coefficient. e external input signals of this circuit included data clock (clk_din), system clock (clk), input data (din [11 : 0]), and data enable terminal (dn-en). e output signal of this circuit was (yout [11 : 0]). e data clock (clk_din) was synchronized with the data input (din), and the system clock (clk) was used to drive each module to work orderly. e top-level circuit of the system is shown in Figure 10. Each module begins to work the moment its input port "start" receives the pulse signal. e work of a module is completed when it outputs endM pulse signal. e endM of the previous module is connected to the "start" input of the latter module to complete serial timing control.
For the convenience of describing each of the modules, the actual process of the time sequence design in the implementation of the 12-order LMS filter is given below: Step 1: the filter module inputs data: Step 2: filtering of calculation:   Shock and Vibration 5 Step 4: error calculation: e � din − yout Step 5: weight update step calculation: dw i � 2μx i × e Step 6: update weight: w i � w i−1 + dw i (a) e M_XnDnWn module is intended to latch the data input and the filter coefficient, as well as complete the operations of Steps 1 and 6. e module relies on the system clock (clk) to detect the rising jump edge of the data clock (clk_din). When the rising jump edge of the data clock (clk_din) is detected, the new data din are considered to be coming, and the input data latching and the shift operation begin. e data input "din," after a delay of 6 data cycles (d 1 ∼ d 6 ), enters the shift latch x 0 ∼ x 11 , and x 0 ∼ x 11 is taken as the input vector of the filter. At the end of the shift operation, the output

Shock and Vibration
x 0 ∼ x 11 , w 0 ∼ w 11 (w 0 ∼ w 11 is the filter weight vector) is maintained, and the output pulse signal endM notifies the M_filter module to start working. e integrated circuit of this module is shown in Figure 11. (b) e data filtering module completes Step 2. When the module's input "start" receives the pulse, it multiplies the corresponding input data x i by w i , with the product sent to the corresponding port dy i . In this step, 12 12 bit * 18 bit multipliers are used, and the filter calculation is completed in parallel by the multiplier group. e integrated circuit of this part is shown in Figure 12.      Shock and Vibration 9 shift operation is performed according to the step factor, and the above calculation result is converted into a filter coefficient. e integrated circuit of this part is shown in Figure 14. (e) Resource utilization: the above circuit modules were then synthesized, and the total resource utilization on the FPGA is shown in Table 2.

Simulation Verification. MATLAB and VIVADO
(2017.4 version) were used in a joint simulation to verify the function. e stimulus test file was written using the MATLAB software. e explosion seismic signal was a damped stretched sine wavelet, to which a noise with an SNR of 0 dB was added. e sampling rate was set to 10 kHz. e above signal was quantized as the input data of the system. e filter order was set to 12, and the step factor was set to 1/2. e above data were loaded into VIVADO software; the output result is shown in Figure 15.
e simulation result shows that the signal output from the filter, compared with the input signal, obviously has a higher SNR. It can be seen that the hardware filter designed in this study is capable of effective signal denoising.

Field Experiment
To test the signal denoising performance of this system, a wireless sensor network was constructed, consisting of 8 selfdeveloped sets of wireless sensor nodes, APs, and bridges. e test site, which was 20 km away from the control master station, was loaded with 5 kg TNT to create an artificial vibration source. Following the quake, two solutions-terminal data postprocessing and on-chip real-time processing-were used, respectively, to assess the performance and speed of data preprocessing. e test site layout is shown in Figure 16. e dots in the figure represent sensors, and * represents the burst point. e devices were positioned, and each seismic measuring point and the preset explosion point were calibrated for their location with the aid of the high-precision Beidou. e data are given in Tables 3 and 4. e test site is shown in Figure 17. e number of acquisition channels of a wireless sensor node was set to be 8, sampling rate was set to 10 kHz, and sampling time was set to 2.5 s. e wireless transmission rate was 6.4 Mbps. e original vibration signal collected by wireless sensor node 1 in the experiment is shown in Figure 18(a). e signal after on-chip preprocessing is shown in Figure 18(b). On the upper computer, the original signal was processed with the MATLAB software and the D-LMS filter algorithm, with the result shown in Figure 18(c). e signal processing results under 2 modes were found by calculation, as shown in Table 5. Number of wireless sensor nodes: 16; number of internal sampling channels of a wireless sensor node: 8; sampling rate: 10 kHz; sampling time: 2.5 s; and quantization bit number: 12 bit, stored in 16 bit. erefore, the total data storage capacity of the wireless sensor network was 6.4 MB. e wireless transmission rate was set at 6.4 Mbps, and it took 10 s to transmit all of the data. e upper computer did not begin to process the data until receiving all of the data. erefore, upper computer processing lagged at least 10 s behind on-chip processing.
As can be seen from the table, due to the time spent on manual software operation, the PC software preprocesses the data much slower than the on-chip real-time solution.
ough the filtering effect of the on-chip real-time solution fell slightly behind the PC software, it gave an SNR that was still above 30 dB. Given the extraction principle of the first break arrival time-an important positioning parameter, when the SNR is greater than 28 dB, the first break arrival time can be extracted practically with no inferior accuracy [34]. erefore, the proposed on-chip preprocessing method is able to achieve the same effect as can be achieved on upper computer software. More importantly, this method cuts the signal processing time of an individual sensor node by nearly 10 s, which is a great merit in real-time source location.

Conclusions
is paper proposes a signal denoising algorithm based on D-LMS as well as an FPGA hardware design method to cater to the needs of rapid and high-precision location of underground sources. First, the proposed D-LMS and the existing modified LMS were compared through simulation for their denoising effect. en, analysis was provided on how to determine the length of time delay, the filter order, and the step factor-all critical parameters in implementing the D-LMS hardware. e circuit modules were designed using an FPGA for the data latch, filter, error calculation, and weight updating modules. A field experiment was also carried out. e results demonstrate that the designed filter circuit is capable of greatly improving the data processing speed of explosion vibration signals. Compared with postprocessing methods based on an upper computer, the proposed method shortens the data processing time by 30 s.
is method is of some engineering application value in the field of underground source positioning.

Data Availability
e field experiment data used to support the findings of this study have not been made available because the internal data are updated in real time and cannot be directly saved.

Conflicts of Interest
e authors declare that they have no conflicts of interest.