0
\$\begingroup\$

I've seen previous answers on how to calculate the dB SPL based on my I2S readings but I can't come up with a formula to calculate it.

I use the MSM261S4030H0 I2S microphone with sensitivity of -26 dB FS and the bit resolution I am using with the I2S protocol is 16-bit. Based on previous answers when an input of 1 kHz and 1 Pa is applied to the microphone diaphragm the digital positive peak value of the output with 16-bit resolution will be 32767 * 0.0501 = 1641.

So then can I use a simple method for calculating the dB SPL in my code like if the reading of positive value is 1000 then the dB SPL will be dBSPL = 94*1000 / 1641 = 57.28?

\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

So then can I use a simple method for calculating the dB SPL in my code like if the reading of positive value is 1000 then the dB SPL will be dBSPL = 94*1000 / 1641 = 57.28?

No, you have to work in decibels.

If

amplitude = 1641 * 10^((dB - 94) / 20) 

then

dB = 20 * log(amplitude / 1641) + 94 

(where log is to the base 10).

So for a peak reading of 1000 that's 20 log(1000 / 1641) + 94 = 89.7 dB SPL.

Incidentally, that means that normal conversational volume (40-60 dB SPL at 1 meter distance) is only a digital reading of ±3 units at the low end, to ±30 units at the high end. Depending on your usecase, that might be a bit deaf.

\$\endgroup\$
1
  • \$\begingroup\$ Thanks for the answer. So I am planning to perform FFT to the input signal and get each frequency amplitude from there, will this formula "20 log(frequency amplitude / 1641) + 94" work to calculate the dBSPL ? Sorry but I dont have the knowledge wet to able to fully understand \$\endgroup\$ Commented Jun 17, 2024 at 23:26
0
\$\begingroup\$

No because you are just linearly scaling decibels and decibels are not linear units but a logarithmic ratio of two values. You can't use a simple method.

If 1642 is -26dBFS, 32767 is 0dBFS.

If your mic outputs -26dB FS with 94dB SPL reference tone, then converting calculated dBFS to dB SPL is simple - just add the offset in dB.

\$\endgroup\$
2
  • \$\begingroup\$ Thanks for the answer. Do you mean the offset of FullScale? For example if my reading is 900 the dBFS will be -31.22dBFS +94 and the dBSPL will be -31.22 +94 ? \$\endgroup\$ Commented Jun 17, 2024 at 23:37
  • \$\begingroup\$ @PhazeMusic No, because you already said 1621 equals -26 dB FS which equals 1 Pa which equals 94 dB SPL. \$\endgroup\$ Commented Jun 18, 2024 at 4:09

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.