Re: How metering is calculated...
Re: How metering is calculated...
- Subject: Re: How metering is calculated...
- From: Greg Guerin <email@hidden>
- Date: Mon, 1 Mar 2010 14:25:27 -0700
Grant Robinson wrote:
float sum = 0.0;
while (looping) {
int16_t val = *data;
float normalVal = val / 32767.0;
sum += (normalVal * normalVal);
numSamples++;
}
float rms = sqrtf(sum/numSamples);
float power = 20*log10f(rms/base);
If that's your actual code, then you've neglected to advance the
'data' pointer. This will cause the averaging interval to be
identical to the sample interval.
If that's just an outline of your actual code, then I guess it shows
one of the hazards of not posting the actual code: people like me
will interpret it as actual code.
-- GG
_______________________________________________
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