Getting started with osxacousticsl real-time sound source localization software expansion for STM32Cube

Similar documents
Getting started with osxacousticbf real-time beam forming software expansion for STM32Cube

Getting started with the software package for digital MEMS microphones in X-CUBE-MEMSMIC1 expansion for STM32Cube

Getting started with X-CUBE-LED channel LED driver software expansion based on LED1642GW for STM32Cube

Getting started with the digital MEMS microphone expansion board based on MP34DT01-M for STM32 Nucleo

Getting started with MotionPM real-time pedometer library in X CUBE-MEMS1 expansion for STM32Cube

Getting started with the FP-SNS-ALLMEMS1 Bluetooth low energy and sensors software expansion for STM32Cube

Getting started with osxmotiongc gyroscope calibration library for X-CUBE-MEMS1 expansion for STM32Cube

Getting started with the X-CUBE-IKA02A1 multifunctional software expansion for STM32Cube

Getting started with MotionPM real-time pedometer library in X-CUBE-MEMS1 expansion for STM32Cube

UM2350. Getting started with MotionPW real-time pedometer for wrist library in X-CUBE-MEMS1 expansion for STM32Cube. User manual.

UM2216 User manual. Getting started with MotionFA fitness activity library in X CUBE MEMS1 expansion for STM32Cube. Introduction

UM2045 User manual. Getting started with the X-CUBE-NFC3 near field communication transceiver software expansion for STM32Cube.

Getting started with the X-CUBE-NFC5 high performance HF reader / NFC initiator IC software expansion for STM32Cube

UM2194. Getting started with MotionAW activity recognition for wrist library in X-CUBE-MEMS1 expansion for STM32Cube. User manual.

Getting started with the FP-NET-6LPBLE1 function pack for 6LoWPAN IoT node connection to a smartphone via BLE interface

AN4624 Application note

UM2276. Getting started with MotionSD standing vs sitting desk detection library in X-CUBE-MEMS1 expansion for STM32Cube. User manual.

Getting started with the STSW-BCNKT01 software package for STEVAL-BCNKT01V1 based on STM32Cube

IoT node with BLE connectivity, digital microphone, environmental and motion sensors, motion and audio middleware libraries.

Getting started with osxmotionmc magnetometer calibration library for X-CUBE-MEMS1 expansion for STM32Cube

Getting started with the X-CUBE-53L1A1 Time-of-Flight long distance ranging sensor software expansion for STM32Cube

Getting started with the FP-IND-PLCWIFI1 function pack for PLC management via Wi-Fi

Getting started with MotionAR activity recognition library in X-CUBE-MEMS1 expansion for STM32Cube

Getting started with the software package for STEVAL-STLKT01V1 based on STM32Cube

Getting started with the STM32 Nucleo pack for USB Type-C and Power Delivery with the Nucleo-F072RB board and the STUSB1602

Bluetooth low energy profiles for the X-CUBE-BLE1 expansion for STM32Cube. Description

UM1853 User manual. STM32CubeF1 Nucleo demonstration firmware. Introduction

Getting started with MotionAR activity recognition library in X-CUBE-MEMS1 expansion for STM32Cube

P-NUCLEO-USB001. STM32 Nucleo pack for USB Type-C and Power Delivery. Features. Description

Getting started with MotionMC magnetometer calibration library in X-CUBE-MEMS1 expansion for STM32Cube

UM2051 User manual. Getting started with the STM32 Nucleo pack for USB Type-C and Power Delivery. Introduction

NUCLEO-L433RC-P NUCLEO-L452RE-P

NUCLEO-L496ZG. STM32 Nucleo-144 board. Features. Description

STSW-BLUENRG1-DK. BlueNRG-1, BlueNRG-2 DK SW package

P-NUCLEO-USB001. STM32 Nucleo pack for USB Type-C and Power Delivery Data brief. Features. Description

