PDM audio software decoding on STM32 microcontrollers
1 Introduction
This application note presents the algorithms and architecture of an optimized software
implementation for PDM signal decoding and audio signal reconstruction when connecting
an ST MP45DT02 MEMS microphone with an STM32 microcontroller. It can directly take the
Pulse Density Modulated (PDM) data output from the microphone and convert it to 16-bit
pulse-code modulation (PCM) format.
This document also provides quick start information describing how to implement the PDM
Library for single microphone acquisition via I2S based on the STM32F4 microcontroller and
STM32F4DISCOVERY board.
For more details about this implementation, please refer to AN3997 Audio playback and
recording using the STM32F4DISCOVERY.
AN3998
Application note
October 2011 Doc ID 022391 Rev 1 1/10
www.st.com
Contents AN3998
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 PDM signal introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3 Hardware interface: microphone connection and acquisition . . . . . . . 5
4 Software interface: digital signal processing . . . . . . . . . . . . . . . . . . . . . 6
4.1 PDM digital filtering and decimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4.2 Digital signal conditioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
5 PDM audio software decoding library description . . . . . . . . . . . . . . . . . 7
5.1 PDM_Filter_Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5.2 PDM_Filter_xx_xx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
6 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2/10 Doc ID 022391 Rev 1
AN3998 List of figures
List of figures
Figure 1. Block diagram of a microphone connection to an STM32. . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Figure 2. Digital signal processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Doc ID 022391 Rev 1 3/10