Re: math calculation problem when looking for silence
- From: "Tsviatko Jongov" <johngov@xxxxxxxxx>
- Date: 4 Dec 2006 01:18:18 -0800
Hi Jack
First I want to recommend you some links related to this issue:
http://en.wikipedia.org/wiki/Logarithm
http://en.wikipedia.org/wiki/Decibel
dB can be calculated from the following formula
X dB = -20 * log10( V / Vmax),
where X is the result in dB, log10 is logarithm in base 10, V is the
current level value and
Vmax is the max lelvel value.
In your case:
5 dB = -20 * log10( V / 70), where V is the value you're looking for.
In most programming languages there is no such thing as logarithm in
base 10,
but there is logarithm in base "e" - ln.
So I'll transform the formula from log10 to ln :
5 dB = -20 * ln( V / 70 ) / ln( 10 )
And from here:
(5dB / -20) * ln(10) = ln(V / 70)
ln(10^(5dB / -20)) = ln(V / 70), where "^" denotes the power function.
10 ^ (5dB / -20) = V / 70
V = 70 * 10 ^ (5 / -20) = 39.3638.. from your range from 0 to 70.
Regards,
Tsviatko Jongov
http://tsviatko.jongov.com
Jack написа:
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
.
- References:
- Prev by Date: math calculation problem when looking for silence
- Next by Date: Re: math calculation problem when looking for silence
- Previous by thread: math calculation problem when looking for silence
- Next by thread: Re: math calculation problem when looking for silence
- Index(es):
Relevant Pages
|