ESP32 PDM audio decoding

Tomahawk_SMH
Posts: 5
Joined: Mon Jul 18, 2022 5:54 pm

ESP32 PDM audio decoding

Postby Tomahawk_SMH » Tue Jul 19, 2022 7:10 pm

Hello!
I have an ICS-41350 MEMS microphone with PDM output and a project to record and play the sound with an ESP32 mcu board. There are two main parts: 1.recording from mic and getting data in pdm format 2.proccessing the audio and and sending it to DAC.
for the first I'm gonna use I2S.h library in arduino framework. For the second I have two options: using external hardware or bit-banging the pdm audio to analog signals. First one is currently not an option and I really would like to use the second option.
is there any libraries or Freertos APIs for this purpose (or similar) ?
I'd appreciate the help.

Sprite
Espressif staff
Espressif staff
Posts: 10596
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 PDM audio decoding

Postby Sprite » Wed Jul 20, 2022 4:16 am

The ESP32 I2S peripheral actually can do PDM to PCM decoding in hardware. I have no idea if that functionality is exposed in Arduino libraries, though.

Tomahawk_SMH
Posts: 5
Joined: Mon Jul 18, 2022 5:54 pm

Re: ESP32 PDM audio decoding

Postby Tomahawk_SMH » Tue Jul 26, 2022 9:24 am

The ESP32 I2S peripheral actually can do PDM to PCM decoding in hardware. I have no idea if that functionality is exposed in Arduino libraries, though.
Is there any other way to use the PDM to PCM decoding in other frameworks?

Sprite
Espressif staff
Espressif staff
Posts: 10596
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 PDM audio decoding

Postby Sprite » Wed Jul 27, 2022 12:58 am

As most other frameworks are based on ESP-IDF, you should be able to use the ESP-IDF I2S driver there as well.

Shanjai_247
Posts: 2
Joined: Tue Apr 15, 2025 3:30 pm

Re: ESP32 PDM audio decoding

Postby Shanjai_247 » Tue Apr 15, 2025 3:44 pm

Hi, were you able to successfully decode the pdm audio to pcm using the Arduino IDE?. Im working with im69d130 mic where im unable to convert the pdm to pcm format.

.mode = i2s_mode_t(I2S_MODE_MASTER | I2S_MODE_RX | I2S_MODE_PDM),

Would the I2S_MODE_PDM work on the arduino ide?

Who is online

Users browsing this forum: Google [Bot] and 4 guests