DSPRelated.com
Forums

Amplitude Decibel conversion problem

Started by jungledmnc October 7, 2008
Hi,
this question might be very trivial, but I haven't found good explanation
anywhere else.

I have an audio signal - some sine. Use a wavelabl to look at the
waveform, and its maximum is at about 0.6. When I change the display into
dB it shows about -5dB at that level. 
But this does not make sense - the formula is 10*log10(amplitude). So it
should be -2.5dB. I have found, that this is because we use squares for
comparison :
10 * log10(amp1^2 / amp2^2) = 20 * log10(amp1 / amp2)

They say it is often used in electronics to compare voltages, but why is
it used in digital audio? Yeah I know that the digital values are
equivalent to resulting electrical power, but we are not comparing anything
to anything. So why should we square?

And if so, then when should we NOT square?

Thanks a lot.
dmnc
On Oct 7, 2:52&#4294967295;pm, "jungledmnc" <jungled...@gmail.com> wrote:
> Hi, > this question might be very trivial, but I haven't found good explanation > anywhere else. > > I have an audio signal - some sine. Use a wavelabl to look at the > waveform, and its maximum is at about 0.6. When I change the display into > dB it shows about -5dB at that level. > But this does not make sense - the formula is 10*log10(amplitude). So it > should be -2.5dB. I have found, that this is because we use squares for > comparison : > 10 * log10(amp1^2 / amp2^2) = 20 * log10(amp1 / amp2) > > They say it is often used in electronics to compare voltages, but why is > it used in digital audio? Yeah I know that the digital values are > equivalent to resulting electrical power, but we are not comparing anything > to anything. So why should we square? > > And if so, then when should we NOT square? > > Thanks a lot. > dmnc
Hello dmnc, dB = 10*log(power/power_reference) now since power is proportional to amplitude squared then dB = 20*log(amplitude/amplitude_reference) With dB we are really always talking about power relative to a reference power. Even in acoustics, we have 100 dB is 0.946 watts per square meter. I hope this helps. Clay
jungledmnc wrote:
> Hi, > this question might be very trivial, but I haven't found good > explanation anywhere else. > > I have an audio signal - some sine. Use a wavelabl to look at the > waveform, and its maximum is at about 0.6. When I change the display > into dB it shows about -5dB at that level. > But this does not make sense - the formula is 10*log10(amplitude). So > it should be -2.5dB. I have found, that this is because we use > squares for comparison : > 10 * log10(amp1^2 / amp2^2) = 20 * log10(amp1 / amp2) > > They say it is often used in electronics to compare voltages, but why > is it used in digital audio? Yeah I know that the digital values are > equivalent to resulting electrical power, but we are not comparing > anything to anything. So why should we square? > > And if so, then when should we NOT square? > > Thanks a lot. > dmnc
I checked your numbers. You need to pay close attention to what is being compared when you talk about dB. Because, dB is always a comparison of amplitudes. You say "its maximum is about 0.6" but don't give any dimensions like "volts" for example. Then, you don't give the reference which is usually 1 volt.... but that is *usually* understood to mean 1vrms. So, 1vrms would be 0dB. From 20log(0.6) I get -4.4dB ... which really means 20log(0.6) - 20log(1.0) so the dimensions are likely mixed: Peak voltage for the 0.6 and rms voltage for the 1.0. Converting 0.6v peak to rms is 0.6 x 0.707 = 0.42 vrms 20log(0.42) = -7.4dB So, I'm not sure where you are on all this with your wavelab1.
clay@claysturner.com in *ERRROOOORRRR* wrote:

