From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert PCM buffer to dB SPL

Hi, I have a system that is meant to play sound at very high volume (up to 130 dB). In order to check the actual volume inside this system, there are four microphones. These microphones are INMP411 ( http://43zrtwysvxb2gf29r5o0athu.wpengine.netdna-cdn.com/wp-content/uploads/2015/02/INMP411.pdf ) which have a linear response up to 131 dB and a sensitivity of -46 dBV. I receive the PCM buffer (int16) and want to convert it to a dB SPL value. At the moment the stesp I've done are:

 

1) Divide the maximum output voltage of the microphone by 32767 and multiply it by the PCM RMS value (thus obtaining Voltage RMS)

2) Convert voltage to dB:      dB = 20Log(V RMS/V 0)

3) Convert dB to dB SPL:      dB SPL = dB -46 +94 +offset - gain amplifier   (in  my case gain amplifier should be 0)

 

But something is wrong because the obtained values are very different from the ones of the phonometer that I'm using to calibrate the microphones. I'm not sure about the steps I've done because searching in the net I've found a lot of different "versions" about how to convert from PCM to dB SPL.

 

Can someone please help me to clarify this concept? Any suggestion is really appreciated!

0 Kudos
Message 1 of 3
(4,001 Views)

Hi,

can I ask you what is the term V0 in your expression? It's obtained as 10^(sensitivity/20), but I can't understand the meaning.

Besides which are the values you expect?

A little adjustment in your code can be avoiding the coercion (the red point you can see at the input of the RMS vi), it happens because numerical formats don't match. You can easly do it inserting a conversion block "to dlb" between PCM buffer and RMS vi. The same thing can be done for the input of the first division block, changing the representation of 32767 to double.

0 Kudos
Message 2 of 3
(3,953 Views)

Thanks Charls. I've found that the correct formula is:

 

dB SPL = 94 +46 - 20Log(V RMS)

 

Anyway I still have problem with my results, but at this point I think there is something wrong with the phonometer



0 Kudos
Message 3 of 3
(3,892 Views)