This application note describes how to implement the Speex software codec on the STM32F101xx and STM32F103xx microcontrollers to build a vocoder application. Speex is a free audio codec dedicated to speech encoding and decoding. It provides a high level of compression with a good quality of sound. That makes it a high-performance solution for any application using message playback or a voice recorder, like answering machines, building and home safety systems, intercoms, smart appliances, voice recorders or walkie-talkies.
The document details how to build a vocoder application using the Speex software codec, which supports compression bitrates from 2 to 44 kbps. It covers narrowband (8 kHz), wideband (16 kHz), and ultrawideband (32 kHz) modes with features like voice activity detection and noise suppression.
The guide provides a hardware description using the STM32F103-STK board, explaining how to connect microphones via ADCs and speakers via PWM timers. It includes specific implementation settings for an 8 kbps constant bitrate mode and lists functions optimized in assembly code for ARM Cortex-M3 cores.
| Supported compression bitrates | 2 to 44 kbps |
|---|---|
| Sampling rates supported | 8 kHz, 16 kHz, and 32 kHz |
| ADC resolution | 12-bit |
| Timer PWM capability | 16-bit |
| Flash memory (Demo Board) | 128 Kbytes |
| RAM (Demo Board) | 20 Kbytes |
The complexity should be set to a value lower than or equal to 2 to avoid excessive CPU cycles while maintaining quality.
It is a free audio codec dedicated to speech encoding and decoding that provides high compression with good sound quality.
It is suitable for message playback or voice recorder applications such as answering machines, intercoms, smart appliances, or walkie-talkies.
The codec is implemented to encode at a bitrate of 8 kbps, which provides a compression ratio equal to 16:1.