Getting started with the X-CUBE-MEMS1 motion MEMS and environmental sensor software expansion for STM32Cube

32F412GDISCOVERY. Discovery kit with STM32F412ZG MCU. Features. Description

UM1727 User manual. Getting started with STM32 Nucleo board software development tools. Introduction

32F469IDISCOVERY. Discovery kit with STM32F469NI MCU. Features. Description

USB Type-C and Power Delivery Nucleo pack with NUCLEO-F072RB expansion board based on STUSB1602. Description

Getting started with osxmotionar activity recognition library for X-CUBE-MEMS1 expansion for STM32Cube

UM2192. Getting started with MotionMC magnetometer calibration library in X-CUBE-MEMS1 expansion for STM32Cube. User manual.

Getting started with STEVAL-IDB007V1 and STEVAL-IDB008V1 evaluation boards

32F746GDISCOVERY. Discovery kit with STM32F746NG MCU. Features. Description

DT0095 Design tip. Datalogging the SensorTile through a PC. Purpose and benefits. Description

32L476GDISCOVERY. Discovery kit with STM32L476VG MCU. Features. Description

Getting started with VL53L0X ranging and gesture detection sensor software expansion for STM32Cube

USB Type-C and Power Delivery Nucleo pack with NUCLEO-F072RB expansion board based on the STUSB1602

STM32H7x3I-EVAL. Evaluation board with STM32H7x3XI MCUs. Data brief. Features

STM32L4R9I-EVAL. Evaluation board with STM32L4R9AI MCU. Features

Getting started with FP-SNS-6LPNODE1 software for IoT sensor node connection to 6LoWPAN networks using sub-1ghz RF

UM1641 User manual. Sampling rate conversion SRC236 library software expansion for STM32Cube. Introduction

P-NUCLEO-IKA02A1. STM32 Nucleo pack: electrochemical toxic gas sensor expansion board with CO sensor. Description. Features

How to upgrade the firmware on the STEVAL-USBC2DP USB Type-C to DisplayPort adapter

UM2084 User manual. Getting started with the ultra-low-power STM32 and LoRa Nucleo pack. Introduction

AN4515 Application note

X-NUCLEO-53L1A1. Long distance ranging Time-of-Flight sensor expansion board based on VL53L1X for STM32 Nucleo. Description.

Running a simple 6LowPAN network consisting of one receiver node and one or more sensor nodes in a Sub-1GHz RF band

Getting started with the X-CUBE-SPN2 two-axis stepper motor driver software expansion for STM32Cube

HALCoGen TMS570LS31x Help: example_sci_uart_9600.c

SAM4 Reset Controller (RSTC)

UM1862 User manual. Getting started with STM32F411E Discovery software Development Tools. Introduction

Getting started with X-NUCLEO-IHM06A1 low voltage stepper motor driver expansion board based on STSPIN220 for STM32 Nucleo

Quick Start Guide. STM32 ODE function pack for MEMS microphones acquisition, advanced audio processing and audio output (FP-AUD-SMARTMIC1)

RN0084 Release note. ST-LINK/V2 firmware upgrade. About this release note

Embedded Audio & Robotic Ear

Getting started with the ultra-low-power STM32 and LoRa Nucleo pack

P-NUCLEO-53L1A1. VL53L1X nucleo pack with X-NUCLEO-53L1A1 expansion board and STM32F401RE nucleo board. Description. Features

STSW-STWBCFWDT. STWBC firmware downloader tool. Description. Features

UM1677 User manual. Getting started with STM32F030 Value Line Discovery development tools. Introduction

Quick Start Guide. Sound terminal expansion board based on STA350BW for STM32 NUCLEO (X-NUCLEO-CCA01M1) Version 1.1.

EVLKSTCOMET10-1. STCOMET smart meter system-on-chip development kit. Features

Intel Stress Bitstreams and Encoder (Intel SBE) 2017 AVS2 Release Notes (Version 2.3)

UM2343 Application note

