DSPRelated.com
Forums

RMS Power of audio digital signal

Started by Martin February 25, 2004
Hi  to all,  I would like to compute the so called RMS Power but it's not
simple
 how seems to be.
RMS= square root ( sum of square (signal[k])/N)     (1)
First thing is :some programs like Cool Edit calculate the RMS with  a
negative number ( or zero)  and since the square root  (and the square) are
always  greater or equal to zero
 I think I must change something here.
The " unit " for RMS is decibel FS  (the maximum value possible for RMS is 0
dB FS).
My signal is  a sine wave in the range -32767,32767 with theoric RMS equal
to zero
( min,max and average  RMS are zero,too).
Cool Edit analysis obtains exactly these values for this signal.
To compute the RMS by myself,I transform the signal
normalizing it,that is  for each sample k compute
signal[k]=signal[k]/32767
and then taking the logarithm of the absolute values :
signal[k] =20*log10(abs(signal[k]))-0.7458     (the last one is a reference
costant).
Now I apply the equation (1) but I'm not able to find what to subctrat to
the calculate RMS  to match Cool Edit's results .
Someone know where I'm wrong?



You should be doing equation (1) before you do the log conversion.  The
order should be 1) normalize signal, 2) take RMS, 3) convert to dB.

CoolEdit's RMS numbers are in dB relative to full scale, calibrated for a
sinusoidal input.  If you create a full-scale sine wave, you will see an RMS
value of 0dB (or very nearly so).  If you create a full scale square wave,
you will see a +3dBFS RMS.  Because of this, you will need to add a
correction factor based on the RMS value of a sine wave to match CoolEdit.
I think just adding 3dB to your final result is all that is required.

"Martin" <martindegaio@lycos.com> wrote in message
news:OZ8%b.33204$FJ6.1232515@twister1.libero.it...
> Hi to all, I would like to compute the so called RMS Power but it's not > simple > how seems to be. > RMS= square root ( sum of square (signal[k])/N) (1) > First thing is :some programs like Cool Edit calculate the RMS with a > negative number ( or zero) and since the square root (and the square)
are
> always greater or equal to zero > I think I must change something here. > The " unit " for RMS is decibel FS (the maximum value possible for RMS is
0
> dB FS). > My signal is a sine wave in the range -32767,32767 with theoric RMS equal > to zero > ( min,max and average RMS are zero,too). > Cool Edit analysis obtains exactly these values for this signal. > To compute the RMS by myself,I transform the signal > normalizing it,that is for each sample k compute > signal[k]=signal[k]/32767 > and then taking the logarithm of the absolute values : > signal[k] =20*log10(abs(signal[k]))-0.7458 (the last one is a
reference
> costant). > Now I apply the equation (1) but I'm not able to find what to subctrat to > the calculate RMS to match Cool Edit's results . > Someone know where I'm wrong? > > >
Yes! It works fine! Thank you for your help.


"Jon Harris" <goldentully@hotmail.com> ha scritto nel messaggio
news:c1j6mo$1jq139$1@ID-210375.news.uni-berlin.de...
> You should be doing equation (1) before you do the log conversion. The > order should be 1) normalize signal, 2) take RMS, 3) convert to dB. > > CoolEdit's RMS numbers are in dB relative to full scale, calibrated for a > sinusoidal input. If you create a full-scale sine wave, you will see an
RMS
> value of 0dB (or very nearly so). If you create a full scale square wave, > you will see a +3dBFS RMS. Because of this, you will need to add a > correction factor based on the RMS value of a sine wave to match CoolEdit. > I think just adding 3dB to your final result is all that is required.
what would be the most efficient way in terms of area to perform the above
equation (1) - calculating RMS of signal in digital domain in FPGA?
Seems to me like dividing with N and square root can take a lot of
resources?
At how many samples is this done? Last "n" samples or all samples as long
as your program is running?
---------------------------------------
Posted through http://www.DSPRelated.com
there is no mathematical meaning to RMS power

there is RMS voltage
and RMS current

and V RMS x I RMS x phase = AVERAGE power.

