pebble
  • Tutorials
  • Get the SDK
  • Guides
  • Documentation
  • PebbleOS
  • Mobile App
  • Examples
  • Index 01
  • Community
  • Blog
  • More
Privacy
Cookies
Publish

PebbleOS

  • Overview
  • Start here
    • Getting started guide
  • Pebble Firmware
    • Overview
    • Playground
    • Application SDK
  • Development
    • The pbl CLI
    • Build system
    • Samples
    • Emulator and simulator
    • Testing
    • Debugging
    • Conventions
  • System
    • Architecture overview
    • Kernel
    • Drivers
    • Subsystems
    • Libraries
      • C library
      • Utilities
      • Fuel gauge
      • Kraepelin
      • PDM
      • van Hees
      • Shared definitions
    • Third-party
  • Hardware
    • Boards
    • Board Add-ons
    • Programmers
  • Community
    • Contribution Guidelines
  • Reference
    • Reference
    • Kconfig options

PDM

PDM decimates the 1-bit stream of a PDM microphone to 16-bit PCM, for audio interfaces that capture it raw, as the SAI of the STM32H7.

Directory

lib/pdm

Header

pbl/pdm/pdm.h

Kconfig

CONFIG_PDM, selected by the code that uses it

API

API reference

Filters

A fifth-order sinc filter decimates by 8, a byte of samples at a time through one lookup table per byte of its span. An equiripple low-pass FIR then decimates by 8 or 16, flat to 0.4 times the output rate and at least 70 dB down from 0.6 times it. A high-pass filter at 1/800 of the output rate, 20 Hz at 16 kHz, removes the offset of the microphone, and a gain of up to 42 dB brings speech up from the low levels microphones give it.

The first samples are silence, until the FIR has seen as many as it has taps and for a settling time the caller gives. tools/pdm/pdm_tables.py generates the tables.

Generated from PebbleOS 013613c8a. This page is maintained in the pebbleos repository: docs/libraries/pdm.md.