2024-03-04 12:22 PM
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.
2024-03-04 01:42 PM - edited 2024-03-04 01:43 PM
Hi,
I have no experience with pdm mics, but from ds MP45DT02 :
( 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:
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.