AN4782 Application note

STSW-BNRG-Mesh. Mesh over Bluetooth low energy. Features. Description. Applications

Motor control power board based on the SLLIMM-nano 2 nd series

UM2495. High performance HF reader / NFC initiator IC software expansion for NUCLEO-8S208RB. User manual. Introduction

TN1235 Technical note

Getting started with the X-CUBE-SPN3 high power stepper motor driver software expansion for STM32Cube

Ecma International Policy on Submission, Inclusion and Licensing of Software

X-NUCLEO-53L0A1. Ranging and gesture detection sensor expansion board based on VL53L0X for STM32 Nucleo. Description. Features

APPLICATION NOTE. Atmel AT03261: SAM D20 System Interrupt Driver (SYSTEM INTERRUPT) SAM D20 System Interrupt Driver (SYSTEM INTERRUPT)

IETF TRUST. Legal Provisions Relating to IETF Documents. Approved November 6, Effective Date: November 10, 2008

P-NUCLEO-53L0A1. VL53L0X Nucleo pack with ranging, gesture detection sensor expansion board and STM32F401RE. Description. Features

STM32SnippetsL0. STM32L0xx Snippets firmware package. Features. Description

Quick Start Guide. High power stepper motor driver expansion board based on powerstep01 for STM32 Nucleo (X-NUCLEO-IHM03A1)

Using the GPIOs and interrupt controller to drive LEDs on STM8 Nucleo-64 boards

EVALKITSTKNX. Miniature transceiver STKNX evaluation and development kit. Features

STEVAL-STLKT01V1. SensorTile development kit. Description. Features

AT11512: SAM L Brown Out Detector (BOD) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

UM2092 User manual. Basic metrology firmware for the STM32F103RD and the STPM32 devices. Introduction

L9958 Evaluation board for high current (8.6A) DC and Stepper Motors. Description

UM1844 User manual. EVAL-L9958 Graphical user interface (GUI) Introduction

STEVAL-BCNKT01V1. BlueCoin Starter kit. Features. Description

Getting started with the P-NUCLEO-IKA02A1 STM32 Nucleo pack for electrochemical toxic gas sensor expansion board with CO sensor

IETF TRUST. Legal Provisions Relating to IETF Documents. February 12, Effective Date: February 15, 2009

Description. July 2016 DocID Rev 2 1/6

Getting started with the X-NUCLEO-IHM14A1 stepper motor driver expansion board based on STSPIN820 for STM32 Nucleo

Ecma International Policy on Submission, Inclusion and Licensing of Software

Transcription:

User manual Getting started with osxacousticsl real-time sound source localization software expansion for STM32Cube Introduction The osxacousticsl software lets you implement a real-time sound source localization algorithm using two or four signals acquired from digital MEMS microphones to estimate the arrival direction of an 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 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 osxacousticsl library is provided in binary format inside a software package with sample applications running on the X-NUCLEO-CCA02M1 expansion board connected to a NUCLEO-F401RE board. The example package is an add-on for the X-CUBE-MEMSMIC1 package; it is based on STM32Cube technology and is easily ported to any STM32F4 microcontroller with an FPU unit. Information regarding STM32Cube is available on www.st.com at http://www.st.com/stm32cube. September 2016 DocID028538 Rev 2 1/23 www.st.com

Contents UM1968 Contents 1 Licensing information... 4 2 osxacousticsl software library... 5 2.1 Angle resolution... 5 2.1.1 XCORR cross-correlation algorithm... 5 2.1.2 GCC-PHAT algorithm... 6 2.1.3 BMPH algorithm... 6 2.2 Microphone geometry... 6 2.2.1 Two-microphone scenario... 6 2.2.2 4-microphone scenario... 7 3 osxacousticsl software expansion for X-CUBE-MEMSMIC1... 8 3.1 Overview... 8 3.2 Architecture... 8 3.3 Folders Structure... 9 3.4 APIs... 10 4 System setup guide... 11 4.1 Hardware setup... 11 4.2 Firmware and software... 11 4.2.1 Additional package download and unpacking... 11 4.2.2 Library package installation... 12 4.2.3 Node locking procedure... 15 4.2.4 Compiling the example projects... 16 5 Sample application description... 18 5.1 Firmware steps... 18 5.2 Example program execution... 18 6 Library Profiling... 20 7 References... 21 8 Revision history... 22 2/23 DocID028538 Rev 2

