DSPRelated.com
Forums
Online · Live + on demand
February 9-11, 2027
Price goes up Jan 1: register now to lock in today's rate
Register Now →

Audio real-time analyzer: power spectrum or amplitude spectrum?

Started by Tyler Mandry ●July 15, 2011
Tyler Mandry schrieb:
> On Jul 15, 3:41 pm, Sebastian Doht<seb_d...@lycos.com> wrote: >> Tyler Mandry schrieb: >> >> >... >> >> http://en.wikipedia.org/wiki/Decibel > > I understand what a decibel is. Decibels could be used to describe > either amplitude or power (squared amplitude.) I'm trying to figure > out which one I should use for my application.
No a dB describes a power ratio with L[dB] = 10*log10(Pa/Pb). Of course by using simple mathematics this ratio can also be computed by L[dB] = 20*log10(Aa/Ab). As others have pointed out it is all a question of proper normalisation and scaling.
Hi,

since you want to know what you hear I would go for the power. 
Converted into sound it will also be measured in power.

markus

Am 15.07.2011 22:28, schrieb Tyler Mandry:
> I'm creating an FFT-based real-time analyzer for audio (i.e. live > sound,) and have pretty much everything figured out except for this > one thing: should I plot the power spectrum (log of the _square_ of > the magnitude of FFT outputs,) or the amplitude spectrum (log of the > "plain old" magnitude of the FFT outputs)? (I think I'm using these > terms correctly; correct me if I'm wrong.) > > Every description of the method I see says to use one of these two > methods, but none of them say why you should square or not square the > FFT magnitudes. I'm sure each answer has its own uses. I'd just like > to know what the "norm" is for simple audio Real-Time Analyzers. > Particularly, if anyone knows what Smaart's RTA does, I'd be > interested in hearing that. > > As I understand it, a +3dB difference in an amplitude spectrum > corresponds to double the sound pressure, but it takes a +6dB > difference for it to sound twice as loud to humans. Whereas in a power > spectrum, +3dB is the same as +6dB in an amplitude spectrum. If I'm > not mistaken, SPL (and every other basic topic in audio) behaves like > (uses) amplitude, not power, so I'm leaning toward amplitude, but the > prevalence of people that say to square the magnitude has me confused. > > Am I wrong about any of these things? Please help me sort through this > confusion.
On Jul 16, 6:17&#4294967295;am, Markus Freund <markus.fre...@s2005.tu-chemnitz.de>
wrote:
> Hi, > > since you want to know what you hear I would go for the power. > Converted into sound it will also be measured in power. > > markus
dB is about power *by definition*. Unadorned, it is a power ratio. An extension (dBm, dBu, etc.) can specify a reference level. Jerry -- Engineering is the art of making what you want from things you can get.
On 07/16/2011 08:22 AM, Jerry Avins wrote:
> On Jul 16, 6:17 am, Markus Freund<markus.fre...@s2005.tu-chemnitz.de> > wrote: >> Hi, >> >> since you want to know what you hear I would go for the power. >> Converted into sound it will also be measured in power. >> >> markus > > dB is about power *by definition*. Unadorned, it is a power ratio. An > extension (dBm, dBu, etc.) can specify a reference level.
Thank you. Thank you, thank you, thank you! Here is a section from a very old textbook on the topic: http://www.digitalsignallabs.com/db.pdf -- Randy Yates % "Watching all the days go by... Digital Signal Labs % Who are you and who am I?" mailto://yates@ieee.org % 'Mission (A World Record)', http://www.digitalsignallabs.com % *A New World Record*, ELO
On Sat, 16 Jul 2011 12:29:06 -0400, Randy Yates <yates@ieee.org> wrote:

>On 07/16/2011 08:22 AM, Jerry Avins wrote: >> On Jul 16, 6:17 am, Markus Freund<markus.fre...@s2005.tu-chemnitz.de> >> wrote: >>> Hi, >>> >>> since you want to know what you hear I would go for the power. >>> Converted into sound it will also be measured in power. >>> >>> markus >> >> dB is about power *by definition*. Unadorned, it is a power ratio. An >> extension (dBm, dBu, etc.) can specify a reference level. > >Thank you. Thank you, thank you, thank you! > >Here is a section from a very old textbook on the topic: > > http://www.digitalsignallabs.com/db.pdf
I love it, there's an illustration using a slide rule. Also, very depressing that a book published in 1972 is now considered very old. ;-) -- Rich Webb Norfolk, VA
On Jul 15, 1:46&#4294967295;pm, Tyler Mandry <tman...@gmail.com> wrote:
> ...
> > I understand what a decibel is. Decibels could be used to describe > either amplitude or power (squared amplitude.) I'm trying to figure > out which one I should use for my application.
As many have pointed out, a scale factor takes care of the difference between magnitude and power if you are interested in only a single point. There is a difference if you with to expand your capabilities to including plots of functions of points. For example, if you wish to plot mean or variance of a block of data points and then take the log. (And then of course there are those who have plotted means or variances of blocks of dB values where the difference doesn't matter, but it's not the same as a plot of the dB of a mean or variance of the block of linear data.) So many choices :) Dale B. Dalrymple
Jerry Avins <jya@ieee.org> wrote:

