Skip to main content
Visitor II
March 3, 2021
Solved

Hello all, 1)How to calculate the dB SPL for a MEMS mic captured PCM values in a log file .?? What are the in particular parameters of the mic ics43432 ? 2)How do we add the acoustic_dB library to a STM32f4xx ?

  • March 3, 2021
  • 1 reply
  • 1838 views

My second question continues to be the how can this PCM value be converted to .wav format?

i still need a deeper understanding into this domain , anybody over here can post suggestions ,links technical articles and can share their experiences for my learning would be really be appreciated .

Take care all

Thanks in advance.

Kind Regards

--

Shweta

    This topic has been closed for replies.
    Best answer by Eleon BORLINI

    Hi Shweta,

    hope you are staying safe as well too

    >> Can we capture/acquire PCM audio samples upto minimum 5000 or more till what could be the maximum ,since the stm32f4 nucleo board has 128K SRAM. So that the dB calculation can be classified as to normal human ear audible or not?

    The audible range for the human ear spans theoretically from 20kHz to 20kHz, but actually the bandwidth is lower, i.e. 50Hz to 15kHz. Consider also that there is an additional filter in the calculation, that simulates the ear frequency response curve, the A-weighted filter, which is centered around 2kHz and start decreasing after 5kHz. My suggestion would be use the 16kHz standard, an acceptable trade off between the available memory on one side, and the fidelity, capability of acquiring human speech frequency (max 8kHz) and audible bandwidth on the other side.

    >> How to set the exact baud rate for applications like these in general?

    You should set a Baud rate at least equal to the PCM frequency x bit depth of the audio word, but better if it is at least 1.5 times greater.

    -Eleon

    1 reply

    ST Employee
    March 4, 2021

    Hi Shweta,

    >> 1) How to calculate the dB SPL for a MEMS mic captured PCM values in a log file?

    For a generic rule to convert the PCM wav file into dBSPL, I would suggest you this post on NI community. ST implements this feature in the library of the following point.

    >> 2) How do we add the acoustic_dB library to a STM32f4xx ?

    I probably already tell it to you, but I suggest to give a look and use the X-CUBE-MEMSMIC1 firmware package, and in particular the Microphones_Streaming project that you can find in the \Projects\STM32F401RE-Nucleo\Demonstration\CCA02M2\Microphones_Streaming folder.

    >> My second question continues to be the how can this PCM value be converted to .wav format?

    The project enables the streaming of the PCM (converted from the PDM) towards a host PC via a dedicated USB Audio Input driver. You could acquire it for example with Audacity and save as .wav file.

    Let me know if these info can be of some help for you.

    -Eleon

    SG.4Author
    Visitor II
    March 5, 2021

    Hi Eleon,

    Hope your doing fine and staying safe.

    >> Yes I got the generic conversion point of PCM in dBSPL and ST implementing this feature as you had told earlier

    (STM32CubeFunctionPack_SMARTMIC1_V2.2.0\Middlewares\ST\STM32_AcousticDB_Library )and even in my first post older the above mentioned application of microphones streaming.

    and the other includes (STSW-BCNKT01_V2.3.0\Projects\BlueCoin\Applications\AudioLoop)

    I have downloaded all of them the instant you have shared it , still further deeper study research is required for me.

    >> I found (/how-to-calculate-db-from-the-mems-microphone-data) answered by you on the some other post ,I found this after posting the question:face_savoring_food:

    the explanation there cleared most of my doubts ,thanks for that.

    >>I have one last questions for now Can we capture/acquire PCM audio samples upto minimum 5000 or more till what could be the maximum ,since the stm32f4 nucleo board has 128K SRAM..so that the dB calculation can be classified as to normal human ear audible or not. ?

    >> How to set the exact baud rate for applications like these in general.?

    these generic ones

    Many of the questions are mainly repetitive I guess, but your time ,patience and suggestions are highly appreciated .. thanks a lot. ;)

    Kind Regards

    --

    Shweta

    ST Employee
    March 5, 2021

    Hi Shweta,

    hope you are staying safe as well too

    >> Can we capture/acquire PCM audio samples upto minimum 5000 or more till what could be the maximum ,since the stm32f4 nucleo board has 128K SRAM. So that the dB calculation can be classified as to normal human ear audible or not?

    The audible range for the human ear spans theoretically from 20kHz to 20kHz, but actually the bandwidth is lower, i.e. 50Hz to 15kHz. Consider also that there is an additional filter in the calculation, that simulates the ear frequency response curve, the A-weighted filter, which is centered around 2kHz and start decreasing after 5kHz. My suggestion would be use the 16kHz standard, an acceptable trade off between the available memory on one side, and the fidelity, capability of acquiring human speech frequency (max 8kHz) and audible bandwidth on the other side.

    >> How to set the exact baud rate for applications like these in general?

    You should set a Baud rate at least equal to the PCM frequency x bit depth of the audio word, but better if it is at least 1.5 times greater.

    -Eleon