List of figures List of figures Figure 1: Two-microphone arrangement... 6 Figure 2: Four-microphone arrangement... 7 Figure 3: Resulting software architecture... 9 Figure 4: Package folder structure... 9 Figure 5: Directory content after unpacking the X-CUBE-MEMSMIC1 package... 12 Figure 6: License Agreement... 12 Figure 7: Information and additional package requirements... 13 Figure 8: Installation directory for the PC software... 13 Figure 9: Installation directory for the firmware... 14 Figure 10: OSX LicenseWizard tool installation... 14 Figure 11: Resulting firmware workspace... 15 Figure 12: Library selection... 15 Figure 13: License request generation... 16 Figure 14: Error while building the original osx_license.h file... 16 Figure 15: osx_license.h file after the required modifications... 17 Figure 16: STLink Virtual COM port detection... 19 DocID028538 Rev 2 3/23

Licensing information UM1968 1 Licensing information This software library is licensed under ST OpenSoftwareX Limited License Agreement, (the "OSX-LLA License"). You may obtain a copy of the OSX License at: OpenSoftwareX license agreement Some of the library code is based on the CMSIS DSP software library by ARM, a suite of common signal processing functions for use on Cortex-M processor based devices. Licensing terms are available in the attached release_note.html file, in the next lines of this document and on the web at: http://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. 4/23 DocID028538 Rev 2

osxacousticsl software library 2 osxacousticsl software library 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 [1]: 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. 2.1 Angle resolution Angle output resolution mainly depends on the chosen algorithm and how the result is computed: 2.1.1 XCORR cross-correlation algorithm Cross-correlation is based on time-domain computation and the resolution depends on both the sampling frequency and the distance between microphones. For each combination of these parameters, the maximum delay between two microphones (in terms of samples) is: (Distance) (SamplingFrequency) DelayMax = Floor ( ) (SoundSpeed) This value is strictly related to the maximum number of angles that can be discerned by the routine and thus determines the output resolution. The minimum detectable angle over 180 degrees is thus: 180 MinimumDetectableAngle = Floor ( 2 DelayMax ) The larger the microphone distance, the higher the possible resolution, at a higher MIPS cost. If this algorithm is chosen, the achievable resolution is computed automatically by the initialization function and cannot be set by the user. In this case, the resolution parameter is ignored by the initialization function. DocID028538 Rev 2 5/23

osxacousticsl software library 2.1.2 GCC-PHAT algorithm UM1968 The GCC-PHAT algorithm works with frequencies and generally offers a better resolution even in low inter-microphone spacing configurations. The user can set the desired resolution with a dedicated parameter in the initialization structure (see the chm help file in the Documentation folder). In this case, the higher the resolution, the higher the MIPS consumption. Please note that the resolution value relates to the use of the library with two channels. When the library is used with four channels to perform source localization over a 360 degree range, two detected values are merged internally and the overall resolution may be different to the initial setting. 2.1.3 BMPH algorithm The block matching pursuit with hangover (BMPH) algorithm also works with frequencies and the user can set the desired resolution with a dedicated parameter in the initialization structure. The best resolution available for the BMPH algorithm is four degrees. While MIPS consumption and memory requirements of the BMPH algorithm are generally lower than for the GCC-PHAT algorithm, the algorithms exhibit similar performance because the algorithm adaptively analyzes the most relevant frequencies in the frame. 2.2 Microphone geometry 2.2.1 Two-microphone scenario Figure 1: "Two-microphone arrangement" shows the plan view of microphones M1 and M2. The minimum inter-microphone spacing depends on the algorithm: for XCORR, the distance must allow at least one sample delay between them GCC-PHAT has potentially no distance constraints Figure 1: Two-microphone arrangement The estimated angle is measured taking as a reference the imaginary line passing through the middle point of the segment joining the two microphones and orthogonal to it, as depicted in the picture. 6/23 DocID028538 Rev 2

