University: Military Institute of Engineering (IME)
Team Members (with year of graduation): Paulo César Prandel (2012), Izabela Lyon Freire (2014)
Faculty Advisers: José Antonio Apolinário Jr., D.Sc.
Email Address: pauloprandel@hotmail.com, izabela.lyon.freire@gmail.com, apolin@ime.eb.br
Submission Language: English
Title:
Real-time detection and source location of impulsive audio signals.
Description:
A system for real-time detection and estimation of the Direction of Arrival (DoA) of impulsive audio signals, specifically the signals of gunshots.
Products:
NI cRIO-9022, embedded real-time controller;
NI cRIO-9112, eight-slot, reconfigurable embedded chassis with FPGA core;
Two NI 9234, dynamic signal acquisition module;
NI LabVIEW 2012;
LabVIEW 2012 Real Time Module;
LabVIEW 2012 FPGA Module.
The Challenge
To implement a system for real-time detection and source location of impulsive audio signals, more specifically of gunshot signals.
The Solution
To use National Instruments hardware and software for real-time acquisition and processing of audio signals from an array of seven microphones, providing a graphical interface system to end user.
Introduction
We present in the following a system for real-time detection and estimation of the Direction of Arrival (DoA) of impulsive audio signals, specifically the signals of gunshots. The NI hardware and a 3-dimensional array of seven microphones were used for the acquisition and real-time processing of the signals. Once detected the event (impulsive signal), its DoA is estimated using the Generalized Cross Correlation (GCC) with Phase Transform weights (PHAT) to measure the Time Difference of Arrival (TDoA) between pairs of microphones. Parameterized predictions of TDoA's are compared to actually measured TDoA's such that the parameter can be obtained via Least-Squares minimization. Using real-time techniques, there is no loss of information from the environment for the processes of signal detection and DoA estimation occur in parallel. This work is an initial step towards a larger system aiming at locating snipers.
The spatial array consists of seven microphones. The sounds are collected by the array of microphones and conditioned by a PreSonus FIREPOD, which works like a pre-amplifier and also provides the phantom power to the microphones, preparing signals to be sampled by the acquisition modules of cRIO. Azimuth and elevation angles define the direction of arrival of the wave generated by the signal source. The hardware and the array of microphones are shown in Figure 1.
Figure 1 - DoA system with the array of seven microphones.
Azimuth and elevation angles define the direction of arrival of the soundwave .
Description of the system designed in LabVIEW
The signals from all microphones enter the acquisition modules of cRIO, and are digitized simoutaniously at a rate of 51.2 kHz. After sampled, the data is queued by the FPGA, which is physically connected to the acquisition modules. This type of queuing used is first in - first out (FIFO). The data from the FIFO buffer is transmitted by the FPGA bus to the controller via direct memory access (DMA). Once at the controller, the data from one microphone (the upright one) is handled by a routine that runs a detection algorithm in a deterministic loop, which has a known execution time that is maintained at each iteration, as is characteristic of real time systems. This execution time is fast enough to avoid the overflow from the FIFO and consequent loss of data, which could cause failure in detecting an impulsive signal.
Once an impulsive signal is detected, the signals from all seven microphones are queued in a new FIFO, which will be transferred to another loop; this non-deterministic loop processes the signal through the DoA estimation algorithm implemented in the controller. This second loop has no constrained time of execution, performing its tasks as the deterministic loop (priority) releases the processing resources. This does not affect the detection of consecutive signals, as they are stored in the FIFO between the two loops. The overall system is described in Figure 2, the non-deterministic loop in Figure 3, and the DoA estimation VI in Figure 4.
Figure 2 - Flowchart showing the operation of the system. The signals are concateneted by the FPGA VI and transmited to the deterministic loop by direct memory access (DMA).
Once detected, the signals are processed by the non-deterministic loop.
Figure 3 - Non-deterministic loop of the controller VI. The signals are transmitted from the deterministic loop
by a real-time FIFO. This loop is executed only if a shot is detected.
Figure 4 - Direction of arrival (DoA) VI. This VI processes the algorithm for DoA estimation.
Both algorithms, impulsive signal detection and estimation of direction of arrival (DoA), are found in the technical literature and are not described herein for we focus on implementation details. These algorithms are implemented using functions (subVIs) of the system as a whole.
The results of the DoA estimation algorithm (azimuth and elevation of the incident soundwave) are transmitted through variables to a notebook via an Ethernet connection, the results being shown on the screen in a user-friendly interface (Figure 5), which also allows debugging of possible runtime errors. It is noteworthy that all the processing is carried out in the real-time hardware (cRIO), the notebook being used only as an interface. To make the system more compact, the interface could be performed directly by the cRIO through LED indicators of the direction of arrival or an LCD display embedded in the equipment itself, eliminating the use of the notebook.
Figure 5 - Interface of the system.
Results and conclusion
The processing time from the detection of an impulsive signal to the output of its DoA is currently (at the time of the submission of this work, i.e., it can be improved with further refinements) within 1.5 seconds, in many applications a derisive waiting time for possible responses actions to be taken by the user. Tests were performed with the system in a laboratory measuring around 4×5 meters using gunshot recordings played on a sound box model Yamaha MSP3. A loudspeaker was used to ensure a fixed position to a burst of impulsive signals of same characteristic. The speaker was placed (with precision of less than 1 degree) in azimuths 45, 135, 225 and 315 degrees, and 20 shots were "fired" at each position; the results are shown below in the histograms of Figure 6.
Figure 6 - Histograms showing the accuracy of the system.
The system is highly accurate and fully functional, with a maximum absolute error of 0.2 degree (results for tests in lab conditions). The system also has a conditional structure which checks whether the cross-correlation of signals from a pair of microphones is maximized by an argument outside the range of values that are expected, which is given by the distance between microphones in that pair (which can happen in cases of presence of significant noise, for example), and then discards the result of this specific pair and keeps the rest. This contributes to a better overall system accuracy.
Factors such as high processing capacity and the possibility of simultaneous sampling of all seven channels (microphones signals) were extremely important for the correct operation of the system. The courses offered by National Instruments and the easy programming environment of LabVIEW to implement the various functions and algorithms, both detection and direction of arrival estimation, allowed the successful development of this project on a tight time frame (3 months).
The main difficulty was the synchronization of the various tasks to be performed by the system, where the time factor was crucial due to the impulsive nature of the incoming signals which creates necessity for a high sampling rate. Queuing techniques and synchronization tasks taught during the NI courses were widely used for the solution of those problems.
This project addressed a problem of public security that has been growing in importance in the worldwide scenario, where the need for detection and estimation of the direction of a firearm shot is very important in combating urban violence; also, this system has application for defense forces.
In a next step of this project, an analysis of the two signals generated by firing supersonic weapons is to be included; these signals are the muzzleblast, generated by the explosion of the cartridge in the gun, and the shockwave, generated as a supersonic bullet travels through the air. When their directions of arrival are combined, it is possible to estimate the distance of the shooter relative to the array of microphones, along the DoA of the muzzleblast. The estimated location is more accurate when the microphone array is not too far away (otherwise the deceleration of the bullet decreases its accuracy) and also not too close to the shooter, when an overlap of both signals (muzzleblast and shockwave) may occur.
Demonstration video:
See also the attached poster.
This is an outstanding paper with such good quality and very suitable application. The presentation has a simple explanation and a well produced video. Congratulations for the authors.
Great job! Striking! Congratulations for the authors.
Very Good Project!
Nice project! Congrats!
Excellent !
Parabéns pelo extraordinário trabalho desenvolvido.
Parabéns pelo extraordinário trabalho desenvolvido.
It is usually difficult to explain to non specialist what can be done with signal processing. This is a beautiful example of what a smart design can achieve.
Parabéns!
Muito criativo e muito útil. Excelente trabalho. Parabéns aos autores!
We were among the four finalists and went to Austin (NI Week 2013) where first (Easier Student Science on Sounding Rockets) and second (Autonomous Robotic Technology Enabling Minimally Invasive Surgery) places were announced. It was very nice working with Paulo Prandel.
It's a good jod!