ArmDeveloperEcosystem / microphone-library-for-pico

Capture audio from a microphone on your Raspberry Pi Pico or any RP2040 based board. 🎤
Apache License 2.0
253 stars 49 forks source link

What is the maximum sample-rate? #20

Open sail2themoon opened 2 years ago

sail2themoon commented 2 years ago

Assuming the PDM-mic is capaple of doing this: What is the maximum audio sample rate for the Pi pico 2040 and this library? Are 192KHz or even 384KHz possible?

Kind regards

sandeepmistry commented 2 years ago

Hi @sail2themoon,

This is a great question. I've only tested 8 kHz and 16 kHz myself.

Please let me know if you've managed to get a higher sampling rate working.

sail2themoon commented 1 year ago

the highest sample-rate I can get to work is 88KHz. The strange thing is: 80Khz does not work: loud crackling in the recording. I've tried also 37KHz and 62KHz, just to have some other non-regular sample-rates. They are fine. This is my mic: SPH0641LU4H-1

Edit: 99KHz is also working, while 86Khz is not...This is weird.

sail2themoon commented 1 year ago

This is a spectrogram of the 99KHz recording clicking my fingers: https://i.postimg.cc/kMVv8N2F/Bildschirmfoto-vom-2022-12-27-21-20-49.png There is some silent hiss above frequencies humans can hear, and I don't know if that's a recording error or if that sound was some interference of a device here. But the recording sounds fine. You can also see, that there is data at those high frequencies. So the mic really gets something.

lafar6502 commented 1 year ago

@sail2themoon i have a question to you - it appear's you're using SPH0641LU4H Knowles microphone, which i'm also interested in. Would like to build an ultrasonic-range sound level meter (up to 40kHz would be fine). My question is - is this microphone suitable for the purpose, in your opinion? And does it work trouble-free with sandeepmistry's pico pdm library, or are some modifications necessary? Best regards RG

sail2themoon commented 1 year ago

Hi RG, I think the mic can to that well, as seen in the datasheet. But you have to sample with 80KHz then, for picking up 40Khz waves. The pdm library got me confused.. As I wrote some sample-frequencies go well, a slightly higher suddenly won't, an even higher works again, then again some which won't work... So trouble-free: I'd say no. I think first someone must find the right way to get data from it at high sample-rates.

VoiceMagician commented 3 months ago

I have try 16kHz, 32kHz, 48kHz, 60kHz and 64kHz, they can work except 64kHz.