• 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: Getting average power / peak power (sound monitoring)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting average power / peak power (sound monitoring)


  • Subject: Re: Getting average power / peak power (sound monitoring)
  • From: Jerry Krinock <email@hidden>
  • Date: Mon, 19 Jun 2006 16:33:31 -0700
  • Thread-topic: Getting average power / peak power (sound monitoring)

on 06/06/19 12:45, Neil Clayton at email@hidden wrote:

> Does anyone know how to get a level (avg power, peak power) meter
> reading from some kind of sound input device?

If CoreAudio is too heavyweight, and no one on the list offers a better
solution, you roll your own algorithm...

Average Power:  Average of the squares of the magnitude samples over a given
period, the "window".  In real time, as each new sample appears, you
subtract the oldest sample from the sum and add in the new one.  For further
smoothing, process the result with an first-order infinite impules response
(IIR) filter.

Peak Power: Same idea, except you use the maximum of the squares
(MAX(newSampleSquared,oldMaxSquare)) instead of their average.

In either case, you adjust the window length and IIR filter time constant
("beta" factor) to get the desired smoothing, which depends on how often
you're going to update your display.

Probably the most fun you'll have all week!


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Getting average power / peak power (sound monitoring)
      • From: "Neil Clayton" <email@hidden>
References: 
 >Getting average power / peak power (sound monitoring) (From: Neil Clayton <email@hidden>)

  • Prev by Date: Re: Lengthy questions from a newbie
  • Next by Date: Re: Lengthy questions from a newbie
  • Previous by thread: Getting average power / peak power (sound monitoring)
  • Next by thread: Re: Getting average power / peak power (sound monitoring)
  • Index(es):
    • Date
    • Thread