Audio Signal and Troubleshooting System Based on Wireless Sensor

— To explore the application of audio signal in the troubleshooting system, a sound detection system was designed. The system consists of three parts: voice acquisition node, aggregation node and host computer monitoring software. Time protocol synchronization (TPSN) algorithm was used to realize the synchronization between nodes. The algorithm and the trilateration method were applied to the system. The applications of the sound detection system in the field of fault sound source localization were realized. Wireless sensor networks were used in sound detection systems, which had many advantages. On the one hand, complicated wiring was avoided. It had the advantages of easy to set up and easy to move. On the other hand, some self-organizing and adaptive features in wireless sensor networks and some methods of synchronization and localization could be introduced. The whole system was more flexible and its application was more extensive. Using monitoring software, users can remotely access to the scene of the voice signal. The results showed that the system had high transmission rate, stable operation and small positioning error. Therefore, it has good application prospects.


Introduction
As the most basic means of communication in people's life, sound signals are widely used in many fields. The amount of information is large and the location is scattered, which brings some difficulties to the detection and transmission. Compared with the wired sound detection system, the sound detection system based on wireless sensor network has many advantages. On the one hand, it can avoid miscellaneous wiring. On the other hand, the adaptive characteristics of the wireless sensor network and some methods of positioning can be introduced. The whole system is more flexible. It has a wider range of applications. Using the remote monitoring software, the user can get the sound signal on the spot.
The node is placed in an unmanned area, which can be used for anti-theft. Once someone enters the area, the sensor node detects the sound of the target and sends the alarm signal to the monitoring center. The purpose of monitoring and guarding against theft is achieved. The sound acquisition system can also be extended to many fields. Taking sound source positioning as an example, signals are received by sound sensors and some electronic devices are used. The conversion of the received signal is realized, and the location of the sound source is determined. In video conference, by using the location technology of sound source, and according to the number of data reported by each sensor node, the location of the speaker is calculated. Then, the camera automatically adjusts the angle to the direction of pronunciation. In military, according to the data of the sensor nodes scattered in the battlefield, the location of the artillery can be locked by the sound source positioning technique. Compared with the infrared, koontat and laser detection technology, sound source localization technology has been widely concerned. It has the advantages of low cost, all-weather, and undetectable. In addition, voice detection system based on wireless sensor network can also be extended to fault diagnosis of machinery and equipment, noise monitoring in factory workshop and so on. It has a very wide range of application prospects.

2
State of the art The sound detection system combined by wireless sensor networks is a research branch of wireless sensor networks. One of its typical applications is sound source positioning. This system involves many technologies, including sensor node (acquisition node) hardware design, wireless communication technology, time synchronization protocol, sound source localization algorithm, signal acquisition and processing technology.
Azharuddin and Jana [1] believed that energy conservation and fault tolerance are the most two important challenging issues for the development of large scale wireless sensor networks (WSNs). They presented a distributed energy efficient and fault tolerant routing algorithm for WSNs and tested it extensively by considering several scenarios of WSN. They also compared the experimental results with the existing algorithms in terms of several metrics to show the effectiveness of the proposed algorithm. Ahmed [2] studied the quality of service (QoS) for location based and corona based real-time routing protocol in mobile wireless sensor network (MWSN) and implemented a comparison study in real test bed and simulation experiments. Kariman-Khorasani and Pourmina [3] investigated the problem of maximum lifetime routing in asynchronous duty-cycled wireless sensor networks. In addition, they applied wireless sensor networks in dealing with sound signal detection and fault removal. Nordio, A. et al. [4] proposed a scheme for optimally selecting k out of K sensor nodes on the basis of the amount of information they convey to a common receiver/actuator and discussed the selection strategies for wireless sensor network to make the sound signal fault removed.
There were also some other studies on wireless sensor networks. Nevat, I. et al. [5] developed new algorithms for spatial field reconstruction, exceedance level estimation and classification in heterogeneous (mixed analog & digital sensors) Wireless Sensor Networks (WSNs), which provided the basis for exploring the application of wireless sensor networks. Platachaves, J. et al. [6] studied a distributed node-specific parameter estimation problem where each node in a wireless sensor network is inter-ested in the simultaneous estimation of different vectors of parameters that can be of local interest, of common interest to a subset of nodes, or of global interest to the whole network. Schlupkothen, S. et al. [7] focused on the range-based localization and tracking problem for very large dynamic, i.e., moving sensor networks, which enabled us have a clearer understanding of the application field of wireless sensor networks. Solares, J. et al. [8] mainly discussed the performance of wireless sensor networks and present the advantages of wireless sensor networks to prove that it can be applied in processing sound signal fault. Ye and other scholars [9] proposed a numerical functional extreme (NFE) model for the solving minimum exposure path (MEP) problem of wireless sensor networks and at last the model dealt with the problem efficiently. Zhou and others [10] focused on the (error propagation) EP issues for the received signal strength-based SLAT scheme, where the measurement accuracy is assumed to be spatial-temporal-domain doubly random due to the target mobility, environment dynamics, and different surroundings at different reference nodes.
To sum up, the application of wireless sensor network in different fields, such as sound signal and troubleshooting, is explored, but the efficiency of troubleshooting is not high. In order to well solve the troubleshooting problem, a sound detection system is designed, including voice acquisition node, aggregation node and host computer monitoring software. The applications of the sound detection system in the field of fault sound source localization are realized and wireless sensor networks are used in sound detection systems. The method overcomes the low efficiency of troubleshooting, and it has the advantages of efficiently avoiding complicated wiring, high transmission rate, stable operation and small positioning error.

