Conversion from counts to dB

I have a sound signal, recorded by a hydrophone, which units are counts. I would like to convert the counts into dB re uPa (Decibels relative to microPascals), is that possible?

• um, dB is a relative measure. So, dB relative to what? – Marcus Müller Nov 21 '19 at 14:50
• counts? I never heard of this as a unit. Can you provide a definition? – Hilmar Nov 21 '19 at 14:56
• Excuse my lack of details, I am interested in counts relative to micripascals (uPa) since I have calibration data in the mentioned units. Counts are related to the bit depth. The hydrophone samples at 24 bit. – Berna Gomez Nov 21 '19 at 15:23
• @Hilmar when I've used "counts" as a unit it's been when an ADC or shaft encoder has been involved. 1 count = 1 LSB. – TimWescott Nov 21 '19 at 15:52
• It's not clear what your problem is. Do you understand what dB relative to something means? A voltage in dBv means take the voltage, divide by 1V (the reference, that's the 'v' on the end of dBv), then take $\log_{10}$, then multiply by 20 because it's a scalar quantity and not a power. So 10V is 20dBv, 100V is 40dBv, etc. So dBuP (assuming that's the notation you use) would mean take the sound pressure in $\mu\mathrm{Pa}$, divide by $1 \mu\mathrm{Pa}$, take $log_{10}$, multiply by 20 (I assume -- $\mu\mathrm{Pa}$ denotes a pressure, not power), and you're done. – TimWescott Nov 21 '19 at 18:17

As a lot of people said in the comments if you have the sensitivity of your hydrophone (which you state that you do) and consider you are using your equipment in its linear regime, then you should be able to find the value in $$\mu Pa$$. From that, you could easily convert to $$dB$$.

The process is quite simple. I will illustrate an example here, taken from a real-life sound level survey equipment. It is quite normal for such microphones to exhibit a sensitivity of the order of $$30 mV/Pa$$. This means that when you measure the voltage output you can convert directly from voltage to pressure. As an example, let's assume that we measure at the output of the microphone an RMS voltage value of $$108 mV$$. From the sensitivity of the microphone, we know that for a pressure of $$1 Pa$$, the output should be $$30 mV$$, so now we can divide our output by the microphone's sensitivity (if you are not sure how we end up with this result you can look for the rule of three, which is exactly how you reach that) to get the pressure in $$Pa$$ that corresponds to the measured voltage. That is

$$Pressure = \frac{V_{out}}{sensitivity} \implies Pressure = \frac{108 mV}{30 \frac{mV}{Pa}} \implies Pressure = 3.6 Pa$$

Now, keep in mind that here, you have to take into account the possible gain of a preamplifier. That is if there is equipment with gain other than unity after the microphone you have to compensate for that. For example, in our case, if there was a pre-amplification stage after the microphone with a gain of 2, then we should have used a value of $$\frac{108 mV}{2} = 59 mV$$, which corresponds to the output of the microphone. This could also be done by subtracting the gain in $$dB$$ from the result (see next step).

Next step from that is to use the appropriate reference to convert to an absolute decibel value. In the air, the most widely used reference value is $$20 \mu Pa$$ (which is considered to be the hearing threshold for a healthy average person for a steady tone with a frequency of $$1 KHz$$). So, using that and taking into account that pressure is a derived, field quantity we get (SPL here stands for Sound Pressure Level)

$$SPL = 20 \log_{10} \left( \frac{p}{p_{ref}} \right) \implies SPL = 20 \log_{10} \left( \frac{3.6 Pa}{20 \cdot 10^{-6} Pa} \right) \implies \\ SPL = 20 \log_{10} \left( 0.18 \cdot 10^{6} \right) \implies SPL \approx 20 \cdot 5.255 \implies SPL \approx 105.1 dB ~ re ~ 20 \mu Pa$$

Again, if we had an element with gain other than unity, this could be subtracted from this result. For example, a gain of 2 like above corresponds to a gain of $$6 dB$$ which we should subtract from this result (if not done in the previous step). This would give a result of about $$105.1 - 6 = 99.1 dB_{SPL}$$.

In the exact same way, you can calculate your quantities but instead of $$mV$$, you will use counts (since this is the quantity you have and the sensitivity is given in this quantity too).

Now, if you have the sensitivity in $$dB$$ as you state, all you have to do is to first convert that to $$counts/\mu Pa$$ and use that in the same way we used $$mV/Pa$$ sensitivity. In order to convert from $$dB$$ to linear scale, you use the properties of the logarithm and solve like

$$dB = 10 \log_{10} \left( x \right) \implies \frac{dB}{10} = \log_{10} \left(x \right) \implies x = 10^{\frac{dB}{10}}$$

where x is the value you are seeking (the linear value corresponding to the $$dB$$ value shown in your sensitivity rating), $$dB$$ is the sensitivity value you have. Now, you have to keep in mind that instead of the multiplier of the logarithm being $$10$$, it might be 20 (I haven't encountered any other value so far, but I don't know the counts as a unit either, so I can't say for sure) depending on the way it is derived.

Hope this helped somehow.

• Thank you so much for your great and intuitive response. In my case, the calibration file is in "dB re counts uPa", those exact words is the only information that the file provides. What I do is, first I multiply my signal obtained from the .wav file by 3 since the voltage peak to peak is +-3V, and the .wav is normalized to 1, then I multiply it by (2^(24-1)) in order to convert it to counts. And finally in order to convert it to Pascals I divide my signal by (10^(x/20)*1000000), where x is my sensitivity in "dB re counts uPa". Do you think is correct? – Berna Gomez Feb 25 at 16:02
• Seems right to me... As I said I am not familiar with the counts unit, but if it what TimWescott suggests then it should be fine. – ZaellixA Feb 29 at 16:05
• Intuitive and clear, +1 – Berna Gomez Mar 11 at 12:13