> > Even in acoustics, we have 100 dB is 0.946 watts per square meter. >
I would agree IF *and only* IF you stated dbV, dbm, or db.... with stated/implied load/impedance/**** Signed: local (not so quite) nit picker
glen herrmannsfeldt <gah@ugcs.caltech.edu> writes:

> Richard Owlett wrote: > >> clay@claysturner.com in *ERRROOOORRRR* wrote: > >>> Even in acoustics, we have 100 dB is 0.946 watts per square meter. > >> I would agree IF *and only* IF you stated dbV, dbm, or db.... with >> stated/implied load/impedance/**** > > I presume that is for a propagating wave in air. The actual power > that goes into some detector (or other medium) depends on the > impedance in that medium.
But it's just like the electrical situation - if we assume the same impedance for the reference as for the measured signal, the two cancel and don't really matter - we can compute it from the amplitudes (or equivalently, sound intensities). I think Richard is right. I think what Clay meant was 100 dB SPL. -- % Randy Yates % "Watching all the days go by... %% Fuquay-Varina, NC % Who are you and who am I?" %%% 919-577-9882 % 'Mission (A World Record)', %%%% <yates@ieee.org> % *A New World Record*, ELO http://www.digitalsignallabs.com
Richard Owlett wrote:

> clay@claysturner.com in *ERRROOOORRRR* wrote:
>> Even in acoustics, we have 100 dB is 0.946 watts per square meter.
> I would agree IF *and only* IF you stated dbV, dbm, or db.... with > stated/implied load/impedance/****
I presume that is for a propagating wave in air. The actual power that goes into some detector (or other medium) depends on the impedance in that medium. For an EM wave in a wire, you need the impedance, in air you don't. -- glen
On Oct 7, 2:52&#4294967295;pm, "jungledmnc" <jungled...@gmail.com> wrote:
> Hi, > this question might be very trivial, but I haven't found good explanation > anywhere else. > > I have an audio signal - some sine. Use a wavelabl to look at the > waveform, and its maximum is at about 0.6. When I change the display into > dB it shows about -5dB at that level. > But this does not make sense - the formula is 10*log10(amplitude). So it > should be -2.5dB. I have found, that this is because we use squares for > comparison : > 10 * log10(amp1^2 / amp2^2) = 20 * log10(amp1 / amp2) > > They say it is often used in electronics to compare voltages, but why is > it used in digital audio? Yeah I know that the digital values are > equivalent to resulting electrical power, but we are not comparing anything > to anything. So why should we square? > > And if so, then when should we NOT square? > > Thanks a lot. > dmnc
dB's always compare one power to another power by the formula that you have written down. In electronics we often do not directly measure power, but rather voltage. Most of our measuring equipment measures things in voltage. So we are stuck in a position where we want to compare one power level to another power level, but our measuring equipment measures voltages. (Also in DSP most of the time the A/D converter is getting a voltage equivelent input) To properly compare one power level when we made the measurement in voltage you have to first convert the measured voltage level into a measured power level, and the reference voltage level into a reference power level. Here is where the shortcut comes in, but remember, dB's always compare power levels. It is the definition. But when you are comparing voltage levels, it turns out you get to use the trick of multiplying by 20*log(ratio) instead of 10*log(ratio), becuase power proportional to the voltage squared. so 10*log(V1^2/ V2^2) is the same as 20*log(V1/V2). This is a shortcut or trick. Always go back to dB's compare power per the definition formula 10*log(P1/P2). The 20 log thing comes into play becuase in the real world you rarely measure power directly. You measure voltages directly, and then apply the 20* trick to convert the voltages to power.
On Oct 7, 11:07&#4294967295;pm, buleg...@columbus.rr.com wrote:
> On Oct 7, 2:52&#4294967295;pm, "jungledmnc" <jungled...@gmail.com> wrote: > > > > > > > Hi, > > this question might be very trivial, but I haven't found good explanation > > anywhere else. > > > I have an audio signal - some sine. Use a wavelabl to look at the > > waveform, and its maximum is at about 0.6. When I change the display into > > dB it shows about -5dB at that level. > > But this does not make sense - the formula is 10*log10(amplitude). So it > > should be -2.5dB. I have found, that this is because we use squares for > > comparison : > > 10 * log10(amp1^2 / amp2^2) = 20 * log10(amp1 / amp2) > > > They say it is often used in electronics to compare voltages, but why is > > it used in digital audio? Yeah I know that the digital values are > > equivalent to resulting electrical power, but we are not comparing anything > > to anything. So why should we square? > > > And if so, then when should we NOT square? > > > Thanks a lot. > > dmnc > > dB's always compare one power to another power by the formula that you > have written down. > > In electronics we often do not directly measure power, but rather > voltage. &#4294967295;Most of our measuring equipment measures things in voltage. > > So we are stuck in a position where we want to compare one power level > to another power level, but our measuring equipment measures voltages. > > (Also in DSP most of the time the A/D converter is getting a voltage > equivelent input) > > To properly compare one power level when we made the measurement in > voltage you have to first convert the measured voltage level into a > measured power level, and the reference voltage level into a reference > power level. > > Here is where the shortcut comes in, but remember, dB's always compare > power levels. &#4294967295;It is the definition. > > But when you are comparing voltage levels, it turns out you get to use > the trick of multiplying by 20*log(ratio) instead of 10*log(ratio), > becuase power proportional to the voltage squared. &#4294967295;so 10*log(V1^2/ > V2^2) is the same as > > 20*log(V1/V2). &#4294967295;This is a shortcut or trick. Always go back to dB's > compare power per the definition formula 10*log(P1/P2). > > The 20 log thing comes into play becuase in the real world you rarely > measure power directly. &#4294967295;You measure voltages directly, and then > apply the 20* trick to convert the voltages to power.- Hide quoted text - > > - Show quoted text -
PS I have a website that describes some DSP stuff. One of the programs that I wrote gives an overview of dB's as a precurser to understanding windowing. Look it over if you like. The dB stuff is on the first and especially second page of the program. http://www.fourier-series.com/fourierseries2/flash_programs/DFT_windows/index.html
On Oct 7, 9:14&#4294967295;pm, Randy Yates <ya...@ieee.org> wrote:
> glen herrmannsfeldt <g...@ugcs.caltech.edu> writes: > > Richard Owlett wrote: > > >> c...@claysturner.com in *ERRROOOORRRR* wrote: > > >>> Even in acoustics, we have 100 dB is 0.946 watts per square meter. > > >> I would agree IF *and only* IF you stated dbV, dbm, or db.... with > >> stated/implied load/impedance/**** > > > I presume that is for a propagating wave in air. &#4294967295;The actual power > > that goes into some detector (or other medium) depends on the > > impedance in that medium. > > But it's just like the electrical situation - if we assume the > same impedance for the reference as for the measured signal, > the two cancel and don't really matter - we can compute it from > the amplitudes (or equivalently, sound intensities). > > I think Richard is right. I think what Clay meant was 100 dB SPL. > -- > % &#4294967295;Randy Yates &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;% "Watching all the days go by... &#4294967295; &#4294967295; > %% Fuquay-Varina, NC &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;% &#4294967295;Who are you and who am I?" > %%% 919-577-9882 &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295;% 'Mission (A World Record)', > %%%% <ya...@ieee.org> &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; % *A New World Record*, ELOhttp://www.digitalsignallabs.com
Well when one talks about sound, db specifically refers to sound pressure level - that is why one doesn't need the "m" or something else to designate the reference power. Yes one may add the "SPL" to reduce ambiguity. Instead of so many watts per square meter, when can equivalently give a reference in terms of pascals which is simply newtons per square meter. As like with the electrical case, the reference units cancel - they must cancel infact. Arguments of transcendental functions must be unitless! Clay
clay@claysturner.com wrote:
> On Oct 7, 9:14 pm, Randy Yates <ya...@ieee.org> wrote: > Well when one talks about sound, db specifically refers to sound > pressure level - that is why one doesn't need the "m" or something > else to designate the reference power. Yes one may add the "SPL" to > reduce ambiguity.
I suggest it's all the same whether it's sound or radar or electrical signals or ... you name it. There is almost always a "standard" reference. With the standard reference people just stop saying: "referenced to....(whatever)" Referenced to a milliwatt as in dBm, Referenced to 1vrms (which can conjure up the impedance level if the reference AND the measurement don't match up in that regard). Referenced to 1 micropascal (generally used in water) Referenced to 20 micropascals (generally used in air) Reference to 1 newton/sq meter etc. etc. So, if you're going to say "SPL" then I would ask right away: in air or in water? Fred