Re: math calculation problem when looking for silence



Jack wrote:
Let say user selectable Silence level is 5dB.

Decibels are a *relative* measure of level, so you have to specify 5dB
*with respect to* something; only then does your question make sense.

One reference you can use is the peak level, because that is always
well defined in a PCM environment. So you might set the threshold for
'silence' as -30 dBpk, i.e. 30 dB below the peak level.

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)

So if we take 70.0 as the peak level, 30 dB below that would be
70/(10^1.5) or about 2.2, assuming that your 'volume' measure is
proportional to voltage rather than power:

deciBels = 20 * LOG(voltage_ratio)

Richard.
http://www.rtrussell.co.uk/
To reply by email change 'news' to my forename.

.


Loading