Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sound pressure display for WAVE PCM data

The digital sound is playing using DirectSound device. It is necessary to display sound activity in decibels - like analog devices do.

What is the right way to calculate sound pressure from the WAVE PCM data (44100 Hz, 16-bit)?

like image 665
LicenseQ Avatar asked Feb 11 '09 02:02

LicenseQ


1 Answers

if you just need an "idea" of the sound pressure, you can simply compute the log-energy on some time franmes of the signal: split the signal every N samples, compute 10*log(sum(xn**2)) where x are the N samples, and you get a value in the dB domain. If you need to precisely display a measure (that is your 0 dB matches say a mixtable 0dB), it is a bit more complicated.

See here for more details:

http://music.columbia.edu/pipermail/music-dsp/2002-April/048341.html

like image 129
David Cournapeau Avatar answered Oct 11 '22 07:10

David Cournapeau