2.2.2 4-microphone scenario osxacousticsl software library Figure 2: "Four-microphone arrangement" shows the arrangement of microphones M1, M2, M3 and M4. The same distance constraints as in the two-microphone scenario must be observed, but they are measured between opposite microphones; i.e., between M1-M2 and between M3-M4. Figure 2: Four-microphone arrangement DocID028538 Rev 2 7/23

osxacousticsl software expansion for X-CUBE- MEMSMIC1 UM1968 3 osxacousticsl software expansion for X-CUBE- MEMSMIC1 3.1 Overview osxacousticsl software package expands the functionality provided by STM32Cube. It is designed as an add-on for X-CUBE-MEMSMIC1 pack and exploits its features for digital MEMS microphones acquisition, decimation and streaming. For further information regarding X-CUBE-MEMSMIC1, including the microphone acquisition process and software downloads, please refer to www.st.com. For details on how to merge the two packages into a single package, refer to Section 6.2: "Firmware and software". The key features of this add-on package are: 3.2 Architecture osxacousticsl library middleware sample implementation available for X-NUCLEO-CCA02M1 board plugged on top of a NUCLEO-F401RE, based on the X-CUBE-MEMSMIC1 package detailed chm documentation of the library API The package extends X-CUBE-MEMSMIC1 by providing: an additional middleware component for the osxacousticsl library a sample implementation that exploits the X-CUBE-MEMSMIC1 capabilities for microphone acquisition, decimation and streaming. The two packages must therefore be merged in order to obtain a fully functional application based on the osxacousticsl library, available to the user as a reference for software design and library integration. The resulting application architecture includes the following layers needed to access the microphone data: STM32Cube HAL layer: consists of a set of simple, generic, multi-instance APIs (application programming interfaces) which interact with the upper layer applications, libraries and stacks. These generic and extension APIs are based on a common framework which allows any layers they built on, such as the middleware layer, to implement their functions without requiring specific hardware information for a given microcontroller unit (MCU). This structure improves library code reusability and guarantees easy portability across other devices. Board Support Package (BSP) layer: provides software support for the STM32 Nucleo board peripherals, excluding the MCU. These specific APIs provide a programming interface for certain board specific peripherals like LEDs, user buttons, etc and can also be used to fetch individual board version information. It also provides support for initializing, configuring and reading data. 8/23 DocID028538 Rev 2

osxacousticsl software expansion for X-CUBE- MEMSMIC1 Figure 3: Resulting software architecture 3.3 Folders Structure The following folders are included in the software package: Documentation: contains a compiled HTML file generated from the source code, detailing the software components and APIs. Drivers: contains the HAL drivers, the board specific drivers for each supported board or hardware platform, including those for the onboard components and the CMSIS layer which is a vendor-independent hardware abstraction layer for the Cortex-M processor series. Middlewares: contains the osxacousticbf library binary code, documentation and license information. Projects: contains a sample application used to demonstrate the library, provided for the NUCLEO-F401RE platform with three development environments: (IAR) Embedded Workbench for ARM, RealView Microcontroller Development Kit (MDK-ARM) and System Workbench for STM32 (SW4STM32). Figure 4: Package folder structure DocID028538 Rev 2 9/23

