• 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: Calculating peak level in db
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calculating peak level in db


  • Subject: Re: Calculating peak level in db
  • From: Gerd Castan <email@hidden>
  • Date: Sun, 13 Oct 2002 09:27:14 +0200

Hi all,

James Chandler Jr wrote:
PeakDB = 20.0 * Log10(abs(MaxSampleValue));

This is what I was seeking for. Now I get the same
values the Delta Control Panel displays.
(=(20/ln(10))*ln(maxAbsSampleValue);

By the way, I don't calculate abs of the max sample value
but max of (abs of each sample value)

When you are notified of the samplerate of the audio, figure out how many
samples will fit in a 1/10th second interval, or however often you want to
update the on-screen meter. Every time a buffer comes thru your program,
scan the buffer looking for the max absolute value. After you have scanned
enough samples or buffers to exceed a 1/10th second interval, calculate
PeakDB = 20.0 * Log10(MaxSampleValue), and then schedule a process (or set a
flag, whatever) that will draw the current PeakDB to the on-screen meter.

I do it the other way round:
The recording thread updates max(abs(value)) per channel.

I have a second thread that asks for (and resets) these values 10 to 30
times a second and triggers a redraw.

Thanks to all,
Gerd
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Calculating peak level in db
      • From: Brian Willoughby <email@hidden>
    • Re: Calculating peak level in db
      • From: "James Chandler Jr." <email@hidden>
  • Prev by Date: Re: AudioUnit : how to communicate from DSP to GUI ?
  • Next by Date: pixel-based metering [was: Calculating peak level in db]
  • Previous by thread: Re: Calculating peak level in db
  • Next by thread: Re: Calculating peak level in db
  • Index(es):
    • Date
    • Thread