Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample rate lower than 16000 may cause some PDM microphone to stop outputting data #17

Open
rxing365 opened this issue Jul 23, 2022 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@rxing365
Copy link

The output frequency of the clk pin is calculated by the sample rate, and some PDM microphone has a limited frequency range for clock speed (Like MP34Dxxx has a clock rate limit from1 to 3.25 MHz), which causes the sample rate below 16000(Corresponding to the clk frequency of 1.024MHz) to sometimes fail to make the microphone work.

@sandeepmistry sandeepmistry added the help wanted Extra attention is needed label Jul 25, 2022
@sandeepmistry
Copy link
Member

Hi @rxing365,

How do you suggest this be addressed? Would you like to see a new API added?

Would changing the PDM_DECIMATION macro to 128 work for your use case?

@rxing365
Copy link
Author

Really appreciate your reply. I tested it on my adafruit board and it works. I'm trying to run some voice recognition algorithms on pi pico, it doesn't need much sound quality, the high sample rate is a big challenge for memory. A sample rate of 8000Hz is a reasonable value for my audio buffer, but it would be more convenient to have an API that would allow me to set a lower value. The PDM to PCM conversion seems to be implemented with a lookup table, does that mean it would be hard to implement functions for arbitrary decimation values? It would be a cool feature if the library could automatically adjust the decimation settings to a range acceptable to the sensor, or manually set arbitrary decimation values.

@sandeepmistry sandeepmistry added the enhancement New feature or request label Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants