cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F411-disco low audio quality with PDM microphone

mgr
Associate II

Hi,

I'm struggling with recording audio on STM32F411-disco (MB1115D) board.

I'm trying to run dedicated to this board example (Audio_playback_and_record), but out of the box it just doesn't work - recorded file is all silence.

I've spend quite amount of time on that, and after borrowing logic analyzer, I found that, microphone do not output any data - looks like clock is too low. Audio_playback_and_record example uses 16Khz audio sampling, when I increase it to 48Khz  by changing below line:

#define DEFAULT_AUDIO_IN_FREQ                 I2S_AUDIOFREQ_48K

It kinda start working, there is finally some sound being recorded but there is also a lot of glitch there.

Overall quality is very low.

Given, that do I miss something here? I was expecting that it will be super easy weekend project since I have my board, my PDM mic on it and examples but reality isn't that beautiful 🙄

Attaching the recording, Thanks in advance.

1 REPLY 1
AScha.3
Chief

Hi,

I have no experience with pdm mics, but from ds MP45DT02 :

AScha3_0-1709587707555.png

( with 2ch - stereo , i assume )

at 16kHz *16b -> 256 khz (close to power down for the mics = zero output)

With PDM (= 1 bit modulation) you need hi speed data , decimate, then get good resolution.

The more data bits, the better the pcm signal.

From example here:

https://github.com/STMicroelectronics/x-cube-azrtos-f4/blob/befedcdd72388c9c9305eccf5208a19845c31b47/Drivers/BSP/STM32F411E-Discovery/stm32f411e_discovery_audio.c#L1048

see : decimation is 64, so with 16bit frames need 4x frame rate for desired sampling rate,

-> for 48kHz pcm audio need 192kHz input rate , giving 192k * 16 = 3,072 Mbit (close to max. frequ. for mic).

So look at your program and what bit rates you give to the PDMDecoder , deciding what quality you can expect.

If you feel a post has answered your question, please click "Accept as Solution".