Re: True RMS value for audio samples
Re: True RMS value for audio samples
- Subject: Re: True RMS value for audio samples
- From: Luigi Castelli <email@hidden>
- Date: Mon, 9 Jul 2007 12:00:38 -0700 (PDT)
Ok,
what I am trying to implement is a true RMS meter with ballistics, exactly like SpectraFoo has it. (the purple one)
So, if I understand you correctly, the size of the RMS compute window has to be calculated according to the lowest frequency wave you want to meter.
So, for instance, if I want to meter a 10Hz wave then my window has to be at least 100ms long which at 44.1 kHz translates to a window length of 4410 samples. Am I correct ?
Immediately, though, I am thinking that this is gonna lead to a problem: the fastest response time I can achieve will be limited by the lowest wave length I want to meter.
In other words if I want my RMS attack time to be 10ms (standard PPM metering) then I won't be able to meter waves lower than 100Hz. Am I totally off here ?
Is there a way to decouple lowest frequency detected and meter response time ? or should I just pick the best compromise between the two ?
- Luigi
------------------------------------------------------------
THIS E-MAIL MESSAGE IS FOR THE SOLE USE OF THE INTENDED RECIPIENT AND MAY CONTAIN CONFIDENTIAL AND/OR PRIVILEGED INFORMATION. ANY UNAUTHORIZED REVIEW, USE, DISCLOSURE OR DISTRIBUTION IS PROHIBITED. IF YOU ARE NOT THE INTENDED RECIPIENT, CONTACT THE SENDER BY E-MAIL AT email@hidden AND DESTROY ALL COPIES OF THE ORIGINAL MESSAGE. WITHOUT PREJUDICE UCC
1-207.
------------------------------------------------------------
----- Original Message ----
From: B.J. Buchalter <email@hidden>
To: Luigi Castelli <email@hidden>
Cc: email@hidden
Sent: Monday, July 9, 2007 11:11:14 AM
Subject: Re: True RMS value for audio samples
> Yes, to
> speed things up, I thought of doing a moving average like you
> suggested, however what kept me from going ahead and implementing it,
> is the concern that - doing it that way - I am gonna encounter
> round-off error problems really soon, because I am performing 44100
> additions and 44100 subtractions per second on the same number.
> What's your take on that ?
If you really want a moving window it is not a problem; just don't
divide the accumulator variable (do the divide on the accumulator
when you present the data) You are processing fixed point values
(even if you are doing it with floats) -- the adds and subtracts are
exact.
> in response to B.J.:
>
> first of all - I love SpectraFoo. Congrats for writing such a
> brilliant app.
Thanks!
> second - could you please elaborate on your statement:
>
> "You need to compute the true RMS with the moving average and then
> use that to drive your meter attack and release data."
>
> If
> I implement a moving average window then it doesn't make sense to talk
> about attack and release because the attack and release times will be
> given to me implicitly by the length of the window (i.e. the amount of
> averaging). How could I still have an attack and a release time
> independent from each other in a moving average implementation ? Also
> how am I to determine the optimal length of the window ?
Well, I guess it depends on what you are trying to accomplish.
If you are trying to implement an RMS meter with ballistics, then
what you want to do is filter the short-time RMS level. Here is a
hint: the size of the RMS compute window can be much smaller than the
time constant of the ballistics filter. In addition, the RMS compute
does not need to be a moving average (if you are doing a ballistics
filter on the RMS data). The RMS compute window needs to be long
enough to give a valid estimate of the RMS power of the signal (so it
should be longer than the expected length of the longest wavelength
you plan on metering -- otherwise the RMS level will wobble with the
segment of the signal -- since it is not true RMS).
If you simply want a moving RMS meter, than choose a window size that
matches the time that corresponds to the RMS sample you want.
If you want a true RMS meter for known periodic signals (for example
to measure the RMS power of a harmonic signal), then you would be
best off to add zero crossing detection and compute the RMS of an
integral number of waves.
Best regards,
B.J. Buchalter
Metric Halo
http://www.mhlabs.com
____________________________________________________________________________________
Get your own web address.
Have a HUGE year through Yahoo! Small Business.
http://smallbusiness.yahoo.com/domains/?p=BESTDEAL
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden