B-L475-IOT01A - MEMS Microphone: Very noisy sound, I can't get a clear sound
Hello dear ST-Forum,
I have a problem that I can't solve, the sound coming from the microphones is very noisy and none of the acquired data sounds like a sound and this despite all the documentation (MP34DT01 datasheet, AN4990, AN5027, ...) and videos (STM on youtube) that I have seen.
I use an Octave program to retrieve the sound data from the UART port.
My DFSDM configuration is: 80MHz audio clock, divide by 40. So I have 2MHz PDM clock and I use a low-pass filter (Sinc 3 filter) with FOSR=125 so I capture a signal at 16 kHz. The card has 2 stereo microphones, so I didn't forget to put a channel on the rising edge and a channel on the falling edge.
Here's the code for the microcontroller program and for the Octave program.
For the variables:
#define AUDIO_REC 2048
int32_t RecBuff0[AUDIO_REC];
int32_t RecBuff1[AUDIO_REC];
int8_t FullConv0 = 0;
int8_t HalfConv0 = 0;
int8_t FullConv1 = 0;
int8_t HalfConv1 = 0;
int32_t PlayBuff0[AUDIO_REC];
int32_t PlayBuff1[AUDIO_REC];
I only use STM32CubeIDE debugger (Live Expressions for variable) and Octave to visualize the samples, but if there's a better way I'd like to hear it.


