SLAA361A July 2007 – August 2018 MSP430F169 , MSP430F169 , MSP430FG4618 , MSP430FG4618
This document describes an IMA adaptive differential pulse code modulation (ADPCM) compression and decompression algorithm and the steps to use the ADPCM library on MSP430™ microcontrollers (MCUs). This document describes the use of the ADPCM library for two voice recorder examples that use the signal-chain-on-chip feature of the MSP430 MCUs.
Source code and sample files are available for download from http://www.ti.com/lit/zip/slaa361.
MSP430 is a trademark of Texas Instruments.
IAR Embedded Workbench is a registered trademark of IAR Systems.
All other trademarks are the property of their respective owners.
Sound recorders are implemented with relative ease on microcontrollers (MCUs) that have an integrated analog-to-digital converter (ADC). A microphone followed by an amplifier captures the sound, which is fed to the analog input of the ADC. The recorded sound can then be stored in memory (flash or RAM). A button press can trigger the MCU to play the recorded sound. To play the sound, software moves the stored data to a digital-to-analog converter (DAC) followed by an audio power amplifier.
Such a sound recorder can be easily realized using the MSP430 MCUs. The MSP430 MCU takes advantage of the integrated peripherals to form an on-chip analog signal chain. In addition, the CPU of the MSP430 is powerful enough to perform compression of the recorded sound.
This application report and the accompanying code uses the MSP430FG4618 microcontroller and the MSP430F169 microcontroller for demonstration purposes. The concepts and code in this application report apply to any MSP430 MCU that has at least one ADC input and a DAC.
The simplest way to make a voice recorder is to store the analog-to-digital conversion results (for example, 12-bit samples) directly in the flash memory. Most of the time, the audio data does not use the complete ADC range, which means that redundant information is stored in the flash memory. Compression algorithms remove this redundant information and reduce the data that must be stored.
Adaptive differential pulse code modulation (ADPCM) is a compression algorithm. Various ADPCM algorithms exist, all of which use differential codes and adaptation of the step-size of the quantizer. Section 2.1 describes differential pulse code modulation (DPCM), and Section 2.2 describes the IMA ADPCM algorithm, which is used in the associated code.