cancel
Showing results for 
Search instead for 
Did you mean: 

B-L475-IOT01A - MEMS Microphone: Very noisy sound, I can't get a clear sound

MathieuOKS
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions

Ok, no audio-dac , but you have also the on chip dac , 2 x 12 bit.

I would try this to test the audio signal.

here:

AScha3_0-1703667299066.png

on "Arduino connector" :

AScha3_1-1703667374728.png

To use it, you have to modify the xx.ioc file, set PA4 + 5 : unused, then activate dac.

Then can see on a scope, what signal you producing or connect an amp, to listen...

 

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

View solution in original post

4 REPLIES 4
AScha.3
Chief III

Hi,

to send the sampels on uart (16k x 32bit ->) need 1Mbit serial...what you use now ?

+

to hear it, i would connect an dac, maybe a old audio dac like TDA1387, or send data to on chip dac, for a test is the most easy - and you can hear, what comes out. (I am not sure - but most stm cpu have a 12bit dac )

And check with a scope.

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

Thank you for your answer ! I don't have any audio dac around me so it's will be difficult. I've tried to find solutions related to the DAC but I'm still looking for a way. Do you have an easy or inexpensive solution or do I have to use an external module?

(And for the sample on UART, you are right, as the comment on Octave, i have one 230400 bauds. I think it's not the best solution).

Ok, no audio-dac , but you have also the on chip dac , 2 x 12 bit.

I would try this to test the audio signal.

here:

AScha3_0-1703667299066.png

on "Arduino connector" :

AScha3_1-1703667374728.png

To use it, you have to modify the xx.ioc file, set PA4 + 5 : unused, then activate dac.

Then can see on a scope, what signal you producing or connect an amp, to listen...

 

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

Yes, I checked the documentation and there is a DAC on pins PA4 and PA5. I will try to use an amp. Thanks for the advice!