atomic14 / esp32_audio

Sample code for reading audio samples from the ESP32 ADC using I2S
Creative Commons Zero v1.0 Universal
391 stars 109 forks source link

Noisy audio #8

Closed caioyugo123 closed 3 years ago

caioyugo123 commented 3 years ago

Hello, I've been trying to capture audio and send it via wifi just as described in the project. But, as soon as I play the RAW file, it is just a noisy audio without a trace of any captured voice. I checked over the code but didn't see anything wrong, although I'm very new to programming in general. I'll be linking the audio acquired via wifi. I'll be very much appreciated for any help, thanks.

adc.zip

cgreening commented 3 years ago

That's very strange. I would expect to see at least some recognisable audio.

Can you show me how the microphone is wired up? Which microphone board are you using?

caioyugo123 commented 3 years ago

I am currently using a esp32 with a max9814 as the image attached below shows. I did a pass low filter, four 330ohm resistors in parallel with four 100microF capacitors also in parallel, in order to supply a more steady voltage in the Vpp pin. But it didn't change much as the audio shown.

10812d1d-0b16-49de-bf81-1ff32bacb956

cgreening commented 3 years ago

I can't quite follow your low pass filter - I assume you get the noise even when you directly connect Vdd to 3v3?

You can try connecting the gain pin to 3v3 as well which will reduce the amount of gain the microphone is applying.

caioyugo123 commented 3 years ago

I meant by doing as follows:

dd368615-9b9e-45c0-a4c1-4c94d37551b4

I'll try connecting the gain pin.

caioyugo123 commented 3 years ago

Ok, so I tried but it did not work. But, I noticed that during a certain time the audio caption worked. I was measuring voltage and poking the MAX9814 during the recording. Even though, I am not aware the reason why it worked.

adc (2).zip

cgreening commented 3 years ago

Can you try running the loop_sampling project? This will just output the value read from the ADC on the serial output.

In a quiet room, this should give you around 1.25v and it should range from about 0.25v to 2.25 volts when there is sound.

This will let us quickly check if the microphone is output sensible values.

caioyugo123 commented 3 years ago

Ok, I just uploaded to the ESP32 and then monitored the serial monitor.

serial monitor.txt

cgreening commented 3 years ago

So, unless you are in a very noisy room this doesn't look good.

We should be seeing around 1250 for the mV values, but instead we are seeing some quite extreme values.

I would double check all your wiring and solder connections. It's also worth trying to power the the microphone from a battery as well just in case it's noise on the power line causing the issues. Two AA batteries will work.

caioyugo123 commented 3 years ago

Unfortunately, it is not the case. Maybe I'll be testing with the loop sampling and will report any progress. Also, I'll try buying these AA batteries.

StuartIanNaylor commented 3 years ago

Is it just me or is out connected to gnd? Its hard looking at a picture. Oh no it does loop over.

On a Pi into a sound card those Max9814 are actually really good as long as you don't use the top gain (float). 40db/50db is loads of gain but the 60db seems wishful thinking.

Try this analogue mic as they are exceptionally good for noise https://www.ebay.co.uk/itm/ADMP401-MEMS-Microphone-Breakout-Module-Board-For-Arduino-Universal-1-3cm-1cm-UK/192101467145

I would post aliexpress but it seems to be doing the UK thing again.

Maybe its just the board and the ADC as I have a RockchipS RK3308 that is the same but on a pi via sound card great.