This application note describes a simple and easy-to-use solution to help design and develop products with an audio output, for example, toys, alarms, door bells, and white goods. Audio data generally require the storage of a lot of memory. However, the memory space needed to preserve such data can be reduced by compressing the audio data via a specified compression method. Processing these data is usually a complex task requiring powerful microcontrollers such as DSP or audio chip. Normally, 8-bit microcontrolles do not offer either a large memory or a high computing performance. The software solution offered in this application note reconstructs audio signals from compressed samples. A simple audio codec based on an adaptive differential pulse coded modulation (ADPCM) algorithm is used and advantage is taken of the advanced STM8L core with its 3-staged pipeline and 16 MIPS peak performance. The digital samples are converted to an analog signal by an on-chip, 12-bit, digital-to-analog converter (DAC). This offers good overall audio quality, yet is a cost-effective solution for 8- bit microcontroller applications. The battery-powered application benefits from the ultra low-power consumption of STM8L microcontrollers. The example firmware and application hardware design are provided with this application note to enable easy porting of the offered solution to the f
This document presents a software-based audio codec solution designed for STM8L15xxx microcontrollers. It utilizes an Interactive Multimedia Association (IMA) Adaptive Differential Pulse Coded Modulation (ADPCM) algorithm to reconstruct audio signals from compressed samples, offering a cost-effective alternative to DSPs or dedicated audio chips.
The guide details the implementation of both compression and decompression algorithms, explaining how 16-bit linear samples are converted into 4-bit signed two's complement values. It also covers methods for storing audio data within the microcontroller's internal Flash memory using in-application programming (IAP) or by linking arrays with compiled code.
The solution helps design and develop products with an audio output, such as toys, alarms, door bells, and white goods.
The example command resamples the input audio data to a target frequency of 15625 Hz.
A 5-second ADPCM bitstream with an 8-kHz sample rate uses 20 Kbytes of memory.