• 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: How metering is calculated...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: RE: Input sidechain and AU-Lab
  • Next by Date: Re: How metering is calculated...
  • Previous by thread: Re: How metering is calculated...
  • Next by thread: Concurrency programming in Audio Units...
  • Index(es):
    • Date
    • Thread