Introduction
FP-AUD-AEC1 is an STM32Cube function pack which features an example fully focused on acoustic echo cancellation and
provides an implementation of a USB smart speaker use case with microphone.
The package includes the AcousticEC library which provides an implementation for a real-time echo cancellation routine based
on the MDF algorithm SPEEX implementation.
The function pack also includes an implementation example for NUCLEO-F446RE or NUCLEO-F746ZG development boards
equipped with X-NUCLEO-CCA01M1 expansion board, based on the STA350BW Sound Terminal 2.1-channel high-efficiency
digital audio output system, or X-NUCLEO-CCA02M2 expansion board, based on digital MEMS microphones and designed
around MP34DT06J digital microphones.
After the initialization of all the required elements, the device is recognized by a host PC as a USB microphone and USB
speaker at the same time.
You can record and save the real-time audio streaming and, in the meanwhile, send the preferred audio signal to the
loudspeaker connected to the expansion board. The stereo track contains the processed signal in which the acoustic echo
cancellation has removed the far-end signal from the audio acquired by a microphone and an omnidirectional microphone as a
reference.
Figure 1. FP-AUD-AEC1 demo scheme
Room
Near end speaker
Far end speaker
Known audio source
e. g. music/voice
Output
Far end signal removed
AcousticEC
Library
(for room reverberation
estimation)
Far end signal Near end signal
RELATED LINKS
Visit the STM32Cube ecosystem web page on www.st.com for further information
Getting started with the STM32Cube function pack for acoustic echo cancellation
UM2824
User manual
UM2824 - Rev 1 - January 2021
For further information contact your local STMicroelectronics sales office.
www.st.com
1 FP-AUD-AEC1 software expansion for STM32Cube
1.1 Overview
FP-AUD-AEC1 function pack expands STM32Cube functionality.
The package key features are:
Specific example fully focused on acoustic echo cancellation
Implementation of a USB smart speaker use case with microphone
Based on STM32 AcousticEC library
Support for audio in/out streaming via USB through a dedicated USB AUDIO IN OUT class
1.2 Architecture
The software is based on the STM32CubeHAL, the hardware abstraction layer for the STM32 microcontroller. The
package extends STM32Cube by providing a board support package (BSP) for the expansion boards and some
middleware components for serial communication with a PC.
The software layers used by the application software to access and use the expansion boards are:
the STM32Cube HAL layer, which provides a simple, generic, multi-instance set of application programming
interfaces (APIs) to interact with the upper application, library and stack layers. It has generic and extension
APIs and is directly built around a generic architecture and allows successive layers like the middleware
layer to implement functions without requiring specific hardware configurations for a given microcontroller
unit (MCU). This structure improves library code reusability and guarantees an easy portability on other
devices.
the board support package (BSP) layer, which supports all the peripherals on the STM32 Nucleo except
the MCU. This limited set of APIs provides a programming interface for certain board-specific peripherals
like the LED, the user button, etc. This interface also helps in identifying the specific board version.
Figure 2. FP-AUD-AEC1 function pack architecture
Applications &
demonstrations
FP-AUD-AEC1
Hardware Abstraction
Layer API
Board Support
Package
Middleware
Hardware
Abstraction
Hardware
NUCLEO-F446RE
NUCLEO-F746ZG
X-NUCLEO-CCA01M1
X-NUCLEO-CCA02M2
STM32 USB Device
Library
AUDIO IN OUT
USB Class
STM32 Acoustic EC
Library
STM32 PDM Library
STM32F446RET6U
STM32F746ZGT6U
UM2824
FP-AUD-AEC1 software expansion for STM32Cube
UM2824 - Rev 1
page 2/14