<div class="gmail_quote">On Mon, Jul 25, 2011 at 12:03 PM, Fons Adriaensen <span dir="ltr"><<a href="mailto:fons@linuxaudio.org">fons@linuxaudio.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5">On Mon, Jul 25, 2011 at 11:43:14AM -0400, David Robillard wrote:<br>
<br>
> */<br>
> typedef struct _LV2_PUI_Peak_RMS_Data {<br>
><br>
> /**<br>
> The start of the measurement period. This is just a<br>
> running counter that must not be interpreted as any<br>
> sort of global frame position. It should only be<br>
> interpreted relative to the starts of other<br>
> measurement periods in port_event() calls to the same<br>
> plugin instance.<br>
><br>
> This counter is allowed to overflow, in which case it<br>
> should just wrap around.<br>
> */<br>
> uint32_t period_start;<br>
><br>
> /**<br>
> The size of the measurement period, in the same units<br>
> as period_start.<br>
> */<br>
> uint32_t period_size;<br>
><br>
> /**<br>
> The peak value for the measurement period. This<br>
> should be the maximal value for abs(sample) over all<br>
> the samples in the period.<br>
> */<br>
> float peak;<br>
><br>
> /**<br>
> The RMS value for the measurement period. This should<br>
> be the root mean square value of the samples in the<br>
> period, equivalent to sqrt((pow(sample1, 2) +<br>
> pow(sample2, 2) + ... + pow(sampleN, 2)) / N) where N<br>
> is period_size.<br>
> */<br>
> float rms;<br>
><br>
> } LV2_PUI_Peak_RMS_Data;<br>
<br>
</div></div>In all cases I know of the RMS value required for metering, dynamics<br>
processing, etc. is *not* the average over a period, nor over any other<br>
rectangular window. It is the result of applying a specific lowpass<br>
filter on the squared samples, which one depends on the application.<br>
<br>
This means that:<br>
<br>
* period_start: can be useful.<br>
* period_size: should be defined as the number of samples processed<br>
since the last event.<br>
* The definition of RMS as you provide it should be dropped.<br>
<br>
Ciao,<br>
<br>
--<br>
<font color="#888888">FA<br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
Linux-audio-dev mailing list<br>
<a href="mailto:Linux-audio-dev@lists.linuxaudio.org">Linux-audio-dev@lists.linuxaudio.org</a><br>
<a href="http://lists.linuxaudio.org/listinfo/linux-audio-dev" target="_blank">http://lists.linuxaudio.org/listinfo/linux-audio-dev</a><br>
</div></div></blockquote></div><br><br>Hi Fons,<br>
<br>
I'm interested in what you're saying about RMS metering. Could you give
me specifics or point me to a reference? I can't find anything by
googling. What sort of low pass filter is used for audio metering, for example?<br><br>Jeremy<br>