3.1
The overall structure of the system Sound detection system based on wireless sensor network consists of sound acquisition node, convergence node and host computer monitoring software. In the system, two sound collection nodes are currently designed. They enable the capture and storage of sound signals. According to the scheduling instructions of the sink node, the data is wirelessly transmitted to the sink node. The aggregation node is the dispatch center of the whole system. According to the instruction given by the host computer monitoring software, the scheduling of the two booting nodes is completed. The sound data transmitted by the booting node is received. These data are transmitted to the host computer via the Ethernet interface.
The monitoring software of the upper computer is the core of the whole sound detection system. It is also an interface to interact with the user. According to the wishes of the user, the corresponding instructions are sent to the converging node. According to the received data, it can be drawn and saved. The overall structure is shown in Figure 1.

Sound acquisition node 1
Sound acquisition node 2 Convergence node PC monitoring software

Selection of time synchronization algorithm
When the system works normally, once the sink node receives the synchronous acquisition instructions issued by the host computer, it will synchronize with the two voice acquisition nodes. There are many algorithms for time synchronization in the existing wireless sensor networks. These algorithms need to be studied and compared.
According to the time beacon recording method used in time synchronization, the time synchronization algorithm can be divided into three categories: receiver-receiver mode, client-server mode and sender-receiver mode. Receiver-receiver mode synchronization algorithm is characterized by only the receiver needs to record the reception time. The classic algorithm for this mode is RBS (Reference Broadcast Synchronization). Both the sender and receiver of the class-client-server pattern synchronization algorithm need to record time beacons. The number of communications is generally more than once. Its representative is TPSN (Timing-sync Protocol for Sensor Networks). In sender-receiver mode, the sender will only record the sending time. The receiver will only remember the reception time. The entire synchronization process is only one communication. Typical representatives are FTSP (Flooding Time Synchronization Protocol).
The algorithm is compared and weighed in terms of energy consumption, accuracy and algorithm complexity. The final TPSN time synchronization algorithm is applied to the system to complete the time synchronization between the nodes so as to realize the synchronous acquisition of the sound signals by the two sound collection nodes.
The TPSN inter-synchronization protocol can be divided into two phases: the hierarchical phase and the time synchronization phase. The central idea of the algorithm is to divide the network first. Then, each node must interact with a node in the next level to complete the synchronization. Finally, all nodes synchronize their time to the root node. The specific implementation of the algorithm is as follows.
Hierarchical stage: Hierarchy is initiated by the root node. The root node broadcasts its own unique identification number (ID number) and level N (root node N = 0) in the wireless sensor network. All nodes that receive this message will record their own layer as N + 1 (that is, 1), and continue to broadcast their ID number and level. After the node repeat this operation, until all nodes have recorded their own level. In this process, once each node has confirmed its own hierarchy, it will not ignore the broadcasts sent by other nodes.
Time synchronization phase: After the layering stage is completed, the system enters the time synchronization stage and the root node starts to send the synchronization message. When each layer 1 node receives this message, it establishes communication with the root node at a random time and sends a synchronization request. It starts synchronizing with the root node. The second node listens to this process and then synchronizes with the layer 1 node. And so on, eventually, they are synchronized across the network.
The N+l layer node C initiates the synchronization request information. This information will carry the local transmission time Ti. The N layer node S receives the request information, records the local time T2, and carries the local transmission time of the Ti, T2 and response information T3. The node C receives this information, records the receiving time T4, so that the node C can calculate the time deviation of the S equal to [(T2-Ti) -(T4-T3)]/2. The node C then synchronizes time to S according to this time deviation. The synchronization process of the nodes of two adjacent levels is shown in Figure 2. At present, only one aggregation node and two acquisition nodes are involved in the system. The aggregation node is the root node, and the two acquisition nodes are all nodes of the level 1. After the aggregation node is powered on, it first enters the waiting state and waits for the synchronization instruction 0x00 of the host computer monitoring software. Once the sink node receives this command, it will hit the timer, start counting, forward the synchronization message, and then enter the receiving state. After receiving the synchronization command, the acquisition node also opens its own timer and counts. The acquisition node 1 sends a synchronization request to the aggregation node. This request carries the information sending time T1. The aggregation node receives this request, notes the reception time T2, and respond to the response message. The sending time is T3. The acquisition node 1 receives the response information, records the receiving time T4, and then applies the formula. The time deviation is calculated to be [(T2-T1) -(T4-T3)]/2. Finally, the time is synchronized to the root node. The acquisition node 2 repeats the 1 process, and also completes the synchronization. The whole synchronization process takes about dozens of milliseconds.
After the synchronization is completed, the aggregation node closes its own timer and reports the state of each node to the upper computer, and then goes back to the waiting state again. When the timer counts to 100 milliseconds, the two acquisition nodes will turn off the timer used in synchronization, open the timer used for acquisition, and start the synchronous acquisition of 10 seconds with the sampling frequency of 8kHz. The flow chart of the synchronization process is shown in Figure 3.
The sink node waits to receive the host computer's instruction The sink node receives the host computer instruction