(snip, someone wrote)
>> since you want to know what you hear I would go for the power. >> Converted into sound it will also be measured in power.
> dB is about power *by definition*. Unadorned, it is a power ratio. An > extension (dBm, dBu, etc.) can specify a reference level.
I agree. Still, it is an interesting question, is there ever a need to specify a logarithmic amplitude? In quantum mechanics and optics, the term 'amplitude' usually also includes phase. (Unlike is usual in DSP.) There is a favorite saying, something like: "For the coherent case add amplitude, for the incoherent case add intensity" (where intensity is the absolute square of amplitude). Often the amplitude is represented as a complex value, instead of magnitude and phase, but it works the same either way. It would seem pretty unusual to take the log of a complex amplitude though, and even though I have a calculator that will do it, even more rare to do it in base 10. Continuing, optical absorption is commonly specified as the base 10 log. (Not 10log10 as dB.) In the case of an absorption filter in a coherent system, it would seem that one might need the base 10 log of an amplitude. Even more interesting of one wants to include the complex index of refraction for a filter in a coherent system. So far, though, I don't see a use for base 10 log amplitude in a DSP (or ASP) system. -- glen
On Jul 16, 12:29&#4294967295;pm, Randy Yates <ya...@ieee.org> wrote:
> On 07/16/2011 08:22 AM, Jerry Avins wrote: > > > On Jul 16, 6:17 am, Markus Freund<markus.fre...@s2005.tu-chemnitz.de> > > wrote: > >> Hi, > > >> since you want to know what you hear I would go for the power. > >> Converted into sound it will also be measured in power. > > >> markus > > > dB is about power *by definition*. Unadorned, it is a power ratio. An > > extension (dBm, dBu, etc.) can specify a reference level. > > Thank you. Thank you, thank you, thank you! > > Here is a section from a very old textbook on the topic: > > &#4294967295; &#4294967295;http://www.digitalsignallabs.com/db.pdf
Good find! The book is not completely accurate any more. Equ. 7.10 defines dBm as 10*log10(P/1mw)on a 600-ohm line. The modern definition (still widely ignored) omits the impedance specification. I mw on a 600-ohm is .7746V RMS. The dBu is defined as 20*log10(V/.7746) without regard to impedance and is how VU meters are calibrated. Jerry -- Engineering is the art of making what you want from things you can get.
On Jul 16, 1:17&#4294967295;pm, Rich Webb <bbew...@mapson.nozirev.ten> wrote:
> On Sat, 16 Jul 2011 12:29:06 -0400, Randy Yates <ya...@ieee.org> wrote: > >On 07/16/2011 08:22 AM, Jerry Avins wrote: > >> On Jul 16, 6:17 am, Markus Freund<markus.fre...@s2005.tu-chemnitz.de> > >> wrote: > >>> Hi, > > >>> since you want to know what you hear I would go for the power. > >>> Converted into sound it will also be measured in power. > > >>> markus > > >> dB is about power *by definition*. Unadorned, it is a power ratio. An > >> extension (dBm, dBu, etc.) can specify a reference level. > > >Thank you. Thank you, thank you, thank you! > > >Here is a section from a very old textbook on the topic: > > > &#4294967295;http://www.digitalsignallabs.com/db.pdf > > I love it, there's an illustration using a slide rule. Also, very > depressing that a book published in 1972 is now considered very old. ;-) > > -- > Rich Webb &#4294967295; &#4294967295; Norfolk, VA
If you like sliderule illustrations, set your browser window to full width and GOTO http://www.antiquark.com/sliderule/sim/n4es/virtual-n4es.html. The site has several working models. http://www.antiquark.com/sliderule/sim/ Jerry -- Engineering is the art of making what you want from things you can get.
On Jul 16, 8:28&#4294967295;am, Tyler Mandry <tman...@gmail.com> wrote:
> I'm creating an FFT-based real-time analyzer for audio (i.e. live > sound,) and have pretty much everything figured out except for this > one thing: should I plot the power spectrum (log of the _square_ of > the magnitude of FFT outputs,) or the amplitude spectrum (log of the > "plain old" magnitude of the FFT outputs)? (I think I'm using these > terms correctly; correct me if I'm wrong.) > > Every description of the method I see says to use one of these two > methods, but none of them say why you should square or not square the > FFT magnitudes. I'm sure each answer has its own uses. I'd just like > to know what the "norm" is for simple audio Real-Time Analyzers. > Particularly, if anyone knows what Smaart's RTA does, I'd be > interested in hearing that. > > As I understand it, a +3dB difference in an amplitude spectrum > corresponds to double the sound pressure, but it takes a +6dB > difference for it to sound twice as loud to humans. Whereas in a power > spectrum, +3dB is the same as +6dB in an amplitude spectrum. If I'm > not mistaken, SPL (and every other basic topic in audio) behaves like > (uses) amplitude, not power, so I'm leaning toward amplitude, but the > prevalence of people that say to square the magnitude has me confused. > > Am I wrong about any of these things? Please help me sort through this > confusion.
You could do this in 5 mins with LabView.