Electronics > Microcontrollers

STM32 decibel meter

(1/3) > >>

reyntjensm:
I'm trying to design a decibel meter with STM32. I have a few microphones with an I2S interface. Since i have no previous experience with I2S, i'm having some difficulties to understand how this should be implemented. I've found the sound meter library ( https://www.st.com/resource/en/user_manual/dm00275616-sound-meter-library-software-expansion-for-stm32cube-stmicroelectronics.pdf ). But i don't understand how to implement this. Has anyone made something similar?

technix:
For getting sound into the chip, just follow the pinout to hook up the I2S bus to the MCU. Then it is all DSP processing so prepare your mind for intense math.

Are you going to do weighing? If not, you can just take the peak-to-peak value from the mic (a rolling maximum/rolling minimum operation to stay within the time domain) and run it through a transfer function to get the dB value. If you need weighing (as mostly do) you need to FFT the incoming samples and run that vector through the weighing function and then a transfer function. The purpose of the final transfer function is to allow calibration.

reyntjensm:
So i'm able to receive PDM data from the I2S interface. But it's still unclear to me if the Sound Meter Library can work with PDM or if the signal should be transformed into PCM signal?

SiliconWizard:

--- Quote from: reyntjensm on May 17, 2021, 05:32:46 pm ---So i'm able to receive PDM data from the I2S interface. But it's still unclear to me if the Sound Meter Library can work with PDM or if the signal should be transformed into PCM signal?

--- End quote ---

I don't get what you mean. I2S doesn't carry PDM.

hugo:

--- Quote ---Has anyone made something similar?
--- End quote ---

Andy Brown is also using an I2S microphone is his latest project:

https://andybrown.me.uk/2021/03/13/usb-microphone/

The code is available:

https://github.com/andysworkshop/usb-microphone

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version