Judge instructions
The sink node sends synchronization information Convergence node into the receiving state The sink node receives the synchronization request The sink node replies with the reply message Collecting nodes calculates time deviations and synchronizes the time to the sink node The sink node and the second acquisition node complete the synchronization Convergence nodes like the host computer to send status frames, acquisition nodes for synchronous acquisition OXOO

Hardware design of sound acquisition node
The acquisition and wireless transmission of sound signals is the main function of the sound acquisition node. It includes four modules: power supply, sound acquisition, processor and wireless communication. The overall structure of the sound acquisition node is shown in Figure 4. As shown in Figure 4, the power supply module is responsible for power supply to the other three modules. The sound sensor in the sound acquisition module can detect the sound signal. It can convert the sound signal into an electrical signal and then be amplified and filtered. Finally, the A/D acquisition channel is connected to the processor. The processor converts the analog / number of the signal and stores the collected data into the expanded memory. According to the scheduling of the aggregation node, the processor will send out the data through the RF (radio frequency) module. The whole node uses JTAG to connect the door to download and debug the program. The serial port is used to print some program running status.

Application of fault source positioning
The application of sound detection system in the field of sound source location needs to solve the following two problems: the detection of sound signal and the time synchronization between the nodes. For most of the location algorithms, it is neces-sary to measure the distance at first. Many algorithms are based on the propagation time of the sound to get the distance of the sound. When the sound signal is transmitted to the beacon node, the sound signal is detected well and the arrival time of the sound is recorded. Precise time synchronization between nodes can be used as a reference for subsequent parameter measurement. For the sound detection system, the sound acquisition module and the transplanted TPSN time synchronization algorithm have solved this key problem well.
In order to verify the application prospect of the system in the direction of sound source positioning, it is also a key point to select the appropriate location algorithm. The comparison and application analysis of the location algorithm will be introduced in the following.
At present, most of the location algorithms in wireless sensor networks include two steps. The first is the measurement of the distance (or angle), and then the location is calculated using these measurements. The methods of measuring distance (or angle) include RSSI, AOA, TOA, and TDOA. The main methods of location calculation are trilateration survey, triangulation and maximum likelihood estimate. Through the comparison of these location algorithms, it is concluded that in the four distance (or angle) measurement methods, the received signal strength indication (RSSI) algorithm is greatly influenced by environment and other factors, and the location accuracy is relatively low. The signal arrival angle (AOA) algorithm is higher in hardware cost, maintenance cost and power consumption. It has a great load on the processor. The basic idea of the signal arrival time (TOA) and the signal arrival time difference (TDOA) algorithm are similar. The precision of the positioning is high. In the three location calculation methods, the triangulation method is used with the AOA algorithm. The maximum likelihood estimation method is obviously higher than the trilateration survey.
In the voice detection system, the time TOA algorithm and the trilateration survey need to adjust the program of the host computer monitoring software, the gathering node and the voice acquisition node. There is not much change in the communication instruction between the parts. Only the data returned by the sound acquisition node is no longer the sound signal collected, but the arrival time of the sound signal. The specific software design flow chart is shown in Figure 5. http://www.i-joe.org After the initialization is completed, the host computer software enters the state of "waiting for the user to operate". Only when the "Simultaneous Acquisition" button on the software interface is pressed, the host software will exit the waiting state and send the synchronization command in the form of UDP message. This command is still "0x00".
When the sink node receives this command, it will perform TPSN time synchronization with the two sound collection nodes. When the synchronization process is completed, it reports itself and the status of the two acquisition nodes. This status is sent to the host computer through UDP packets. The first 3 bytes of the packet are valid. If all three nodes are connected properly, all three bytes are "0x37". According to the received status message, the PC software will display the status of several nodes on the interface. Under normal circumstances, the status of all three nodes should be displayed as Connected.
After the sink node sends the status message, the two sound collection nodes automatically enter the signal acquisition status. The time synchronization is completed. The synchronization process generally takes tens of milliseconds. Therefore, when the system is designed, after 100 milliseconds, the sink node will control the buzzer connected to I / O port to emit a sound signal.
Once the amplitude of the sound signal collected by each node is greater than the set threshold, the time of arrival of the signal and the arrival time of the signal are recorded.
After receiving the status message, the host software enters the state of "waiting for user operation". If the user presses the "synchronous acquisition" button, the host software will resend the synchronization command to schedule the convergence node to synchronize and sound.
If the user presses the "Get Time" button, the PC software will issue the instruction "OxOA". After receiving this instruction, the sink node sends "0x01" and "0x02" to the sink node 1 and the sink node 2, respectively. Two nodes record the signal arrival time. The aggregation node will summarize this time and send it to the host computer in the form of UDP packets. The first 6 bytes of this message are valid. Every 2 bytes is a unit. They represent the signal arrival time recorded by the sink node, the sound collection node 1, and the sound collection node 2, respectively.
PC software receives the time message for analysis. According to the agreement, three-time information is removed. Each arrival time minus 100 milliseconds, it is multiplied by the propagation speed of the acoustic signal to calculate the distance from the sound source point to each node. The formula of the trilateration survey is applied to get the data of the three intersection points. The center of gravity of the triangle is chosen to get the final coordinate of the sound source point. It is displayed on the host computer interface.
Then, the host computer software is "waiting for user operation" status. According to the user's keys, the operation described above is performed. Until the "Exit" button is pressed, the operation of the host computer program is ended and the interface is closed.