osxacousticsl software expansion for X-CUBE- MEMSMIC1 3.4 APIs UM1968 Detailed technical information fully describing the functions and parameters of the osxacousticsl APIs can be found in the osxacousticsl_package.chm compiled HTML file located in the Documentation folder of the software package. In the same document, you can find general descriptions regarding all the osxacoustic library APIs and the concepts behind their design. osxacousticsl is provided as a node-locked library which allows derivative firmware images to run on a specific STM32 Nucleo device only. Licensing activation codes must be requested from ST and included in the project (and become part of the build process) prior to attempting its usage. The resulting firmware binary image will therefore be node-locked. For complete information about the open.audio license agreement, please refer to the license file located in the Middlewares/ST/STM32_OSX_AcousticSL_Library folder. 10/23 DocID028538 Rev 2

System setup guide 4 System setup guide 4.1 Hardware setup The library sample application needs the following hardware: NUCLEO-F401RE board Further details can be found at www.st.com Four external digital microphones based on the ST coupon daughterboard concept (part number: STEVAL-MKI129V* or STEVAL-MKI155V*). Find further details regarding possible choices at ww.st.com X-NUCLEO-CCA02M1 expansion board For this specific application, the board solder jumpers must be configured in order to acquire four microphones using the abovementioned external coupon boards. Note that this is not the default factory setting, so you may need to change solder jumper configurations and add strips line in order to host the coupon boards. The correct setup is described in [2]. Refer to the same user manual for information regarding board connections and supplying power. 4.2 Firmware and software The main steps required to setup the environment are: Additional packages download and unpack Library package installation Node locking procedure Compiling and running 4.2.1 Additional package download and unpacking The application is designed as an add-on project for the X-CUBE-MEMSMIC1, which you can find at www.st.com. After downloading, unpack the zip file in a directory of your choice. This will become the workspace used to test and work with the library. Avoid using paths names longer than 240 characters because it can cause problems in some tool chains during project build. In our example below, the workspace is placed in the C:\Workspace folder. DocID028538 Rev 2 11/23

System setup guide Figure 5: Directory content after unpacking the X-CUBE-MEMSMIC1 package UM1968 4.2.2 Library package installation Double click the osxacousticsl_setup library installer available at www.st.com in order to start the installation procedure. The first step is to accept the License Agreement: Figure 6: License Agreement Then the procedure details the additional packages required: 12/23 DocID028538 Rev 2

Figure 7: Information and additional package requirements System setup guide Now you can choose the directory where you want to install the library software. Note that this is not the path for the firmware, but where the PC software related information (uninstall and other information) shall be stored. This folder does not necessarily have to be your workspace folder. Figure 8: Installation directory for the PC software Then you choose the directory where the firmware will be unpacked. This folder must be your desired workspace directory ( C:\Workspace in our example). DocID028538 Rev 2 13/23

System setup guide Figure 9: Installation directory for the firmware UM1968 Finally you can complete the installation procedure. The LicenseWizard software is required for the next steps. Figure 10: OSX LicenseWizard tool installation At this stage, your Workspace folder should resemble the image below. 14/23 DocID028538 Rev 2

Figure 11: Resulting firmware workspace System setup guide You will find the installed library in the Middleware folder, while the sample application projects are in the Project folder. 4.2.3 Node locking procedure Connect a NUCLEO-F401RE board to the PC, run the OSX LicenseWizard you installed in the previous steps and choose the library you want to activate. Figure 12: Library selection Now use the appropriate buttons on the wizard to: identify the STM32 Nucleo board generate the license request send the request e-mail License request generation DocID028538 Rev 2 15/23

System setup guide Figure 13: License request generation UM1968 The license mail should arrive after a few moments. 4.2.4 Compiling the example projects Open the project with your favorite tool chain. In this example, the projects for three IDEs are located in C:\Workspace\Projects\Multi\Applications\Acoustic_SL. Try to compile the project, you should receive the following error: Figure 14: Error while building the original osx_license.h file Open the osx-license.h file and substitute the dummy license array with the one you received by mail from the Open.Audio server. Also, comment the define directive describing the error. 16/23 DocID028538 Rev 2

