• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: True RMS value for audio samples
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: True RMS value for audio samples


  • Subject: Re: True RMS value for audio samples
  • From: "B.J. Buchalter" <email@hidden>
  • Date: Mon, 9 Jul 2007 14:11:14 -0400


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
	

_______________________________________________
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


References: 
 >Re: True RMS value for audio samples (From: Luigi Castelli <email@hidden>)

  • Prev by Date: Re: True RMS value for audio samples
  • Next by Date: Re: Basic sample code for FFT audio frequency spectrum?
  • Previous by thread: Re: True RMS value for audio samples
  • Next by thread: Re: True RMS value for audio samples
  • Index(es):
    • Date
    • Thread