AN3225 Audio Software Codec for STM8L15xxx Application Note

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


AN3225 Audio Software Codec for STM8L15xxx Application Note - cover page
Brand
STMicroelectronics
Category
microcontrollers
Document type
Application Note
Language
English
Pages
13
File format
PDF
File size
266 KB
Published
07 August, 2012
Updated
30 September, 2023
MD5 checksum
573D9646E63732D154325B5469466EF7

About this manual

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.

What's inside

  • ADPCM Codec
  • IMA ADPCM Decompression
  • IMA ADPCM Compression
  • Audio Data Encoding and Storing
  • Internal Flash Memory Usage
  • External Memory Usage

Frequently asked questions

What is the primary purpose of the solution described in this application note?

The solution helps design and develop products with an audio output, such as toys, alarms, door bells, and white goods.

What is the sample rate used in the example command for resampling audio data?

The example command resamples the input audio data to a target frequency of 15625 Hz.

How much memory is required to store a 5-second ADPCM bitstream with an 8-kHz sample rate?

A 5-second ADPCM bitstream with an 8-kHz sample rate uses 20 Kbytes of memory.

Download PDF (266 KB)

More STMicroelectronics Manuals


View all STMicroelectronics manuals →