En DM00390468
En DM00390468
User manual
Introduction
The AcousticSL software lets you implement a real-time sound source localization algorithm using two or four signals acquired
from digital MEMS microphones to estimate the direction of arrival of the main audio source.
It is based on three different DOA algorithms exploiting cross correlation in the time domain, generalized cross correlation with
phase transform, and a matching pursuit routine using sparse representation framework.
The angle can be estimated over a 180 or 360 degree range, depending on the number of channels adopted and the
microphone placement.
The resolution of the computed value can be chosen at runtime, allowing you to determine the best tradeoff between localization
precision and resource consumption.
The AcousticSL library is provided both in source code and in binary format inside the X-CUBE-MEMSMIC1 software
package with sample applications running on the X-NUCLEO-CCA02M2 expansion board connected to a NUCLEO-F401RE
development board and on the X-NUCLEO-AMICAM1, when connected to a NUCLEO-L4R5ZI.
The AcousticSL is also part of the FP-AUD-SMARTMIC1 function pack.
The package is based on STM32Cube technology and can be easily ported to any microcontroller with an FPU.
1 Licensing information
Licensed under Software License Agreement SLA0077, (the "License"). You cannot use this package except in
compliance with the License. You may obtain a copy of the License at www.st.com.
Some of the library code is based on the CMSIS DSP software library by ARM®, a suite of common signal
processing functions to be used on ARM® Cortex®-M processor-based devices. Licensing terms are available in
the release_note.html file included in the software package, in the next lines of this document and on the web at
https://www.keil.com/pack/doc/CMSIS/DSP/html/index.html.
ARM license note:
Copyright (C) 2009-2012 ARM Limited. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
• Redistributions of source code must retain the above copyright notice, this list of conditions and the following
disclaimer.
• Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other materials provided with the distribution.
• Neither the name of ARM nor the names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS” AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This library uses audio signals from microphones to execute sound source localization and estimate the angle
of arrival of the audio source. It embeds three algorithms with differing RAM and MIPS footprints and overall
performance (Knapp, C. H. (1976). The generalized correlation method for estimation of time delay, IEEE
Transactions on Acoustics, Speech and Signal Processing ASSP. 24(4), 320-327):
• XCORR cross correlation algorithm:
– performed in the time domain
– less resource intensive
– lower resolution
– requires microphones to be placed at greater distances
• GCC-PHAT algorithm
– performed in the frequency domain
– relatively resource intensive
– higher resolution
– performance should not be impacted by microphone distance
• BMPH algorithm
– performed in the frequency domain
– more resource demanding than XCORR, but less than GCC-PHAT
– performance should not be impacted by microphone distance
– performs a hangover step to enhance source stability
The basic versions of these algorithms use two audio signals to estimate an angle in a 180 degree range. A 360
degree range requires four audio streams and appropriate library configuration. The algorithm and the number
of microphones are chosen by the user during library initialization. The software is designed to run in a real-time
environment.
The estimated angle is measured by taking as a reference the imaginary line that passes through the middle point
of the segment, which joins the two microphones and is orthogonal to it.
3 Library profiling
Profiling helps to evaluate the library resource consumption in terms of MIPS, RAM, and Flash. You can find
detailed information in the AcousticSL_Package.chm compiled HTML file of the Documentation folder.
4 References
• Knapp, C. H. (1976). The generalized correlation method for estimation of time delay, IEEE Transactions on
Acoustics, Speech and Signal Processing ASSP. 24(4), 320-327.
Revision history
Table 1. Document revision history
Contents
1 Licensing information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2 AcousticSL software library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.1 AcousticSL software library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.1.1 Angle resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1.2 Microphone geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3 Library profiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6
4 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8
List of tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10
List of figures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
List of tables
Table 1. Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
List of figures
Figure 1. Two-microphone arrangement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Figure 2. Four-microphone arrangement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5