Regarding gain of the microphone

I had installed edge impulse Arduino nano 33 ble sense firmware in January and then I downloaded the updated version in July.
In both the versions installed, there is a difference in the quality of the signal collected by the microphone.
For the January version, the signal quality is good and the gain is less.
In the July version of the firmware, the gain is very high and the signal is also very noisy.

I tried lowering the gain in the July version of the firmware but still, the signal remains noisy. I could not find what changes in code correspond to such a result.

Can I know what kind of processing is applied on the signal in the January version of the firmware or what exactly changed in the code in the last few months that might have led to such results?

Hi @dhruvilodhavia,

We’ve changed the PDM gain of the microphone in July. Previous setting was:


Current setting is:


You can change this value in the ei_microphone.cpp file in the SDK. Or in the *.ino when using the library export.


Hi @Arjan, thank you for replying.
I changed the gain to PDM.setGain(127) in the old firmware(in 2 locations in ei_microphone.cpp).
An audio of breathing was recorded. This is how it looks like

For the current firmware, for the same audio, the waveform looks like this -
Are there any other changes in the code because for the same gain I’m getting different waveforms for different firmware versions?

Thanks in advance!

Hi @dhruvilodhavia,

The position of the PDM.setGain(127) function has also changed. In order to have effect it should be placed after the PDM.begin function.

Hope this helps!

1 Like