January 2018 DocID029076 Rev 1 1/20
1
UM2031
User manual
Sound meter library
software expansion for STM32Cube
Introduction
The sound meter library software user manual describes the SoundMeterR (SMR) module
configuration and its interfaces.
It describes how to integrate the module into a main program, such us the X-CUBE-AUDIO
expansion software. It also provides a basic understanding of the underlying algorithm.
The sound meter library software expansion is used with 16 or 32-bit input/output format. It
is part of the X-CUBE-AUDIO firmware package.
www.st.com
Contents UM2031
2/20 DocID029076 Rev 1
Contents
1 Module overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1 Algorithm functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 Module configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Resource summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2 Module Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1 API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1.1 smr_reset function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1.2 smr_setParam function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1.3 smr_getParam function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.1.4 smr_setConfig function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.1.5 smr_getConfig function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1.6 smr_process function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2 External definitions and types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.2.1 Input and output buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.2.2 Returned error values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.3 Static parameters structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
2.4 Dynamic parameters structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
3 Algorithm description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.1 Processing steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.2 Data formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4 Application description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.1 Recommendations for optimal setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.1.1 Module integration example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.1.2 Module APIs calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5 How to tune and run the application . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.1 averaging_time: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.2 filter_type: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
6 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19