Re: math calculation problem when looking for silence
- From: NoSpam@xxxxxxxxxxx (Bob Masta)
- Date: Mon, 04 Dec 2006 14:06:52 GMT
On Sun, 3 Dec 2006 23:08:28 -0500, "Jack" <replyto@it> wrote:
Hi,
I have basic math calculation understanding problem.
Let say user selectable Silence level is 5dB.
My code is calculating average volume value carrying by the receiving
buffer.
That value is just an absolute value (in range of 0 to 70)
How should I relate that average value to that Silence level threshold set
at 5 dB to find out if that qualifies as a silence or not?
What kind of calculation that does it take?
Your help with the formula will be deeply appreciated,
Jack
To add to what the other posts cover, note that although
dB is always relative to something, it is common to see
"dB SPL". This is an *absolute* dB value, since the
reference is a constant implied by the "SPL" in the
designation, namely the (idealized) threshold of human
hearing at 20 microPascals.
You don't mention SPL for your silence threshold,
but the value of 5 dB SPL is a reasonable hearing threshold
for a typical listener in a quiet room. However, it's probably
a bit too soft for most real-world applications.
Now comes the kicker: If you want to convert your
sound card settings to dB SPL, you have to do a complete
system calibration. You have to know the dB SPL value
corresponding to full-scale binary (+32767) and you have
to know the relative dB attenuation provided by the current
mixer setting. The full-scale value depends upon external
factors like amplifiers and mic and speaker sensitivity, listerner
position, etc. The relative attenuation from full-scale is a function
of your particular sound card, but there is no way to obtain that
information through API calls, etc.... you have to calibrate it
yourself.
One simple work-around for many cases is to have the user
set the value for his hearing threshold by adjusting a beeping
tone until he can just detect it, then use that binary value as the
reference for your system. There are still a few caveats with
this approach (like keeping the same mixer setting, but not
getting into quantization distortion at low sound levels), but
it's still easier than a full calibration.
Best regards,
Bob Masta
dqatechATdaqartaDOTcom
D A Q A R T A
Data AcQuisition And Real-Time Analysis
www.daqarta.com
Home of DaqGen, the FREEWARE signal generator
.
- References:
- Prev by Date: Re: Is timeGetTime monotonic and uniform?
- Next by Date: Re: Direct Sound GetCurrentPosition
- Previous by thread: Re: math calculation problem when looking for silence
- Index(es):
Relevant Pages
|