Datasheet

11
Software and Hardware Solutions for the 32-bit Designer
ADPCM and Speex (Audio) Library for
PIC32 Microcontrollers
Summary
The audio library for PIC32 MCUs consists of APIs for
Pulse Code Modulation, Adaptive Differential Pulse Code
Modulation and Speex encoding and decoding algorithms.
Speex is a Code Excited Linear Prediction (CELP) based,
open source, patent-free audio compression format designed
for speech. The ADPCM algorithm takes advantage of the
high correlation between consecutive speech samples,
which enables future sample values to be predicted.
Key Features
Free software/open source, patent- and royalty-free
Portable across all PIC32 microcontrollers
Supported encoding formats: PCM
(raw, uncompressed), IMA ADPCM, Speex
Implements an audio player behavior with play, record,
pause, stop functionality
Supports standard input/output stream formats:
Wave, Ogg for Speex, as well as a raw format containing
just data
Supports various sampling rates in both play and
record mode
Supports narrowband (8 kHz) and wideband (16 kHz)
bit-streams for Speex
Provides information about the missed samples
User-selectable ratio between the sampling frequency
and the play/record frequency
Applications
Answering machines
Building and home safety systems
Intercoms
Smart appliances
Voice recorders
Walkie-talkies
Toys and robots
Any application using message playback
Sample Rate Conversion Library
Summary
The Sample Rate Conversion (SRC) library, which can be
used with Microchip’s PIC32 and dsPIC33E families of
devices, provides the ability to upconvert the sampling rate
of real-time 16-bit stereo audio data. At run-time, the input
sampling rate can be selected between 32 kHz or
44.1 kHz, with a fixed output sample rate of 48 kHz.
Up-sample FIR Filter
Down-sample
Polynomial
Interpolation
A
udio
Data In
Poly-phase Filtering
SRC Audi
o
Data Out
Key Features
Stereo 16-bit audio sample rate conversion library
Two common audio modes:
    32 kHz to 48 kHz conversion
    44.1 kHz to 48 kHz conversion
Low MIPS and resource requirement
Both PIC32 MCUs and dsPIC33E DSCs supported
Can be used with low-cost DAC with limited sample
rate capability
Designed for streaming audio applications
Performance and Resource Consumption for PIC32
Library Modes
SRC
Library
Version
SRC Mode MIPS
Code Size
(bytes)
Data Size
(bytes)
SNR
(dB)
Lite
Version
32k to 48 kHz 27.4
5684 1284
82
44.1k to 48 kHz 30.1 82
Full
Version
32k to 48 kHz 33.5
5760 1364
84
44.1k to 48 kHz 36.7 82
Note: Tested with a 1 kHz full-scale sinusoidal signal.