Figure 15: osx_license.h file after the required modifications System setup guide You should now be able to compile and flash the board for which you requested the license in order to use the library example. DocID028538 Rev 2 17/23

Sample application description UM1968 5 Sample application description An example application using the osxacousticsl library with NUCLEO-F401RE and X- NUCLEO-CCA02M1 boards is provided in the Projects directory. Ready to build projects are available for multiple IDEs. The application is designed to perform: Acquisition of the four external microphones mounted on the X-NUCLEO-CCA02M1 board. Sound source localization running basing on those signals. Output of the localization result through the ST-Link embedded virtual COM port. Streaming of four audio channels via X-NUCLEO-CCA02M1 USB connector to a host PC. 5.1 Firmware steps Follow these steps to obtain the desired behavior: Initialize and start the USB audio input driver and middleware. This allows a host PC to recognize the device as a standard multichannel USB microphone. Initialize microphone acquisition using the relevant BSP function. Initialize the osxacousticsl library. Start the audio acquisition that will trigger library execution. The four omnidirectional microphones streams are be passed to USB driver each millisecond. The osxacousticsl results are sent through ST-Link VCP to a host PC on each library run. All the operations related to the osxacousticsl library are performed in dedicated functions in the audio_application.c file. Further details about library API can be found in the.chm help file in the Documentation folder. 5.2 Example program execution Third party serial communication software is required to be able to collect localization values. One possible solution is the free Putty software available at: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html. To set up the demo: Connect NUCLEO-F401RE mini USB cable (USB type A to Mini-B USB cable). 18/23 DocID028538 Rev 2

Figure 16: STLink Virtual COM port detection Sample application description Check the COM Port number assigned to the board in Windows Device Manager. Open the serial utility and ensure the connection parameters are set to: Baudrate: 9600 Data bits: 8 Stop bits: 1 Parity: none Flow Control: none Open the COM port Now you should be able to see the localization results on the screen. Note that there is an audio energy threshold below which the library is not executed, in which case localization is not computed and nothing is sent to the VCP. In order to record audio from the device, you need to install third party software such as the Audacity freeware program to save or play the streamed signal. Detailed information on how to setup the host system for audio recording can be found in the X-CUBE-MEMSMIC1 user manual, available at www.st.com. Further information about Audacity can be obtained at: http://audacityteam.org/?lang=en DocID028538 Rev 2 19/23

Library Profiling UM1968 6 Library Profiling Profiling was performed in order to evaluate the library resource consumption in terms of MIPS, RAM and Flash. Detailed information can be found in the osxacousticbf_package.chm compiled HTML file located in the Documentation folder. 20/23 DocID028538 Rev 2

References 7 References 1. 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. 2. User manual, UM1900 - Getting started with the digital MEMS microphones expansion board based on MP34DT01-M for STM32 Nucleo. STMicroelectronics DocID028538 Rev 2 21/23

Revision history UM1968 8 Revision history Table 1: Document revision history Date Version Changes 02-Dec-2015 1 Initial release. 01-Sep-2016 2 Throughout document: - added BMPH algorithm information - minor text and formatting changes Added Section 2.1.3: "BMPH algorithm" 22/23 DocID028538 Rev 2

IMPORTANT NOTICE PLEASE READ CAREFULLY STMicroelectronics NV and its subsidiaries ( ST ) reserve the right to make changes, corrections, enhancements, modifications, and improvements to ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on ST products before placing orders. ST products are sold pursuant to ST s terms and conditions of sale in place at the time of order acknowledgement. Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design of Purchasers products. No license, express or implied, to any intellectual property right is granted by ST herein. Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product. ST and the ST logo are trademarks of ST. All other product or service names are the property of their respective owners. Information in this document supersedes and replaces information previously supplied in any prior versions of this document. 2016 STMicroelectronics All rights reserved DocID028538 Rev 2 23/23