Hi there,
I'm working with an ST MP34DT05-A PDM microphone on a custom PCB and attempting to use the Microphone_PDM library as a simple way to interface with it. However, I'm encountering an issue where my voice is clearly audible and at the correct speed, but there is crackling and pops all over the audio which makes it unusable.
I saw that the library is supposed to work with Adafruit's PDM mic, and the mic element itself on that breakout looks fairly similar to the one I am using after scrolling through the datasheet. I did notice the comment in the example I am using (2-buffer
) about setting the correct range, and while I assumed that this mic was also 12-bit I tried all the available range options while set to unsigned 8bit output size and 16kHz sample rate as a sanity check, but the 2048 range sounded the most audible.
In my past experience with I2S I've had a lot of trouble getting stereo/mono audio correct, but in this case looking at the waveform it doesn't seem like the issue is that one channel is just floating or a similar issue like that, it's prolonged multi-sample pops.
Here's a clip of audio I recorded with 12-bit range, 16kHz, 8-bit unsigned:
Also, here's what the schematic looks like for the board. There's other stuff on it as well but nothing crazy, and the mic is within a couple centimeters of the P2 pins. A0 and A1 go to those respective pins on the P2 running device OS 5.6.0. Finally I'm using xxd -r -p test.hex test.wav
in git-bash on Windows to convert from the hex string that I'm getting from the P2.