Result Analysis and Discussion
In the sound source localization experiment, the sound source is a buzzer controlled by the I/O port of the converging node. The buzzer is silent / sound based on the high / low level of the output of the I/O port. In the test, three beacon nodes are arranged in coordinates (0, 50), (-70, 0), and (70, 0) in the plane right angle coordinate system. The source point is placed in a position of (0, 20) (the units of all coordinates are centimeters). A total of five tests were carried out. The experimental data of the test are shown in Table 1. The average value of the measured source point coordinates is as follows:  (1) The maximum error between the transverse and the actual coordinates measured by the source point is 11.7901. The average error is 4.8370. The maximum error between the measured and the actual coordinates is 14.1167. The average error is 7.6614. The reasons for the error are the environmental factors, the reflection and diffraction of the sound signals in the room. The time synchronization has error, which leads to the error of the sound signal propagation time calculated by each node. In the measurement of sound source positioning, the signal waveform of the test sound source and the experimental data of the positioning test are given. The error of the location of the data display system is small.

Conclusions
Aiming at exploring the application of audio signal in the troubleshooting system, the sound detection system based on wireless sensor networks was designed. The design framework of sound detection system was put forward. The existing time synchronization algorithms in wireless sensor networks were analyzed. The synchronization method of TPSN was selected. The synchronous acquisition of sound signals was realized in the system and the hardware design of the sound detection system was introduced in detail. The application of sound detection system in the field of sound source localization was explored and the existing location algorithm was studied. The TOA and trilateration survey were also applied to the simple reformed system. Finally, the positioning test was carried out and the application of the sound detection system was tested. And the following results were obtained: Firstly, after the sound detection system was introduced in detail, it was proved that the positioning error of the system is small.
Secondly, wireless sensor networks have the prospect of application in the field of sound source positioning.
At last, the error of the location of sound source in the data display system is small.