RMS Power is a misnomer and not mathematically correct
however it is often (mis) used

Mark


On Thursday, February 26, 2004 at 11:04:30 AM UTC+13, Martin wrote:
> Hi to all, I would like to compute the so called RMS Power but it's not > simple > how seems to be. > RMS= square root ( sum of square (signal[k])/N) (1) > First thing is :some programs like Cool Edit calculate the RMS with a > negative number ( or zero) and since the square root (and the square) are > always greater or equal to zero > I think I must change something here. > The " unit " for RMS is decibel FS (the maximum value possible for RMS is 0 > dB FS). > My signal is a sine wave in the range -32767,32767 with theoric RMS equal > to zero > ( min,max and average RMS are zero,too). > Cool Edit analysis obtains exactly these values for this signal. > To compute the RMS by myself,I transform the signal > normalizing it,that is for each sample k compute > signal[k]=signal[k]/32767 > and then taking the logarithm of the absolute values : > signal[k] =20*log10(abs(signal[k]))-0.7458 (the last one is a reference > costant). > Now I apply the equation (1) but I'm not able to find what to subctrat to > the calculate RMS to match Cool Edit's results . > Someone know where I'm wrong?
No. The RMS is the same as standard deviation when the mean is zero. So just calculate the sum of squares, divide by N and take the square root. That is once the numbers have been converted to amplitude levels of course.
On Thursday, October 22, 2015 at 3:29:45 AM UTC+13, mako...@yahoo.com wrote:
> there is no mathematical meaning to RMS power > > there is RMS voltage > and RMS current > > and V RMS x I RMS x phase = AVERAGE power. > > RMS Power is a misnomer and not mathematically correct > however it is often (mis) used > > Mark
Indeed it is by hi-fi idiots who talk of peak power.
<makolber@yahoo.com> wrote:

>RMS Power is a misnomer and not mathematically correct >however it is often (mis) used
I agree. What it means, as jargon is usually something like "Power measured by a true RMS calculation of voltage or current, instead of a less accurate approximation". Steve
gyansorova@gmail.com writes:

> On Thursday, October 22, 2015 at 3:29:45 AM UTC+13, mako...@yahoo.com wrote: >> there is no mathematical meaning to RMS power >> >> there is RMS voltage >> and RMS current >> >> and V RMS x I RMS x phase = AVERAGE power. >> >> RMS Power is a misnomer and not mathematically correct >> however it is often (mis) used >> >> Mark > > Indeed it is by hi-fi idiots who talk of peak power.
RMS is an average, theoretically over infinity, which can be defined as xrms = sqrt{lim_{T \approaches\infty} \frac{1}{T}\int_{-T/2}^{T/2} |x|^2 dx} Now there are certainly useful concepts of power over the shorter term. I wouldn't call them total idiots! -- Randy Yates Digital Signal Labs http://www.digitalsignallabs.com
Randy Yates <yates@digitalsignallabs.com> writes:

> gyansorova@gmail.com writes: > >> On Thursday, October 22, 2015 at 3:29:45 AM UTC+13, mako...@yahoo.com wrote: >>> there is no mathematical meaning to RMS power >>> >>> there is RMS voltage >>> and RMS current >>> >>> and V RMS x I RMS x phase = AVERAGE power. >>> >>> RMS Power is a misnomer and not mathematically correct >>> however it is often (mis) used >>> >>> Mark >> >> Indeed it is by hi-fi idiots who talk of peak power. > > RMS is an average, theoretically over infinity, which can be defined as > > xrms = sqrt{lim_{T \approaches\infty} \frac{1}{T}\int_{-T/2}^{T/2} |x|^2 dx} > > Now there are certainly useful concepts of power over the shorter term. > I wouldn't call them total idiots!
PS: I'm not trying to change the nomenclature: I agree V RMS x I RMS is by convention "average power." I'm just saying this method of computing power is based on an average over a long time, and that averages performed over shorter intervals have their uses. -- Randy Yates Digital Signal Labs http://www.digitalsignallabs.com