1
\$\begingroup\$

I've seen 20*Log10(amplitude) as the proper way to calculate dB, where 0 < amplitude <= 1. (So, to get amplitude when signed integer data types are used to represent amplitudes, you use value/maxvalue for positive values and value/minvalue for negative values.)

I know this formula generates 0 for extreme values and negative numbers for everything else. I also know it's showing a relationship between the sample and an extreme sample value. Is this properly called dBu or dBv or something else? I've seen both, plus just "dB".

I didn't study electrical engineering, so as close as you can get to a layman's explanation of why a particular unit is correct would also be helpful.

\$\endgroup\$
  • \$\begingroup\$ Your input doesn't have to be less than one. It rarely is, in fact. dBu means dB over micro(volts/amps/etc, whichever is relevant; dBμV would be less ambiguous), dBV is dB over volts, etc. \$\endgroup\$ – Hearth Feb 6 '19 at 17:04
2
\$\begingroup\$

Your confusion seems to be related to not understanding exactly how decibel measurements work. You say \$20·\log_{10}(amplitude)\$, but this isn't quite correct.

The proper formula is \$20·\log_{10}(\frac{amplitude}{reference})\$, where \$reference\$ is your reference value. The choice of reference value is what determines the full symbol used; if \$reference = 1\mathrm{μV}\$, for example, then the unit would be written as dBμV or dBuV. Likewise, with a millivolt reference, you would write it as dBmV. Current quantities are also written this way, dBμA for example.

Note that the formula is different when dealing with power quantities. With a power measurement, you use \$10·\log_{10}(\frac{amplitude}{reference})\$. The reason 10 is used instead of 20 here is because of the quadratic relationship between power and voltage or power and current.

\$\endgroup\$
  • 2
    \$\begingroup\$ I think that the OP's question boils down to "what reference is used in DSP" -- and I haven't seen one used at all. You see dBm (reference = 1mW), dB\$\mu\$, dBV, dBA -- but I haven't seen dB(lsb) or dB(full range). It tends to make me think that it's not such a useful quantity, or the community would have invented it out of necessity. \$\endgroup\$ – TimWescott Feb 6 '19 at 17:24
  • 3
    \$\begingroup\$ Yes, I'm definitely confused. You might be overgeneralizing the answer, though. The application is a digital audio recording, so the signal voltage of the original analog audio is long gone. All I have is a bunch of integers from -32768 to 32767 (for a 16-bit samples). A lot of audio software tells you how many dB a peak is from 0. The value is always zero or negative because 0 dB represents the loudest recordable amplitude. I think I see that the reference is the loudest recordable amplitude. I'm still confused as to what type of dB unit (if any) is appropriate. \$\endgroup\$ – trw Feb 6 '19 at 17:24
  • \$\begingroup\$ @TimWescott Ah, if they're asking about a very specific subfield, I won't be able to answer then. I have essentially no background in DSP work. \$\endgroup\$ – Hearth Feb 6 '19 at 17:27
  • 2
    \$\begingroup\$ Without a conversion factor to calculate voltage from the sample values, all you can do is use "dBFS" - that's "decibels relative to full scale." \$\endgroup\$ – JRE Feb 6 '19 at 18:02
  • \$\begingroup\$ I'd go with dBfs, except if it's established practice to just use "dB" with no qualifier, then you're going to engender confusion by tacking on the units that should be there anyway. \$\endgroup\$ – TimWescott Feb 6 '19 at 18:43
2
\$\begingroup\$

Based on your comments it sounds like you are calculating dB levels with a reference level of full scale (an integer value of 32767 in your case).

According to NIST Pub 811 section 8.7, you should always write the value with a subscript to indicate what kind of quantity you are measuring and explicitly include the reference level. So, if you were talking about a ratio of voltages you might say

$$ L_V (re full scale) = -6\,\mathrm{dB} \quad\text{ or }\quad L_{V(full scale)} = -6\,\mathrm{dB} $$

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.